From: Max Filippov <jcmvbkbc@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: "open list:TENSILICA XTENSA PORT (xtensa)"
<linux-xtensa@linux-xtensa.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xtensa: fix {get,put}_user() for 64bit values
Date: Thu, 10 Oct 2019 20:35:39 -0700 [thread overview]
Message-ID: <CAMo8BfL3j4odehiR8KzHwjohfoBADOhjSjeXFG7AwgBXoXQRTw@mail.gmail.com> (raw)
In-Reply-To: <20191010142956.GG26530@ZenIV.linux.org.uk>
On Thu, Oct 10, 2019 at 7:29 AM Al Viro <viro@zeniv.linux.org.uk> wrote:
> Hmm... Looking at __get_user_size(), we have retval = 0; very early
> in it. So I wonder if it should simply be
> #define __get_user_size(x, ptr, size, retval) \
> do { \
> int __cb; \
> retval = 0; \
> switch (size) { \
> case 1: __get_user_asm(x, ptr, retval, 1, "l8ui", __cb); break;\
> case 2: __get_user_asm(x, ptr, retval, 2, "l16ui", __cb); break;\
> case 4: __get_user_asm(x, ptr, retval, 4, "l32i", __cb); break;\
> case 8: if (unlikely(__copy_from_user(&x, ptr, 8)) { \
> retval = -EFAULT; \
> x = 0; \
> } \
> break; \
> default: (x) = __get_user_bad(); \
> } \
> } while (0)
> so that 64bit case is closer to the others in that respect (i.e. zeroing
> done on failure and out of line). No?
Ok, I agree.
The intermediate __gu_val in __get_user_[no]check doesn't work well
with some data types used in the kernel, unfortunately. I'll post a series
with what's close to your initial patch on top of rearranged
__get_user_[no]check.
--
Thanks.
-- Max
prev parent reply other threads:[~2019-10-11 3:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 19:21 [PATCH] xtensa: fix {get,put}_user() for 64bit values Al Viro
2019-10-10 1:38 ` Max Filippov
2019-10-10 1:56 ` Al Viro
2019-10-10 2:11 ` Max Filippov
2019-10-10 14:29 ` Al Viro
2019-10-11 3:35 ` Max Filippov [this message]
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=CAMo8BfL3j4odehiR8KzHwjohfoBADOhjSjeXFG7AwgBXoXQRTw@mail.gmail.com \
--to=jcmvbkbc@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).