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: <daba6b06-66cb-6564-b7b0-26cb994a07cd@redhat.com>
Date:   Mon, 18 Oct 2021 20:03:24 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Jim Mattson <jmattson@...gle.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        KVM list <kvm@...r.kernel.org>
Subject: Re: [GIT PULL] KVM fixes for Linux 5.15-rc7

On 18/10/21 19:57, Linus Torvalds wrote:
> The way to do a logical "or" (instead of a bitwise one on two boolean
> expressions) is to use "||".
> 
> Instead, the code was changed to completely insane
> 
>     (int) boolexpr1 | (int) boolexpr2
> 
> thing, which is entirely illegible and pointless, and no sane person
> should ever write code like that.
> 
> In other words, the*proper*  fix to a warning is to look at the code,
> and*unsderstand*  the code and the warning, instead of some mindless
> conversion to just avoid a warning.

The code is not wrong, there is a comment explaining it:

  	 * Use a bitwise-OR instead of a logical-OR to aggregate the reserved
  	 * bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc
  	 * (this is extremely unlikely to be short-circuited as true).

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ