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-next>] [day] [month] [year] [list]
Message-Id: <20230419074210.17646-1-pmladek@suse.com>
Date:   Wed, 19 Apr 2023 09:42:10 +0200
From:   Petr Mladek <pmladek@...e.com>
To:     John Ogness <john.ogness@...utronix.de>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        Steven Rostedt <rostedt@...dmis.org>
Cc:     Michal Hocko <mhocko@...e.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Petr Mladek <pmladek@...e.com>
Subject: [PATCH] printk: Enough to disable preemption in printk deferred context

The comment above printk_deferred_enter()/exit() definition claims
that it can be used only when interrupts are disabled.

It was required by the original printk_safe_log_store() implementation.
The code provided lockless synchronization between a single writer and
a single reader. The interrupt and the normal context shared the same
buffer.

The commit 93d102f094be ("printk: remove safe buffers") removed
these temporary buffers. Instead, the messages are stored directly into
the new global lockless buffer which supports multiple parallel writers.

As a result, it is safe to interrupt one writer now. The preemption still
has to be disabled because the deferred context is CPU specific.

Fixes: 93d102f094be ("printk: remove safe buffers")
Signed-off-by: Petr Mladek <pmladek@...e.com>
---
 include/linux/printk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/printk.h b/include/linux/printk.h
index 8ef499ab3c1e..915a321b491e 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -161,7 +161,7 @@ extern void __printk_safe_enter(void);
 extern void __printk_safe_exit(void);
 /*
  * The printk_deferred_enter/exit macros are available only as a hack for
- * some code paths that need to defer all printk console printing. Interrupts
+ * some code paths that need to defer all printk console printing. Preemption
  * must be disabled for the deferred duration.
  */
 #define printk_deferred_enter __printk_safe_enter
-- 
2.35.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ