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]
Message-ID: <20170706134428.GA19254@mail.hallyn.com>
Date:   Thu, 6 Jul 2017 08:44:28 -0500
From:   "Serge E. Hallyn" <serge@...lyn.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     John Johansen <john.johansen@...onical.com>,
        James Morris <james.l.morris@...cle.com>,
        "Serge E . Hallyn" <serge@...lyn.com>,
        linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] apparmor: Fix shadowed local variable in
 unpack_trans_table()

Quoting Geert Uytterhoeven (geert@...ux-m68k.org):
> with W=2:
> 
>     security/apparmor/policy_unpack.c: In function ‘unpack_trans_table’:
>     security/apparmor/policy_unpack.c:469: warning: declaration of ‘pos’ shadows a previous local
>     security/apparmor/policy_unpack.c:451: warning: shadowed declaration is here
> 
> Rename the old "pos" to "saved_pos" to fix this.
> 
> Fixes: 5379a3312024a8be ("apparmor: support v7 transition format compatible with label_parse")
> Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>

Reviewed-by: Serge Hallyn <serge@...lyn.com>

> ---
>  security/apparmor/policy_unpack.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
> index c600f4dd1783252a..2d5a1a007b062a73 100644
> --- a/security/apparmor/policy_unpack.c
> +++ b/security/apparmor/policy_unpack.c
> @@ -448,7 +448,7 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e)
>   */
>  static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
>  {
> -	void *pos = e->pos;
> +	void *saved_pos = e->pos;
>  
>  	/* exec table is optional */
>  	if (unpack_nameX(e, AA_STRUCT, "xtable")) {
> @@ -511,7 +511,7 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile)
>  
>  fail:
>  	aa_free_domain_entries(&profile->file.trans);
> -	e->pos = pos;
> +	e->pos = saved_pos;
>  	return 0;
>  }
>  
> -- 
> 2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ