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: <dff63c58-6f13-420d-9a67-1d6d3a273458@roeck-us.net>
Date: Fri, 24 Jan 2025 13:02:00 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: sergeh@...nel.org
Cc: Arnd Bergmann <arnd@...nel.org>,
	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 08:03:34PM +0000, sergeh@...nel.org wrote:
> 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.
> 

AA_BUG(X, args) extends to
	AA_BUG_FMT((X), "" args);
which is
	#define AA_BUG_FMT(X, fmt, args...) no_printk(fmt, ##args)

if CONFIG_SECURITY_APPARMOR_DEBUG_ASSERTS=n. That means the first
parameter is dropped and sock is indeed unused in that case.

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ