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]
Date:   Mon, 23 Aug 2021 12:31:38 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     CGEL <cgel.zte@...il.com>
Cc:     "Gustavo A . R . Silva" <gustavoars@...nel.org>,
        Sergei Trofimovich <slyfox@...too.org>,
        linux-ia64@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jing Yangyang <jing.yangyang@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux-next] arch/ia64/kernel/module.c: fix bugon.cocci
 warnings

On Sun, 22 Aug 2021 18:51:10 -0700 CGEL <cgel.zte@...il.com> wrote:

> From: Jing Yangyang <jing.yangyang@....com.cn>
> 
> Use BUG_ON instead of a if condition followed by BUG.
> 
> Generated by: scripts/coccinelle/misc/bugon.cocci
> 
> ...
>
> --- a/arch/ia64/kernel/module.c
> +++ b/arch/ia64/kernel/module.c
> @@ -560,8 +560,7 @@ struct plt_entry {
>  	while (plt->bundle[0][0]) {
>  		if (plt_target(plt) == target_ip)
>  			goto found;
> -		if (++plt >= plt_end)
> -			BUG();
> +		BUG_ON(++plt >= plt_end);

There are concerns that there might be a config combination in which
BUG_ON() expands to a no-op.  It this situation, `plt' won't get
incremented and we have a bug.

Now, we have taken care to prevent this from happening, via the
implementations of BUG_ON().  But still, mistakes happen and out of an
abundance of caution people avoid statements of the form

	assert(expression-with-side-effects)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ