From: Al Viro <viro@zeniv.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel <linux-kernel@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>, Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH] x86/uaccess: small optimization in unsafe_copy_to_user()
Date: Sat, 17 Apr 2021 20:35:18 +0000 [thread overview]
Message-ID: <YHtGhqBXhWlUHHRm@zeniv-ca.linux.org.uk> (raw)
In-Reply-To: <YHtFciNvBWYJ0ku2@zeniv-ca.linux.org.uk>
On Sat, Apr 17, 2021 at 08:30:42PM +0000, Al Viro wrote:
> and that thing is still there. However, it does *NOT* do what it might
> appear to be doing; it ends up with getdents() returning -EINVAL instead.
> What we need is
> buf->error = -EINTR;
> in addition to that return (in all 3 such places). Do you have any problems with
> the following delta?
No, wait - we have non-NULL buf->prev_reclen, so we'll hit
if (buf.prev_reclen) {
struct compat_linux_dirent __user * lastdirent;
lastdirent = (void __user *)buf.current_dir - buf.prev_reclen;
if (put_user(buf.ctx.pos, &lastdirent->d_off))
error = -EFAULT;
else
error = count - buf.count;
}
with buf->error completely ignored. Nevermind.
next prev parent reply other threads:[~2021-04-17 20:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 19:24 [PATCH] x86/uaccess: small optimization in unsafe_copy_to_user() Eric Dumazet
2021-04-16 19:44 ` Al Viro
2021-04-16 20:11 ` Eric Dumazet
2021-04-16 20:57 ` Eric Dumazet
2021-04-17 13:59 ` David Laight
2021-04-17 16:03 ` Linus Torvalds
2021-04-17 16:08 ` Linus Torvalds
2021-04-17 16:27 ` Linus Torvalds
2021-04-17 18:09 ` Al Viro
2021-04-17 20:30 ` Al Viro
2021-04-17 20:35 ` Al Viro [this message]
2021-04-17 22:11 ` Linus Torvalds
2021-04-18 0:50 ` Al Viro
2021-04-17 19:44 ` Eric Dumazet
2021-04-17 19:51 ` Linus Torvalds
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=YHtGhqBXhWlUHHRm@zeniv-ca.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
/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).