Re: [PATCH next 1/2] printk: avoid and/or handle record truncation
From: Sergey Senozhatsky
Date: Tue Sep 29 2020 - 09:04:18 EST
On (20/09/26 04:01), John Ogness wrote:
> + if (text_len > buf_size) {
> + text_len = buf_size;
> + truncated = true;
> + }
> +
> prefix_len = info_print_prefix(r->info, syslog, time, prefix);
>
> /*
> @@ -1911,7 +1916,7 @@ static size_t log_output(int facility, int level, enum log_flags lflags,
> struct printk_record r;
>
> prb_rec_init_wr(&r, text_len);
> - if (prb_reserve_in_last(&e, prb, &r, caller_id)) {
> + if (prb_reserve_in_last(&e, prb, &r, caller_id, LOG_LINE_MAX)) {
Are we going to pass anything other than LOG_LINE_MAX? If not then
maybe we can drop that argument and compare the text_buf_size to
LOG_LINE_MAX?
-ss