From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Borislav Petkov <bp@alien8.de>
Cc: Jann Horn <jannh@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Qiaowei Ren <qiaowei.ren@intel.com>
Subject: Re: [PATCH 2/2] x86: fix __user annotations
Date: Fri, 29 Mar 2019 15:24:48 +0000 [thread overview]
Message-ID: <e2dcebe0a663bdf5496e444509f3e45f@codethink.co.uk> (raw)
In-Reply-To: <20190329133956.GE21152@zn.tnic>
On 2019-03-29 13:39, Borislav Petkov wrote:
> On Thu, Mar 28, 2019 at 10:23:21PM +0100, Jann Horn wrote:
>> Fix __user annotations in various places across the x86 tree:
>>
>> - cast to wrong pointer type in __user_atomic_cmpxchg_inatomic()
>> - generic_load_microcode() deals with a pointer that can be either a
>> kernel pointer or a user pointer; change the code to pass it around
>> as
>> a __user pointer, and add explicit casts to convert between __user
>> and
>> __kernel
>> - save_xstate_epilog() has missing __user in explicit casts
>> - setup_sigcontext() and x32_setup_rt_frame() rely on the cast
>> performed
>> by put_user_ex() on its first argument, but sparse requires __force
>> for
>> casting __user pointers to unsigned long
>> - xen_hvm_config() has missing __user
>>
>> This patch removes all sparse warnings about the asn:1 address space
>> (__user) in arch/x86/ for my kernel config.
>>
>> Signed-off-by: Jann Horn <jannh@google.com>
>> ---
>> This patch requires the previous one, "[PATCH 1/2] kernel.h: use
>> parentheses around argument in u64_to_user_ptr()", otherwise
>> xen_hvm_config() breaks. Can we take both together through the x86
>> tree,
>> or does the first one have to go through akpm's tree?
>
> I don't see why not, unless akpm has objections.
>
> However,
>
>> arch/x86/include/asm/uaccess.h | 3 +--
>> arch/x86/include/asm/uaccess_64.h | 2 +-
>
> This chunk is being discussed here already:
>
> https://lkml.kernel.org/r/20190228185027.2480-1-ben.dooks@codethink.co.uk
>
> and I'd like to take Ben's v2 when Ben adds Linus' explanation.
I'll sort that out in a bit, thanks for reviewing.
next prev parent reply other threads:[~2019-03-29 15:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 21:23 [PATCH 1/2] kernel.h: use parentheses around argument in u64_to_user_ptr() Jann Horn
2019-03-28 21:23 ` [PATCH 2/2] x86: fix __user annotations Jann Horn
2019-03-29 13:39 ` Borislav Petkov
2019-03-29 15:24 ` Ben Dooks [this message]
2019-03-29 16:02 ` Jann Horn
2019-04-01 14:37 ` David Laight
2019-04-01 15:04 ` Jann Horn
2019-03-29 5:59 ` [PATCH 1/2] kernel.h: use parentheses around argument in u64_to_user_ptr() Mukesh Ojha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e2dcebe0a663bdf5496e444509f3e45f@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=qiaowei.ren@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox