Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751227AbdHWWa2 (ORCPT ); Wed, 23 Aug 2017 18:30:28 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:42979 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbdHWWa1 (ORCPT ); Wed, 23 Aug 2017 18:30:27 -0400 X-IronPort-AV: E=Sophos;i="5.41,417,1498492800"; d="scan'208";a="44601673" From: Bart Van Assche To: Al Viro Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Bart Van Assche , stable@vger.kernel.org Subject: [PATCH 1/2] : Fix copy_in_user() declaration Date: Wed, 23 Aug 2017 15:29:10 -0700 Message-Id: <20170823222911.29453-2-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170823222911.29453-1-bart.vanassche@wdc.com> References: <20170823222911.29453-1-bart.vanassche@wdc.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 946 Lines: 26 copy_in_user() copies data from user-space address @from to user- space address @to. Hence declare both @from and @to as user-space pointers. Fixes: commit d597580d3737 ("generic ...copy_..._user primitives") Signed-off-by: Bart Van Assche Cc: --- include/linux/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index acdd6f915a8d..20ef8e6ec2db 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -156,7 +156,7 @@ copy_to_user(void __user *to, const void *from, unsigned long n) } #ifdef CONFIG_COMPAT static __always_inline unsigned long __must_check -copy_in_user(void __user *to, const void *from, unsigned long n) +copy_in_user(void __user *to, const void __user *from, unsigned long n) { might_fault(); if (access_ok(VERIFY_WRITE, to, n) && access_ok(VERIFY_READ, from, n)) -- 2.14.0