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]
Message-ID: <20200924090653.GC541@jagdpanzerIV.localdomain>
Date:   Thu, 24 Sep 2020 18:06:53 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        John Ogness <john.ogness@...utronix.de>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH printk 3/5] printk: use buffer pool for sprint buffers

On (20/09/24 10:54), Petr Mladek wrote:
> > Just a question:
> > 
> > Can dynamic_textbuf be a PER_CPU array of five textbuf[1024] buffers
> > (for normal printk, nmi, hard irq, soft irq and one extra buffer for
> > recursive printk calls)?
> 
> That would be my preferred fallback when the approach with
> vsprintf(NULL, ) is not acceptable for some reasons.

OK.

> But I still think that calling vsprintf(NULL, ) is the most trivial
> and good enough solution.

It's probably good enough.

> IMHO, the solution with per-CPU buffers is not that trivial, for
> example:
> 
>   What if recursive printk() is interrupted by NMI and it causes
>   yet another recursion?
> 
>   Is one level of recursion enough?

We might try the current approach - when we, for example, have
recursion in printk_safe() we just end up writing data to the
same per-CPU buffer. We need to limit the depth of recursion
one way or another. With per-CPU counter we will just bail out
of "deeply recursive printk" without attempting to store its
messages; with the buffers approach we will write the data to
a static buffer and see how badly it will be overlapped at the
end. Just a thought.

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ