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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <036f47fa1f929813cc2c7672654c7be9329b1fd9.camel@perches.com>
Date:   Mon, 28 Feb 2022 15:33:13 -0800
From:   Joe Perches <joe@...ches.com>
To:     Maninder Singh <maninder1.s@...sung.com>, apw@...onical.com,
        dwaipayanray1@...il.com, lukas.bulwahn@...il.com,
        akpm@...ux-foundation.org
Cc:     linux-kernel@...r.kernel.org, Vaneet Narang <v.narang@...sung.com>
Subject: Re: [PATCH v4] scripts/checkpatch.pl: remove _deferred and
 _deferred_once false warning

On Mon, 2022-02-28 at 13:07 +0530, Maninder Singh wrote:
> with commit 98e35f5894cf ("printk: git rid of [sched_delayed] message for
> printk_deferred") printk_deferred and printk_deferred_once requires
> LOGLEVEL in argument, but checkpatch.pl was not fixed and still reports
> it as warning:
> 
> WARNING: Possible unnecessary KERN_ALERT
> printk_deferred(KERN_ALERT "checking deferred\n");

I don't care for this patch at all.

There are many existing uses of printk_deferred both with and without a
specific KERN_<LEVEL>.

printk_deferred currently always emits at LOGLEVEL_SCHED/KERN_DEFAULT.

I think it's be better to modify vprintk_emit when LOGLEVEL_SCHED
is used and if a KERN_<LEVEL> exists in the format, use it.

Perhaps instead:
---
 kernel/printk/printk.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 1ce242f34d2be..6b5baf14f6d56 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2247,7 +2247,13 @@ asmlinkage int vprintk_emit(int facility, int level,
 		return 0;
 
 	if (level == LOGLEVEL_SCHED) {
-		level = LOGLEVEL_DEFAULT;
+		level = printk_get_level(fmt);
+		if (level) {
+			level -= '0';
+			fmt = printk_skip_level(fmt);
+		} else {
+			level = LOGLEVEL_DEFAULT;
+		}
 		in_sched = true;
 	}
 


Powered by blists - more mailing lists