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: Mon, 12 Dec 2016 14:49:37 -0800 [thread overview]
Message-ID: <20161212224937.GA32167@kroah.com> (raw)
In-Reply-To: <20161212150727.16486-1-jslaby@suse.cz>
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.
thanks,
greg k-h
next prev parent reply other threads:[~2016-12-12 22:49 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 [this message]
2016-12-13 14:40 ` Jiri Slaby
2016-12-13 15:24 ` Greg KH
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=20161212224937.GA32167@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 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).