From patchwork Fri Mar 1 11:30:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 10834993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF420180E for ; Fri, 1 Mar 2019 11:30:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABB592EFBE for ; Fri, 1 Mar 2019 11:30:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8AD12F01C; Fri, 1 Mar 2019 11:30:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37A952EFDD for ; Fri, 1 Mar 2019 11:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728300AbfCALac (ORCPT ); Fri, 1 Mar 2019 06:30:32 -0500 Received: from imap1.codethink.co.uk ([176.9.8.82]:53580 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbfCALac (ORCPT ); Fri, 1 Mar 2019 06:30:32 -0500 Received: from [167.98.27.226] (helo=rainbowdash.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1gzgN2-0001w9-K9; Fri, 01 Mar 2019 11:30:28 +0000 Received: from ben by rainbowdash.codethink.co.uk with local (Exim 4.92-RC6) (envelope-from ) id 1gzgN2-0004cZ-4F; Fri, 01 Mar 2019 11:30:28 +0000 From: Ben Dooks To: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org, dhowells@redhat.com, jmorris@namei.org, serge@hallyn.com, linux-kernel@lists.codethink.co.uk, Ben Dooks Subject: [PATCH] keys: fix missing __user in KEYCTL_PKEY_QUERY Date: Fri, 1 Mar 2019 11:30:26 +0000 Message-Id: <20190301113026.17721-1-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The arg5 of KEYCTL_PKEY_QUERY should have a __user pointer tag on it as it is a user pointer. This clears the following sparse warning for this: security/keys/keyctl.c:1755:43: warning: incorrect type in argument 3 (different address spaces) security/keys/keyctl.c:1755:43: expected struct keyctl_pkey_query [noderef] * security/keys/keyctl.c:1755:43: got struct keyctl_pkey_query * Signed-off-by: Ben Dooks Acked-by: Serge Hallyn Acked-by: David Howells --- security/keys/keyctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index 7bbe03593e58..3e4053a217c3 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c @@ -1752,7 +1752,7 @@ SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3, return -EINVAL; return keyctl_pkey_query((key_serial_t)arg2, (const char __user *)arg4, - (struct keyctl_pkey_query *)arg5); + (struct keyctl_pkey_query __user *)arg5); case KEYCTL_PKEY_ENCRYPT: case KEYCTL_PKEY_DECRYPT: