From patchwork Wed Sep 7 12:12:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 12968934 X-Patchwork-Delegate: paul@paul-moore.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA1D4C54EE9 for ; Wed, 7 Sep 2022 12:12:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbiIGMMw (ORCPT ); Wed, 7 Sep 2022 08:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiIGMMu (ORCPT ); Wed, 7 Sep 2022 08:12:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B4D59C1E8; Wed, 7 Sep 2022 05:12:39 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CF6721042; Wed, 7 Sep 2022 05:12:45 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8B04E3F7B4; Wed, 7 Sep 2022 05:12:38 -0700 (PDT) From: Vincenzo Frascino To: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vincenzo Frascino , David Howells , Jarkko Sakkinen , Paul Moore , James Morris Subject: [PATCH] security/keys: Remove inconsistent __user annotation Date: Wed, 7 Sep 2022 13:12:30 +0100 Message-Id: <20220907121230.21252-1-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Precedence: bulk List-ID: The declaration of keyring_read does not match the definition (security/keys/keyring.c). In this case the definition is correct because it matches what defined in "struct key_type::read" (linux/key-type.h). Fix the declaration removing the inconsistent __user annotation. Cc: David Howells Cc: Jarkko Sakkinen Cc: Paul Moore Cc: James Morris Signed-off-by: Vincenzo Frascino Reviewed-by: Paul Moore Acked-by: Jarkko Sakkinen --- Note: This issue was discovered during the porting of the linux kernel on Morello [1]. [1] https://git.morello-project.org/morello/kernel/linux security/keys/keyring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 5e6a90760753..4448758f643a 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -79,7 +79,7 @@ static void keyring_revoke(struct key *keyring); static void keyring_destroy(struct key *keyring); static void keyring_describe(const struct key *keyring, struct seq_file *m); static long keyring_read(const struct key *keyring, - char __user *buffer, size_t buflen); + char *buffer, size_t buflen); struct key_type key_type_keyring = { .name = "keyring",