[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa7613e9-8152-0022-6d67-0706ce5983d0@linux.com>
Date: Thu, 18 Jun 2020 00:42:33 +0300
From: Denis Efremov <efremov@...ux.com>
To: Julia Lawall <julia.lawall@...ia.fr>
Cc: cocci@...teme.lip6.fr, linux-kernel@...r.kernel.org
Subject: Re: [Cocci] [PATCH v3] coccinelle: api: add kzfree script
>> +@...memset depends on patch@
>> +expression E, size;
>> +position p : script:python() { relevant(p) };
>> +type T;
>> +@@
>> +
>> +- memset((T)E, size)@p;
>
> This is missing a 0 argument.
>
Thanks, I will send v4.
>
>
>> + ... when != E
>> + when strict
>> +(
>> +- kfree(E);
>> ++ kzfree(E);
>> +|
>> +- \(vfree\|kvfree\)(E);
>> ++ kvfree_sensitive(E, size);
>> +)
>
> I'm not sure why you want kzfree in the first case, but kvfree_sensitive
> in the second case.
>
As for now in kernel:
memset(E,0,...) && kfree(E) is kzfree()
There are no vzfree or kvzfree functions.
Thus, we use kvfree_sensitive().
Maybe it's worth to wait for this patchset:
https://lkml.org/lkml/2020/6/16/1163
With it the rule will use:
(
- kfree(E);
+ kfree_sensitive(E);
|
- \(vfree\|kvfree\)(E);
+ kvfree_sensitive(E, size);
)
Thanks,
Denis
Powered by blists - more mailing lists