From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Alexander Potapenko <glider@google.com>,
Kostya Serebryany <kcc@google.com>,
Eric Dumazet <edumazet@google.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [iov_iter] use memmove() when copying to/from user page
Date: Tue, 16 May 2017 21:52:12 +0100 [thread overview]
Message-ID: <20170516205212.GS390@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CACT4Y+YohoPMdhmk3x-r+6ZRp=S1_Wi50hXGhQPU26TPAU=iug@mail.gmail.com>
On Tue, May 16, 2017 at 01:10:56PM -0700, Dmitry Vyukov wrote:
> > * behaviour of sendfile() in such a case. And there I've no problem
> > with saying "contents after operation is undefined". If you wish to change
> > that, by all means start with documenting the semantics you want to promise
> > to userland.
>
> I would say it's already documented.
> sendfile says that it "copies data". memmove says that it "copies
> data". memcpy says that it "copies data, but data must not overlap".
> sendfile does not say that "data must not overlap".
In that case your patch does not suffice. Overlapping move _forwards_ still
yields unexpected results, doesn't it? I'm all for documenting that
resulting contents is undefined in case of overlap. The same goes for write()
from mmap'ed area, BTW. You suggest changing that undefined behaviour *and*
either pretending that it's not undefined anymore (obviously false) or
failing to describe the new cases when it is not undefined anymore.
It's not the cost of extra branch; it's ill-defined rules that would need to
be followed to be able to rely upon the "improvement".
next prev parent reply other threads:[~2017-05-16 20:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-16 12:27 [PATCH] [iov_iter] use memmove() when copying to/from user page Alexander Potapenko
2017-05-16 18:48 ` Al Viro
2017-05-16 18:53 ` Dmitry Vyukov
2017-05-16 19:37 ` Al Viro
2017-05-16 20:10 ` Dmitry Vyukov
2017-05-16 20:52 ` Al Viro [this message]
2017-05-16 21:01 ` Dmitry Vyukov
2017-05-16 21:33 ` Al Viro
2017-05-16 22:15 ` Dmitry Vyukov
2017-05-16 22:48 ` Al Viro
2017-05-25 17:04 ` Pavel Machek
2017-05-25 17:15 ` Eric Dumazet
2017-05-25 21:27 ` Pavel Machek
2017-05-25 18:22 ` Al Viro
2017-05-25 19:15 ` Al Viro
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=20170516205212.GS390@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=dvyukov@google.com \
--cc=edumazet@google.com \
--cc=glider@google.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.