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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 17 Feb 2019 14:14:38 +0100
From:   Markus Elfring <>
To:     Julia Lawall <>,
        Wen Yang <>
Cc:     Gilles Muller <>,
        Nicolas Palix <>,
        Michal Marek <>,
        Masahiro Yamada <>,
        Wen Yang <>,
        Cheng Shengyu <>,,
        LKML <>,
        Coccinelle <>
Subject: Re: [v6] coccinelle: semantic code search for missing put_device()

>> …
>> +@...rch exists@
>> +local idexpression id;
>> +expression x,e,e1;
>> +position p1,p2;
>> …
>> +@@
>> +
>> +id = of_find_device_by_node@p1(x)
>> +... when != e = id
>> …
>> Or:
>> …
>> + ... when != id = e
>> …
>> Which SmPL specification will achieve the desired software behaviour?
> The desired behavior is to check whether the allocated value is saved in
> some other variable (typically a structure field) and thus it doesn't need
> to be freed just because the original local variable goes out of scope at
> the end of the function.

I find this description reasonable to some degree.

(I am unsure if a programmer would like to fiddle with return value storage
in a data structure member from a local variable.)

> when != e = id achieves this behavior.

I can not agree to this view completely because of the meaning that is connected
with these variable identifiers.

Both metavariables share the kind “expression”. So I can imagine
that there is an intersection for the source code match possibility.
But one was intentionally restricted to the kind “local idexpression” so far.

Which data element should not get reassigned here (before a corresponding
null pointer check)?


Powered by blists - more mailing lists