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: <CAKCV-6sRcOOcLOqc62PyUKqbmmqTOje8vf0kDhLdNKaa4r57_Q@mail.gmail.com>
Date: Mon, 27 Jan 2025 12:59:21 -0800
From: Ryan Lee <ryan.lee@...onical.com>
To: Mateusz Guzik <mjguzik@...il.com>
Cc: john.johansen@...onical.com, paul@...l-moore.com, 
	linux-kernel@...r.kernel.org, apparmor@...ts.ubuntu.com, 
	linux-security-module@...r.kernel.org
Subject: Re: [PATCH] apparmor: use the condition in AA_BUG_FMT even with debug disabled

For the record, a previous patch that removes the sock variable was
previously accepted:
https://lists.ubuntu.com/archives/apparmor/2025-January/013449.html
(patch) and https://lists.ubuntu.com/archives/apparmor/2025-January/013463.html
(ack from John Johansen)

On Mon, Jan 27, 2025 at 12:54 PM Mateusz Guzik <mjguzik@...il.com> wrote:
>
> This follows the established practice and fixes a build failure for me:
> 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;
>       |                        ^~~~
>
> Signed-off-by: Mateusz Guzik <mjguzik@...il.com>
> ---
>
> Plausibly the sock var wants to be eliminated altogether, but I just
> want this to build.
>
>  security/apparmor/include/lib.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/security/apparmor/include/lib.h b/security/apparmor/include/lib.h
> index 256f4577c653..d947998262b2 100644
> --- a/security/apparmor/include/lib.h
> +++ b/security/apparmor/include/lib.h
> @@ -60,7 +60,11 @@ do {                                                                 \
>  #define AA_BUG_FMT(X, fmt, args...)                                    \
>         WARN((X), "AppArmor WARN %s: (" #X "): " fmt, __func__, ##args)
>  #else
> -#define AA_BUG_FMT(X, fmt, args...) no_printk(fmt, ##args)
> +#define AA_BUG_FMT(X, fmt, args...)                                    \
> +       do {                                                            \
> +               BUILD_BUG_ON_INVALID(X);                                \
> +               no_printk(fmt, ##args);                                 \
> +       } while (0)
>  #endif
>
>  int aa_parse_debug_params(const char *str);
> --
> 2.43.0
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ