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]
Date:   Fri, 16 Sep 2022 18:58:52 -0700
From:   Li Zhong <floridsleeves@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     tony.luck@...el.com, ccross@...roid.com, anton@...msg.org,
        keescook@...omium.org, john.ogness@...utronix.de,
        rostedt@...dmis.org, senozhatsky@...omium.org, pmladek@...e.com,
        Li Zhong <floridsleeves@...il.com>
Subject: [PATCH v1] kernel/printk: check return value of console_trylock()

Check the console_trylock() return value in case it fails.

Signed-off-by: Li Zhong <floridsleeves@...il.com>
---
 kernel/printk/printk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index a1a81fd9889b..2c6a0484315b 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2937,7 +2937,8 @@ void console_flush_on_panic(enum con_flush_mode mode)
 	 * context and we don't want to get preempted while flushing,
 	 * ensure may_schedule is cleared.
 	 */
-	console_trylock();
+	if (!console_trylock())
+		return;
 	console_may_schedule = 0;
 
 	if (mode == CONSOLE_REPLAY_ALL) {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ