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:   Wed, 17 Mar 2021 08:54:42 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Cc:     Jeremy Kerr <jk@...abs.org>, Michael Ellerman <mpe@...erman.id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] sched: replace if (cond) BUG() with WARN_ON()

On Wed, Mar 17, 2021 at 8:35 AM Jiapeng Chong
<jiapeng.chong@...ux.alibaba.com> wrote:
>
> Fix the following coccicheck warnings:
>
> ./arch/powerpc/platforms/cell/spufs/sched.c:908:2-5: WARNING: Use BUG_ON
> instead of if condition followed by BUG.
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>

If you change it from BUG() to WARN_ON(), you should explain why it's safe to
do that in this case. Here it is not, since the following spu_release() will
end up making things worse if the acquire failed. Also if there was a signal
pending, then spusched_tick() will just get called again and constantly
print these warnings.

There is probably a way to use WARN_ON_ONCE() here, in combination
with a way to terminate the thread safely, but this has to be done carefully.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ