stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch NOT added to 3.12 stable tree] Don't feed anything but regular iovec's to blk_rq_map_user_iov
@ 2016-12-12 15:07 Jiri Slaby
  2016-12-12 22:49 ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Jiri Slaby @ 2016-12-12 15:07 UTC (permalink / raw)
  To: stable; +Cc: jslaby, Linus Torvalds, Al Viro

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;
 }
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-12-15  1:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).