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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 May 2019 11:31:42 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Markus Elfring <Markus.Elfring@....de>
cc:     Gilles Muller <Gilles.Muller@...6.fr>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        Nicolas Palix <nicolas.palix@...g.fr>,
        Wen Yang <wen.yang99@....com.cn>, cocci@...teme.lip6.fr,
        linux-kernel@...r.kernel.org, Yi Wang <wang.yi59@....com.cn>
Subject: Re: [PATCH 4/5] Coccinelle: put_device: Extend when constraints for
 two SmPL ellipses



On Mon, 13 May 2019, Markus Elfring wrote:

> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Mon, 13 May 2019 09:47:17 +0200
>
> A SmPL ellipsis was specified for a search approach so that additional
> source code would be tolerated between an assignment to a local variable
> and the corresponding null pointer check.
>
> But such code should be restricted.
> * The local variable must not be reassigned there.
> * It must also not be forwarded to an other assignment target.
>
> Take additional casts for these code exclusion specifications into account
> together with optional parentheses.

NACK.  You don't need so many type metavariables.  Type metavariables in
the same ... can be the same.

julia

>
> Link: https://lore.kernel.org/cocci/201902191014156680299@zte.com.cn/
> Link: https://systeme.lip6.fr/pipermail/cocci/2019-February/005620.html
> Fixes: da9cfb87a44da61f2403c4312916befcb6b6d7e8 ("coccinelle: semantic code search for missing put_device()")
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>  scripts/coccinelle/free/put_device.cocci | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci
> index aae79c02c1e0..28b0be53fb3f 100644
> --- a/scripts/coccinelle/free/put_device.cocci
> +++ b/scripts/coccinelle/free/put_device.cocci
> @@ -13,13 +13,15 @@ virtual org
>  local idexpression id;
>  expression x,e,e1;
>  position p1,p2;
> -type T,T1,T2,T3;
> +type T,T1,T2,T3,T4,T5,T6;
>  @@
>
>  id = of_find_device_by_node@p1(x)
> -... when != e = id
> + ... when != e = (T4)(id)
> +     when != id = (T5)(e)
>  if (id == NULL || ...) { ... return ...; }
>  ... when != put_device(&id->dev)
> +    when != id = (T6)(e)
>      when != platform_device_put(id)
>      when != of_dev_put(id)
>      when != if (id) { ... put_device(&id->dev) ... }
> --
> 2.21.0
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ