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] [day] [month] [year] [list]
Date:   Fri, 10 Sep 2021 18:15:32 +0530
From:   Maninder Singh <maninder1.s@...sung.com>
To:     Andy Whitcroft <apw@...onical.com>
CC:     "joe@...ches.com" <joe@...ches.com>,
        "dwaipayanray1@...il.com" <dwaipayanray1@...il.com>,
        "lukas.bulwahn@...il.com" <lukas.bulwahn@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        AMIT SAHRAWAT <a.sahrawat@...sung.com>,
        Vaneet Narang <v.narang@...sung.com>
Subject: RE: [PATCH 1/1] scripts/checkpatch.pl: remove warning for
 pritk_deferred also

Hi,


>It looks sensible to add `_deferred`, there also looks to be an
>`_deferred_once` variant which should also be added.  See the first
>stanza of `$logFunctions`.  We might also consider splitting up
>`$logFunctions` so that we can consume the reset without that first
>stanza?  Something like this (completly untested):
>
>    our $logFunctionsCore = qr{(?x:
>        (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
>        TP_printk|
>        WARN(?:_RATELIMIT|_ONCE|)|
>        panic|
>        MODULE_[A-Z_]+|
>        seq_vprintf|seq_printf|seq_puts
>    )};
>    our $logFunctions = qr{(?x:
>        printk(?:_ratelimited|_once|_deferred_once|_deferred|)|
>	$logFunctionsCore
>    )};
>


sent V2 patch with testing basic checks:

https://lkml.org/lkml/2021/9/7/329

$ cat test.c


printk_deferred(KERN_ALERT "checking deferred\n");
printk_deferred_once(KERN_ALERT "checking deferred\n");
printk(KERN_ERR"error");
pr_emerg("Protocol: %#06hx\n", ntohs(eth->h_proto));
printk_deferred(KERN_ALERT "Protocol: %#06hx\n", ntohs(eth->h_proto));



WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
#22: FILE: test.c:22:
+printk(KERN_ERR"error");

WARNING: Integer promotion: Using 'h' in '%#06hx' is unnecessary
#23: FILE: test.c:23:
+pr_emerg("Protocol: %#06hx\n", ntohs(eth->h_proto));

WARNING: Integer promotion: Using 'h' in '%#06hx' is unnecessary
#24: FILE: test.c:24:
+printk_deferred(KERN_ALERT "Protocol: %#06hx\n", ntohs(eth->h_proto));


Thanks,
Maninder Singh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ