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: <20170706232749.GB10672@ZenIV.linux.org.uk>
Date:   Fri, 7 Jul 2017 00:27:49 +0100
From:   Al Viro <viro@...IV.linux.org.uk>
To:     Christoph Hellwig <hch@....de>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [git pull] vfs.git part 3

On Thu, Jul 06, 2017 at 11:44:49PM +0200, Christoph Hellwig wrote:
> > Which sparse version are you using and what's your .config?
> 
> sparse is v0.5.0-62-gce18a90, .config is attached.

Arrgh...  OK, I see what's going on.  sparse commit affecting that
is "Allow casting to a restricted type if !restricted_value"; it
allows the things like (__le32)0.  It's present in sparse.git,
but not in chrisl/sparse.git, which is what you are using.

Anyway, the thing I'd missed kernel-side is this:
#define __TYPE_IS_L(t)  (__same_type((t)0, 0L))
#define __TYPE_IS_UL(t) (__same_type((t)0, 0UL))
#define __TYPE_IS_LL(t) (__same_type((t)0, 0LL) || __same_type((t)0, 0ULL))

Let's turn them into
#define __TYPE_AS(t, v) __same_type((__force t)0, v) 
#define __TYPE_IS_L(t)  (__TYPE_AS(t, 0L))
#define __TYPE_IS_UL(t) (__TYPE_AS(t, 0UL))
#define __TYPE_IS_LL(t) (__TYPE_AS(t, 0LL) || __TYPE_AS(t, 0ULL))

That should do it both for old and for new versions of sparse.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ