[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190329194208.GE2217@ZenIV.linux.org.uk>
Date: Fri, 29 Mar 2019 19:42:08 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Jann Horn <jannh@...gle.com>
Cc: Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
linux-sparse@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
the arch/x86 maintainers <x86@...nel.org>,
kernel list <linux-kernel@...r.kernel.org>,
Qiaowei Ren <qiaowei.ren@...el.com>
Subject: Re: [PATCH v2 3/4] x86/fpu: Fix __user annotations
On Fri, Mar 29, 2019 at 08:25:25PM +0100, Jann Horn wrote:
> Oooh, it's a sparse bug.
It's *not* a bug.
> Apparently it's significant that the user pointer is stored as a
> __u64, and __u64 is defined as unsigned long long.
Yes, it is. Casts to uintptr_t (== unsigned long on all targets)
are OK; any other arithmetical type gives a warning, and quite
deliberately so.
Don't do it. If you want to say "I'm converting it to integer,
all traces of its origin are gone", use an idiomatic cast.
Powered by blists - more mailing lists