From: Greg KH <greg@kroah.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: stable@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [patch NOT added to 3.12 stable tree] Don't feed anything but regular iovec's to blk_rq_map_user_iov
Date: Tue, 13 Dec 2016 07:24:28 -0800 [thread overview]
Message-ID: <20161213152428.GA14683@kroah.com> (raw)
In-Reply-To: <7645f60e-6b45-828d-7964-033c9b4296df@suse.cz>
On Tue, Dec 13, 2016 at 03:40:53PM +0100, Jiri Slaby wrote:
> On 12/12/2016, 11:49 PM, Greg KH wrote:
> > On Mon, Dec 12, 2016 at 04:07:27PM +0100, Jiri Slaby wrote:
> >> From: Linus Torvalds <torvalds@linux-foundation.org>
> >>
> >> This patch does NOT apply to the 3.12 stable tree. If you still want
> >> it applied, please provide a backport.
> >>
> >> ===============
> >>
> >> commit a0ac402cfcdc904f9772e1762b3fda112dcc56a0 upstream.
> >>
> >> In theory we could map other things, but there's a reason that function
> >> is called "user_iov". Using anything else (like splice can do) just
> >> confuses it.
> >>
> >> Reported-and-tested-by: Johannes Thumshirn <jthumshirn@suse.de>
> >> Cc: Al Viro <viro@ZenIV.linux.org.uk>
> >> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> >> ---
> >> block/blk-map.c | 4 ++++
> >> 1 file changed, 4 insertions(+)
> >>
> >> diff --git a/block/blk-map.c b/block/blk-map.c
> >> index b8657fa8dc9a..27fd8d92892d 100644
> >> --- a/block/blk-map.c
> >> +++ b/block/blk-map.c
> >> @@ -118,6 +118,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
> >> struct iov_iter i;
> >> int ret;
> >>
> >> + if (!iter_is_iovec(iter))
> >> + goto fail;
> >> +
> >> if (map_data)
> >> copy = true;
> >> else if (iov_iter_alignment(iter) & align)
> >> @@ -140,6 +143,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
> >>
> >> unmap_rq:
> >> __blk_rq_unmap_user(bio);
> >> +fail:
> >> rq->bio = NULL;
> >> return -EINVAL;
> >> }
> >
> > I had to re-write this, feel free to steal the version I wrote for
> > 4.4.y, it's commit d41fb2fbb28d3a1085960edada6c046becd1fafd in the
> > linux-stable tree.
>
> I tried, but unfortunately, 3.12 has no iter_is_iovec :(.
And you can't "open code" it for 3.12 by just checking the bitfields? I
haven't looked at 3.12 in a long time and I know the iovec code has
changed a lot, sorry if this is a stupid question.
thanks,
greg k-h
next prev parent reply other threads:[~2016-12-13 15:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-12 15:07 [patch NOT added to 3.12 stable tree] Don't feed anything but regular iovec's to blk_rq_map_user_iov Jiri Slaby
2016-12-12 22:49 ` Greg KH
2016-12-13 14:40 ` Jiri Slaby
2016-12-13 15:24 ` Greg KH [this message]
2016-12-13 15:32 ` Jiri Slaby
2016-12-13 16:46 ` Linus Torvalds
2016-12-13 17:05 ` Al Viro
2016-12-13 17:09 ` Linus Torvalds
2016-12-13 17:12 ` Jiri Slaby
2016-12-13 17:42 ` Linus Torvalds
2016-12-15 1:54 ` 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=20161213152428.GA14683@kroah.com \
--to=greg@kroah.com \
--cc=jslaby@suse.cz \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.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 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.