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:   Fri, 19 Aug 2016 17:44:45 +0530
From:   Amitoj Kaur Chawla <amitoj1606@...il.com>
To:     SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Coccinelle <cocci@...teme.lip6.fr>,
        Gilles Muller <Gilles.Muller@...6.fr>,
        Julia Lawall <julia.lawall@...6.fr>,
        Michal Marek <mmarek@...e.com>,
        Nicolas Palix <nicolas.palix@...g.fr>
Subject: Re: [Cocci] [PATCH v3] Coccinelle: Script to replace allocate and
 memset with zalloc functions

On Mon, Aug 1, 2016 at 4:53 PM, SF Markus Elfring
<elfring@...rs.sourceforge.net> wrote:
>> +@vz1 depends on patch && !context && !org && !report@
>> +type T;
>> +T *d;
>> +statement S;
>> +@@
>> +
>> +        d =
>> +-            vmalloc
>> ++            vzalloc
>> +             (...);
>> +        if (!d) S
>> +-       memset(d, 0, sizeof(T));
>> +
>> +@vz2 depends on patch && !context && !org && !report@
>> +expression d;
>> +statement S;
>> +@@
>> +
>> +        d =
>> +-            vmalloc
>> ++            vzalloc
>> +             (...);
>> +        if (!d) S
>> +-       memset(d, 0, sizeof(*d));
>
> I suggest to take another look at a few implementation details.
>
> 1. Would it make sense to merge such SmPL rules into one
>    so that code duplication could be reduced a bit
>    in such a script?
>
> 2. How do you think about to extend the shown check list
>    with the function "kvm_kvzalloc"?
>

Hi Markus,

kvm_kvzalloc function doesn't fit the same pattern as the other
functions in this semantic patch, and is kvm specific, so the
semantic patch looks fine as is.

Thanks,
Amitoj

> 3. Do you want to maintain a growing (?) function name list manually?
>
> Regards,
> Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ