From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:45662 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbcLIHld (ORCPT ); Fri, 9 Dec 2016 02:41:33 -0500 Subject: Patch "Don't feed anything but regular iovec's to blk_rq_map_user_iov" has been added to the 4.8-stable tree To: torvalds@linux-foundation.org, gregkh@linuxfoundation.org, jthumshirn@suse.de, viro@ZenIV.linux.org.uk Cc: , From: Date: Fri, 09 Dec 2016 08:41:40 +0100 Message-ID: <14812693001369@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled Don't feed anything but regular iovec's to blk_rq_map_user_iov to the 4.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: don-t-feed-anything-but-regular-iovec-s-to-blk_rq_map_user_iov.patch and it can be found in the queue-4.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>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; } Patches currently in stable-queue which might be from torvalds@linux-foundation.org are queue-4.8/don-t-feed-anything-but-regular-iovec-s-to-blk_rq_map_user_iov.patch