From: Greg Kroah-Hartman Date: Fri, 9 Dec 2016 07:41:40 +0000 (+0100) Subject: 4.8-stable patches X-Git-Tag: v4.4.38~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0480851d8a917f20cdecc814f3642359875f8d5;p=thirdparty%2Fkernel%2Fstable-queue.git 4.8-stable patches added patches: don-t-feed-anything-but-regular-iovec-s-to-blk_rq_map_user_iov.patch --- diff --git a/queue-4.8/don-t-feed-anything-but-regular-iovec-s-to-blk_rq_map_user_iov.patch b/queue-4.8/don-t-feed-anything-but-regular-iovec-s-to-blk_rq_map_user_iov.patch new file mode 100644 index 00000000000..65ffd95f502 --- /dev/null +++ b/queue-4.8/don-t-feed-anything-but-regular-iovec-s-to-blk_rq_map_user_iov.patch @@ -0,0 +1,42 @@ +From a0ac402cfcdc904f9772e1762b3fda112dcc56a0 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Tue, 6 Dec 2016 16:18:14 -0800 +Subject: Don't feed anything but regular iovec's to blk_rq_map_user_iov + +From: Linus Torvalds + +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 +Cc: Al Viro +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + block/blk-map.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/block/blk-map.c ++++ b/block/blk-map.c +@@ -118,6 +118,9 @@ int blk_rq_map_user_iov(struct request_q + 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_q + + unmap_rq: + __blk_rq_unmap_user(bio); ++fail: + rq->bio = NULL; + return -EINVAL; + } diff --git a/queue-4.8/series b/queue-4.8/series index 4e4e37a9be2..58ad3d5f5b8 100644 --- a/queue-4.8/series +++ b/queue-4.8/series @@ -35,3 +35,4 @@ ipv4-drop-suffix-update-from-resize-code.patch sparc64-fix-find_node-warning-if-numa-node-cannot-be-found.patch sparc64-fix-compile-warning-section-mismatch-in-find_node.patch sparc32-fix-inverted-invalid_frame_pointer-checks-on-sigreturns.patch +don-t-feed-anything-but-regular-iovec-s-to-blk_rq_map_user_iov.patch