On 6/15/20 3:03 PM, Dan Carpenter wrote:
> On Sun, Jun 14, 2020 at 10:42:54PM +0300, Denis Efremov wrote:
>> On 6/4/20 7:27 PM, Joe Perches wrote:
>>> On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote:
Check for memset() with 0 followed by kfree().
>>>
>>> Perhaps those uses should be
On Sun, Jun 14, 2020 at 10:42:54PM +0300, Denis Efremov wrote:
> On 6/4/20 7:27 PM, Joe Perches wrote:
> > On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote:
> >> Check for memset() with 0 followed by kfree().
> >
> > Perhaps those uses should be memzero_explicit or kvfree_sensitive.
> >
>
On Sun, 2020-06-14 at 22:42 +0300, Denis Efremov wrote:
> On 6/4/20 7:27 PM, Joe Perches wrote:
> > On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote:
> > > Check for memset() with 0 followed by kfree().
> >
> > Perhaps those uses should be memzero_explicit or kvfree_sensitive.
> >
> Is it
On 6/4/20 7:27 PM, Joe Perches wrote:
> On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote:
>> Check for memset() with 0 followed by kfree().
>
> Perhaps those uses should be memzero_explicit or kvfree_sensitive.
>
Is it safe to suggest to use kzfree instead of memzero_explicit && kfree?
Or
On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote:
> Check for memset() with 0 followed by kfree().
Perhaps those uses should be memzero_explicit or kvfree_sensitive.
___
Cocci mailing list
Cocci@systeme.lip6.fr
On Thu, 2020-06-04 at 20:30 +0300, Denis Efremov wrote:
>
> On 6/4/20 7:27 PM, Joe Perches wrote:
> > On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote:
> > > Check for memset() with 0 followed by kfree().
> >
> > Perhaps those uses should be memzero_explicit or kvfree_sensitive.
>
>
On 6/4/20 7:27 PM, Joe Perches wrote:
> On Thu, 2020-06-04 at 17:08 +0300, Denis Efremov wrote:
>> Check for memset() with 0 followed by kfree().
>
> Perhaps those uses should be memzero_explicit or kvfree_sensitive.
Thanks, I will add memzero_explicit(). However, I can't find
> Could you send an example of some C code on which the result is not
> suitable?
I've updated the pattern to handle false positives:
@ifok@
position p;
expression *E;
@@
(
if (...) {
...
memset(E, 0, ...)@p;
...
}
|
if (...) {
...
} else {
...
memset(E, 0,
On Thu, 4 Jun 2020, Markus Elfring wrote:
> > Check for memset() with 0 followed by kfree().
>
> I suggest to simplify the SmPL code a bit like the following.
>
>
> > +virtual context
> > +virtual org
> > +virtual report
> > +virtual patch
>
> +virtual context, org, report, patch
This is
On Thu, 4 Jun 2020, Denis Efremov wrote:
>
>
> On 6/4/20 5:15 PM, Julia Lawall wrote:
> > Did you try ... here but find that some subexpressions of E could be
> > modified in between?
>
> Yes, I tried to use "... when != E = E1 when != " and results were bad.
> Now, I've tried forall and when
On 6/4/20 5:15 PM, Julia Lawall wrote:
> Did you try ... here but find that some subexpressions of E could be
> modified in between?
Yes, I tried to use "... when != E = E1 when != " and results were bad.
Now, I've tried forall and when strict. Here are examples:
// forall added
// Works
> Check for memset() with 0 followed by kfree().
I suggest to simplify the SmPL code a bit like the following.
> +virtual context
> +virtual org
> +virtual report
> +virtual patch
+virtual context, org, report, patch
…
> +@@
> +
> +(
> +* memset(E, 0, ...);
> +|
> +* memset(E, '\0', ...);
>
On Thu, 4 Jun 2020, Denis Efremov wrote:
> Check for memset() with 0 followed by kfree().
>
> Signed-off-by: Denis Efremov
> ---
> Patches:
> 1. kzfree in drivers/w1 https://lkml.org/lkml/2020/6/4/438
> 2. kzfree in drivers/iommu/ https://lkml.org/lkml/2020/6/4/421
> 3. kzfree in
Check for memset() with 0 followed by kfree().
Signed-off-by: Denis Efremov
---
Patches:
1. kzfree in drivers/w1 https://lkml.org/lkml/2020/6/4/438
2. kzfree in drivers/iommu/ https://lkml.org/lkml/2020/6/4/421
3. kzfree in drivers/scsi/ https://lkml.org/lkml/2020/6/4/442
14 matches
Mail list logo