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: <84wmfxm6em.fsf@jogness.linutronix.de>
Date: Wed, 18 Dec 2024 15:13:13 +0106
From: John Ogness <john.ogness@...utronix.de>
To: Petr Mladek <pmladek@...e.com>, "Rob Herring (Arm)" <robh@...nel.org>,
 Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Steven Rostedt <rostedt@...dmis.org>, Andy Shevchenko
 <andriy.shevchenko@...ux.intel.com>, Rasmus Villemoes
 <linux@...musvillemoes.dk>, Sergey Senozhatsky <senozhatsky@...omium.org>,
 Jonathan Corbet <corbet@....net>, Saravana Kannan <saravanak@...gle.com>,
 Andrew Morton <akpm@...ux-foundation.org>, Peter Zijlstra
 <peterz@...radead.org>, Thomas Gleixner <tglx@...utronix.de>, Zijun Hu
 <quic_zijuhu@...cinc.com>, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: lock in vsprintf(): was: Re: [PATCH] of: Add printf '%pOFm' for
 generating modalias

On 2024-12-18, Petr Mladek <pmladek@...e.com> wrote:
> My concern is taking a lock when processing a printf format, see
> below for more details.

Your concern is valid! printk() uses vsnprintf() to format records for
the kernel log. printk() may be called from contexts where locking is
forbidden (such as NMI). If vsnprintf() can take a lock, then either:

vsnprintf() must be made to be lockless

  or

printk() must take another approach to string formatting

  or

we accept that printk() can deadlock for certain format types in certain
contexts.

John Ogness

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ