lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Jan 2023 15:16:27 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     John Ogness <john.ogness@...utronix.de>
Cc:     Sergey Senozhatsky <senozhatsky@...omium.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH printk v3 6/6] printk: introduce
 console_prepend_dropped() for dropped messages

On Tue 2023-01-03 14:50:23, John Ogness wrote:
> On 2023-01-03, Petr Mladek <pmladek@...e.com> wrote:
> > Well, what about making sure that something more useful is always
> > printed. For example:
> >
> > 	/*
> > 	 * Make sure outbuf is sufficiently large before prepending.
> > 	 * Keep at least the prefix when the message has to be truncated.
> > 	 * It is a rather theoretical problem when someone tries to
> > 	 * use a minimalist buffer.
> > 	 */
> > 	if (WARN_ON_ONCE(len + PREFIX_MAX + 1 >= outbuf_sz))
> > 		return;
> 
> I am fine with this. We won't see this warning anyway. Few lines would
> ever be printed correctly if anyone ever tries to use a buffer so small.

Yup.

> > If we want to use this way. It would probably make sense to
> > rename PREFIX_MAX to CONSOLE_PREFIX_MAX.
> 
> Actually, I would like to rename all of those limit macros to something
> that makes more sense for the new code base:
> 
> CONSOLE_EXT_LOG_MAX -> CONSOLE_MESSAGE_MAX
> 
> CONSOLE_LOG_MAX     -> SYSLOG_MESSAGE_MAX

Heh, we actually do not need this. The size of @scratchbuf
might be LOG_LINE_MAX/PRINTK_RECORD_MAX. The scratch buffer
is newly used only to read the plain message. The prefixes
are added to @outbuf.

> LOG_LINE_MAX        -> PRINTK_RECORD_MAX
> 
> PREFIX_MAX          -> CONSOLE_PREFIX_MAX

I like this.

> I have a patch to do this ready, but I did not want to post it until we
> are finished with the thread/atomic work.

It would make sense to do this as part of this patchset. But I do not
want to delay it too much. Feel free to do it later.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ