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] [day] [month] [year] [list]
Message-ID: <Z5FPFhc9w0aemqL_@lei>
Date: Wed, 22 Jan 2025 20:03:34 +0000
From: sergeh@...nel.org
To: Arnd Bergmann <arnd@...nel.org>
Cc: John Johansen <john.johansen@...onical.com>,
	Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
	"Serge E. Hallyn" <serge@...lyn.com>, Arnd Bergmann <arnd@...db.de>,
	Colin Ian King <colin.i.king@...il.com>, apparmor@...ts.ubuntu.com,
	linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] apparmor: remove unused variable

On Wed, Jan 22, 2025 at 07:55:35AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> The local 'sock' variable has become unused after a change to the
> aa_sock_file_perm() calling conventions:
> 
> security/apparmor/file.c: In function '__file_sock_perm':
> security/apparmor/file.c:544:24: error: unused variable 'sock' [-Werror=unused-variable]
>   544 |         struct socket *sock = (struct socket *) file->private_data;
> 
> Remove it here.

That's interesting.  The aa_sock_file_perm() further in will
still trip the AA_BUG(!sock) if there's some shenanigans going
on so no big loss in dropping the AA_BUG.

> Fixes: c05e705812d1 ("apparmor: add fine grained af_unix mediation")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

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

> ---
>  security/apparmor/file.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/security/apparmor/file.c b/security/apparmor/file.c
> index 85f89814af1e..e3a858649942 100644
> --- a/security/apparmor/file.c
> +++ b/security/apparmor/file.c
> @@ -541,11 +541,8 @@ static int __file_sock_perm(const char *op, const struct cred *subj_cred,
>  			    struct aa_label *flabel, struct file *file,
>  			    u32 request, u32 denied)
>  {
> -	struct socket *sock = (struct socket *) file->private_data;
>  	int error;
>  
> -	AA_BUG(!sock);
> -
>  	/* revalidation due to label out of date. No revocation at this time */
>  	if (!denied && aa_label_is_subset(flabel, label))
>  		return 0;
> -- 
> 2.39.5
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ