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:   Thu, 17 Nov 2016 17:39:11 +0800
From:   Christopher Li <sparse@...isli.org>
To:     Johannes Berg <johannes@...solutions.net>
Cc:     Linux-Sparse <linux-sparse@...r.kernel.org>,
        Arnd Bergmann <arnd@...db.de>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] implement constant-folding in __builtin_bswap*()

On Thu, Aug 11, 2016 at 6:39 PM, Johannes Berg
<johannes@...solutions.net> wrote:
> Since gcc does this, it's apparently valid to write
>
>  switch (x) {
>  case __builtin_bswap16(12):
>    break;
>  }
>
> but sparse will flag it as an error today.
>
> The constant folding used to be done in the kernel's htons() and
> friends, but due to gcc bugs that isn't done anymore since
> commit 7322dd755e7d ("byteswap: try to avoid __builtin_constant_p
> gcc bug").
>
> To get rid of the sparse errors on every such instance now, just
> add constant folding to __builtin_bswap*() in sparse.

Sorry for the really late review.

This looks good. I would like to apply it. Can you please add some
test case for the function prototype you introduced, just like the way
kernel use it?

Thanks

Chris

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ