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:   Wed, 4 Oct 2017 15:28:17 +0200
From:   Petr Mladek <pmladek@...e.com>
To:     pierre kuo <vichy.kuo@...il.com>
Cc:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        rostedt@...dmis.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC V2] printk: add warning while drop partial text in msg

On Wed 2017-09-27 21:59:52, pierre kuo wrote:
> hi:
> > printk_deferred("%s", local_string[2048]) makes no sense anyway,
> > since we limit the message size to 1024 - HEADER chars in
> > vprintk_emit()  // see static char textbuf[LOG_LINE_MAX].
> 
> We use the example in this mail since we try to collect the message at
> different places in our driver.
> And batch to printk for saving individual output time and group
> message together.

I wonder what is the motivation for the extra buffering. Did you
have troubles with direct printk() calls? For example, because
of performance, mixed messages, deadlocks?

Note that any buffering is potentially dangerous. You might miss
the messages if the system dies before they are flushed. Also
you might lose messages if the buffer is too small.


> > I'm not quite following what were you trying to prove, sorry.
> >does any function in the upstream kernel printk()-s buffers
> >larger than LOG_LINE_MAX? which one?
> 
> You are correct.
> The upstream kernel printk()-s buffers are indeed smaller LOG_LINE_MAX
> and not with multi "\n" like this example did.

You might go around this by flushing the buffer line by line.
Well, it might get quite complicated, see printk_safe_flush_buffer().
Another question is if the buffering makes sense then.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ