Message ID | a7d493c678d5836577b0dc703e5f0adaa457a7f0.1626945419.git-series.a.fatoum@pengutronix.de |
---|---|
State | New |
Delegated to: | Richard Weinberger |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nQspUARo; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVn2W4KRCz9sWw for <incoming@patchwork.ozlabs.org>; Thu, 22 Jul 2021 19:19:15 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9WxwbgD8b8LS79KJ1bPFbflbjWoe1qbTOXtcDE227WQ=; b=nQspUARoj66mey 4/UXMLyp+8WwsYo16Hy94qYR3PFWJmNjFBsOl3R+PxL9cx/3T1aaJ7Pl8xBsRJE+6qabx11K+SN/v mSqb/+US1JFzQhamnmFVNAuELKn8pfWPg2GSx+q4CRdlrbl313v9m+VV4CGMaOcwGRRrwz71DXGwB 2Bk/M4cfogHWk2h3wL9yqI97j+jn+kdcbPHV5WOWyG5CKreWvk4Lar4Wand2GoID9vwYOMZbSVuZU HdDByVWk9v4dUKFehCK6vM1q3v+doKftBHWs1GmrYSRr8itqD5DozIoM5WjIUuvA2Di8Yni5YMPo7 +f7szvyMQLGChnOJbdhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6Uqc-000qVq-Pu; Thu, 22 Jul 2021 09:18:30 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6UqZ-000qU2-Ct for linux-mtd@lists.infradead.org; Thu, 22 Jul 2021 09:18:28 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <afa@pengutronix.de>) id 1m6UqE-0001NN-VX; Thu, 22 Jul 2021 11:18:06 +0200 Received: from afa by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from <afa@pengutronix.de>) id 1m6UqC-0001Cw-GC; Thu, 22 Jul 2021 11:18:04 +0200 From: Ahmad Fatoum <a.fatoum@pengutronix.de> To: David Howells <dhowells@redhat.com>, Jarkko Sakkinen <jarkko@kernel.org>, James Morris <jmorris@namei.org>, "Serge E. Hallyn" <serge@hallyn.com>, Alasdair Kergon <agk@redhat.com>, Mike Snitzer <snitzer@redhat.com>, dm-devel@redhat.com, Song Liu <song@kernel.org>, Richard Weinberger <richard@nod.at> Cc: kernel@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, keyrings@vger.kernel.org, linux-mtd@lists.infradead.org, linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org Subject: [RFC PATCH v1 3/4] ubifs: auth: remove never hit key type error check Date: Thu, 22 Jul 2021 11:18:01 +0200 Message-Id: <a7d493c678d5836577b0dc703e5f0adaa457a7f0.1626945419.git-series.a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <cover.b2fdd70b830d12853b12a12e32ceb0c8162c1346.1626945419.git-series.a.fatoum@pengutronix.de> References: <cover.b2fdd70b830d12853b12a12e32ceb0c8162c1346.1626945419.git-series.a.fatoum@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: afa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mtd@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210722_021827_487762_95D7DEE5 X-CRM114-Status: GOOD ( 12.75 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: key_request accepts a key type as its first argument. If it returns a valid pointer, it should always have this same requested key type. Indeed other request_key users surveyed such as dm-crypt, ecryptfs and fscrypt v1 also don't check the key type. Therefore drop the apparently unneeded check. Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2001:67c:670:201:290:27ff:fe1d:cc33 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
keys: introduce key_extract_material helper
|
expand
|
diff --git a/fs/ubifs/auth.c b/fs/ubifs/auth.c index e564d5ff8781..6a0b8d858d81 100644 --- a/fs/ubifs/auth.c +++ b/fs/ubifs/auth.c @@ -286,12 +286,6 @@ int ubifs_init_authentication(struct ubifs_info *c) down_read(&keyring_key->sem); - if (keyring_key->type != &key_type_logon) { - ubifs_err(c, "key type must be logon"); - err = -ENOKEY; - goto out; - } - ukp = user_key_payload_locked(keyring_key); if (!ukp) { /* key was revoked before we acquired its semaphore */
key_request accepts a key type as its first argument. If it returns a valid pointer, it should always have this same requested key type. Indeed other request_key users surveyed such as dm-crypt, ecryptfs and fscrypt v1 also don't check the key type. Therefore drop the apparently unneeded check. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> --- To: David Howells <dhowells@redhat.com> To: Jarkko Sakkinen <jarkko@kernel.org> To: James Morris <jmorris@namei.org> To: "Serge E. Hallyn" <serge@hallyn.com> To: Alasdair Kergon <agk@redhat.com> To: Mike Snitzer <snitzer@redhat.com> To: dm-devel@redhat.com To: Song Liu <song@kernel.org> To: Richard Weinberger <richard@nod.at> Cc: linux-kernel@vger.kernel.org Cc: linux-raid@vger.kernel.org Cc: keyrings@vger.kernel.org Cc: linux-mtd@lists.infradead.org Cc: linux-security-module@vger.kernel.org Cc: linux-integrity@vger.kernel.org --- fs/ubifs/auth.c | 6 ------ 1 file changed, 6 deletions(-)