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>] [day] [month] [year] [list]
Message-ID: <20220419121013.1290398-1-william.xuanziyang@huawei.com>
Date:   Tue, 19 Apr 2022 20:10:13 +0800
From:   Ziyang Xuan <william.xuanziyang@...wei.com>
To:     <Julia.Lawall@...ia.fr>, <nicolas.palix@...g.fr>,
        <daniel.thompson@...aro.org>, <cocci@...ia.fr>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] cocinelle: iterators: optimize device_node_continue rule

Execute the device_node_continue.cocci for kernel source. Get an error
report as following:
./drivers/pci/hotplug/pnv_php.c:161:2-13: ERROR: probable double put.

After analysis, we can find that it is false positive, because it is to
detach the node from device tree. And we can abstract out an exception.

Signed-off-by: Ziyang Xuan <william.xuanziyang@...wei.com>
---
 scripts/coccinelle/iterators/device_node_continue.cocci | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/coccinelle/iterators/device_node_continue.cocci b/scripts/coccinelle/iterators/device_node_continue.cocci
index f8cd14dfa604..4b8ee3316a8c 100644
--- a/scripts/coccinelle/iterators/device_node_continue.cocci
+++ b/scripts/coccinelle/iterators/device_node_continue.cocci
@@ -49,9 +49,11 @@ for_each_node_with_property(n,e1) S
 &
 i@p1(...) {
    ... when != of_node_get(n)
+       when != of_detach_node(n)
        when any
    of_node_put@p2(n);
-   ... when any
+   ... when != of_detach_node(n)
+       when any
 }
 )
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ