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]
Date: Fri, 26 Jan 2024 07:58:37 -0800
From: Doug Anderson <dianders@...omium.org>
To: Kees Cook <keescook@...omium.org>
Cc: Arnd Bergmann <arnd@...db.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lkdtm/bugs: In lkdtm_HUNG_TASK() use BUG(), not BUG_ON(1)

Hi,

On Fri, Jan 26, 2024 at 7:29 AM Douglas Anderson <dianders@...omiumorg> wrote:
>
> In commit edb6538da3df ("lkdtm/bugs: Adjust lkdtm_HUNG_TASK() to avoid
> tail call optimization") we marked lkdtm_HUNG_TASK() as
> __noreturn. The compiler gets unhappy if it thinks a __noreturn
> function might return, so there's a BUG_ON(1) at the end. Any human
> can see that the function won't return and the compiler can figure
> that out too. Except when it can't.
>
> The MIPS architecture defines HAVE_ARCH_BUG_ON and defines its own
> version of BUG_ON(). The MIPS version of BUG_ON() is not a macro but
> is instead an inline function. Apparently this prevents the compiler
> from realizing that the condition to BUG_ON() is constant and that the
> function will never return.
>
> Let's change the BUG_ON(1) to just BUG(), which it should have been to
> begin with. The only reason I used BUG_ON(1) to begin with was because
> I was used to using WARN_ON(1) when writing test code and WARN() and
> BUG() are oddly inconsistent in this manner. :-/
>
> Fixes: edb6538da3df ("lkdtm/bugs: Adjust lkdtm_HUNG_TASK() to avoid tail call optimization")
> Signed-off-by: Douglas Anderson <dianders@...omium.org>
> ---
>
>  drivers/misc/lkdtm/bugs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Ugh. I just realized I forgot these. Kees: hopefully you can add them...

Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401262204.wUFKRYZF-lkp@intel.com/

-Doug

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ