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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 5 May 2016 22:10:04 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Vaishali Thakkar <vaishali.thakkar@...cle.com>
cc:	Gilles Muller <Gilles.Muller@...6.fr>, nicolas.palix@...g.fr,
	mmarek@...e.com, cocci@...teme.lip6.fr,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Coccinelle: noderef: Add a rule and correct the old
 rule



On Wed, 27 Apr 2016, Vaishali Thakkar wrote:

> Add a new rule to detect the cases where sizeof is used as a
> subexpression rather than a top level argument.
> 
> Also, for the patch mode third rule should behave same as
> second rule with arguments reversed. So, change that as well.
> 
> Signed-off-by: Vaishali Thakkar <vaishali.thakkar@...cle.com>
> ---
>  scripts/coccinelle/misc/noderef.cocci | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/coccinelle/misc/noderef.cocci b/scripts/coccinelle/misc/noderef.cocci
> index 80a831c..9991ee9 100644
> --- a/scripts/coccinelle/misc/noderef.cocci
> +++ b/scripts/coccinelle/misc/noderef.cocci
> @@ -16,6 +16,7 @@ virtual patch
>  @depends on patch@
>  expression *x;
>  expression f;
> +identifier i;

I think that i could be an expression in both cases?

julia

>  type T;
>  @@
>  
> @@ -30,7 +31,12 @@ f(...,(T)(x),...,sizeof(
>  + *x
>     ),...)
>  |
> -f(...,sizeof(x),...,(T)(
> +f(...,sizeof(
> +- x
> ++ *x
> +   ),...,(T)(x),...)
> +|
> +x = f(...,i*sizeof(
>  - x
>  + *x
>     ),...)
> @@ -39,6 +45,7 @@ f(...,sizeof(x),...,(T)(
>  @r depends on !patch@
>  expression *x;
>  expression f;
> +identifier i;
>  position p;
>  type T;
>  @@
> @@ -49,6 +56,8 @@ type T;
>  *f(...,(T)(x),...,sizeof@p(x),...)
>  |
>  *f(...,sizeof@p(x),...,(T)(x),...)
> +|
> +*x = f(...,i*sizeof@p(x),...)
>  )
>  
>  @script:python depends on org@
> -- 
> 2.1.4
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ