Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934276AbcLIQSz (ORCPT ); Fri, 9 Dec 2016 11:18:55 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:55442 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934261AbcLIQSw (ORCPT ); Fri, 9 Dec 2016 11:18:52 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Al Viro , Linus Torvalds Subject: [PATCH 4.4 23/28] Dont feed anything but regular iovecs to blk_rq_map_user_iov Date: Fri, 9 Dec 2016 17:18:05 +0100 Message-Id: <20161209161748.907455314@linuxfoundation.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161209161747.923205441@linuxfoundation.org> References: <20161209161747.923205441@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 951 Lines: 34 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ 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 | 3 +++ 1 file changed, 3 insertions(+) --- a/block/blk-map.c +++ b/block/blk-map.c @@ -90,6 +90,9 @@ int blk_rq_map_user_iov(struct request_q if (!iter || !iter->count) return -EINVAL; + if (!iter_is_iovec(iter)) + return -EINVAL; + iov_for_each(iov, i, *iter) { unsigned long uaddr = (unsigned long) iov.iov_base;