Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968971AbdI0AdN (ORCPT ); Tue, 26 Sep 2017 20:33:13 -0400 Received: from mail-sn1nam01on0073.outbound.protection.outlook.com ([104.47.32.73]:42240 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964956AbdI0AdL (ORCPT ); Tue, 26 Sep 2017 20:33:11 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; From: Yury Norov To: Andrew Morton , Al Viro , linux-kernel@vger.kernel.org Cc: Yury Norov Subject: [PATCH] IPC: fix put_compat_shm_info() Date: Wed, 27 Sep 2017 03:32:54 +0300 Message-Id: <20170927003254.17604-1-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [176.59.118.21] X-ClientProxiedBy: HE1PR09CA0080.eurprd09.prod.outlook.com (2603:10a6:7:3d::24) To MWHPR0701MB3833.namprd07.prod.outlook.com (2603:10b6:301:7f::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ddb1b46-f58d-474b-f5ef-08d5053f538d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:MWHPR0701MB3833; X-Microsoft-Exchange-Diagnostics: 1;MWHPR0701MB3833;3:mPwXgnQl5ul7Gwe+xsEixLl9n7AOKuGVS7URI6PxylWCeIhSOOplgiZJFCYqz6HTdyY1FdR5T+ss7p9OukQNqKwWPBrYLoOMtU7FW2Mho3YJ/xLp5xXkaZz2dXdCAw0zk4kkeUy4Pp3IwN3UHbxQxRLQQmgWplhc7ai4PsHFVTpXYWvy7fjXktin2t8R5QxRyk2a2omw99zX1TbLkylccV2I4AnoruUsA4ybnYJKdjI7EQByMgK+fqbbqDe+UdtE;25:6FByZ9okM9agu9S0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9M2YoXA9AmW9r4fJrf6kMzhiakhVKFMD+/t3vkkxGHJp//zpak3H1r0sYT27hFMqgKs1bCrNwHzDakUgP52ePbh7pRraBc3xMJW4GcV+aGzvaebhAGtrvuEo4HNIZ/oFohye18aWlaX5cWLjsrcxxzhhVfeWtLu7vrU0rLvk4gVjMkwSObG8=;4:ZvQ5P5EP8kvm96kiO+HpAxmLQsHCMHcS4oXZZLMxwocaEC7qNnDnAFV54wKLUu4cKM74gdQ6fvbZJVNqz6St2bLc4V/FgkOUkkMspj4F2BVUFmAbDNgNfzPcxAnGsxYp8ITIyK7tX1mHg0AIhHZi3UtFxRI1Z68wS8NVq0WKnme1Fj//66040J8iSAlbfFzkCZwfIQhCjUYE6yK4dNA/NIhu1+tTK1/8HWNHJyiERv7/nxhi13gG/oXoWJxvU6yq X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3002001)(100000703101)(100105400095)(6041248)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR0701MB3833;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR0701MB3833; X-Forefront-PRVS: 04433051BF X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(6009001)(376002)(346002)(189002)(199003)(66066001)(36756003)(47776003)(189998001)(6666003)(4326008)(53936002)(6496005)(110136005)(50986999)(7736002)(2906002)(305945005)(107886003)(25786009)(5660300001)(42882006)(8936002)(68736007)(101416001)(478600001)(72206003)(8676002)(48376002)(16526017)(6486002)(16586007)(316002)(5003940100001)(97736004)(50466002)(81166006)(50226002)(106356001)(3846002)(81156014)(6116002)(1076002)(76506005)(105586002)(33646002);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR0701MB3833;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR0701MB3833;23:FxqqAzwoSIAHa1xbVILP6jlV/cfAYTcUt5G0mVv?= =?us-ascii?Q?/lchz86caFRkeBClkXuRTX/dBMXcifRgPUX4XgsqjO5gNm+PTW97KANsB0jw?= =?us-ascii?Q?fGrX2VFst9RhnUTwmYz8HU5I7vyLi893RlqhJZrwf7o2nA782WDo702wM3ls?= =?us-ascii?Q?7cZ5s7x80dR7asEplQn+rxNH9hqqrSWWuJHEwm1r89XQjyMrItgLnkmoPL9X?= =?us-ascii?Q?6Y+FDw309tPGecGwph9vHY9KjbQYy1nGbF9GavaehJh52ADv7qUkhJx6Pv4/?= =?us-ascii?Q?/34dIyC0xVuss2QzGK4B3BbXduAPbHT5zjsUeZXcadu+H+XXTwLvYs7OVM9j?= =?us-ascii?Q?ghCTSDGLup6s/J8uNsjkdnF007hHs+UAS5JEZW0dMUJ4EmlyDlNg9ISrVsqe?= =?us-ascii?Q?J/rz6KjSUXhPJy8TviZ71R8v2oz2ilgD/iepjh59g+wDjEn31xJcDwzpfz1L?= =?us-ascii?Q?mTiBYMO+XZh+GccrocMJMxDXeC5I7VCWI7VpnJbP8ucLNryTQlKJhPc6ipYK?= =?us-ascii?Q?zeMDDtEycW6l8mfEh1hChRuoJKYD0xHsAkkAASs11qSIbcN09Nh6j3CxIpp8?= =?us-ascii?Q?sbf+LxLp3tMMlPpHAAMvxjuQ4gmXZKOYVn9HKJleIAWMHM8uYttr99MdkIcp?= =?us-ascii?Q?ZJjjQXDRYPfW+RL54164yST7PaEZ22+jTxidWxwz2OKKbSF77tCpN9S9QKNd?= =?us-ascii?Q?WPDtU5CrK8ayngP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bTE4M3lTjpS2d3IYakgXhH/49ckudcXZdzw0n32KxFzrff6viDYrIM=;7:c1Qy5PAug00RuZHAlHYDffURs3Sj0Fa9VOQOr+Asyoi+R1ThKeRzCMcauz7E9nb4vq3GNrKLSV4bg4SZMsYs784HIavadKdlfbw/+GoxCbJF/oJ2WQHUbUSL4gqnXzp/HT7Kn3u8uKNDJDcEabZA+y3VnKg97VLv6Lg0UyQk/YsetEhGgV6v7D60p1aAcXAehAAS7fcnsP5NmdJbuAGv9sdjraqWQzmAQS0m2l4CcgE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2017 00:33:06.3027 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0701MB3833 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 801 Lines: 25 There's a typo in put_compat_shm_info() - the first argument of copy_to_user() is 'up' instead of 'uip'. And 'up' is occasionly a suitable variable name so the compiler doesn't complain. Signed-off-by: Yury Norov --- ipc/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipc/shm.c b/ipc/shm.c index 1e2b1692ba2c..badac463e2c8 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -1154,7 +1154,7 @@ static int put_compat_shm_info(struct shm_info *ip, info.shm_swp = ip->shm_swp; info.swap_attempts = ip->swap_attempts; info.swap_successes = ip->swap_successes; - return copy_to_user(up, &info, sizeof(info)); + return copy_to_user(uip, &info, sizeof(info)); } static int copy_compat_shmid_to_user(void __user *buf, struct shmid64_ds *in, -- 2.11.0