From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795988479; b=XRly5c0Ov1iNS59CIvR5Bmu0VZPwDDvuOK5KWaXyOuqvb0BIKUf1wySI80Qj+ACW/OXG 9wTTXukCADDxMPvPbI7qO3zUZGAfSZGvkvykOB9qZwcgLYxMmyFE5vymgwSv7wLRDmy+w zFTEzpieXtcUD7pJpcEiYUxLmR3dxzYJVhINmIhDcI8f1XUxQtCqAZR5DSEVuuWl5EEqz BMbZ/4IIZ84i+2NbgAq/99kMlDAZHdVJyfJnCDXo5qZFYShjuO8K3qWzwd2yvGYMd8W+o B+MPUlHXtImCi/btJFew3xXxmf9HDDOVOHVZvAyDADPwNMsFN49p5AC+EVcg1KBgeXQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795988479; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=vY1ybWNep9dp4QumEI887mKVEQeFVbvSecu1f8BIAzI=; b=Z4U/aJJybtuuiovpOiFxjKv7SacG0q4fwo6a5clhHyynCljFnLZexjm8Q5yYaOZiiqWq vb12mwq96rWy1VMjAWFHJhihTR2UyxBFKVSqAr8ufdtkQrQ2CLQwgHOBLBZZF4ygEKHsf /2IGMlx9nys8mGaHv3CDBEJ8Ch2JtxkBqOMvCRe90SKSqitFajBA+yP0wZwYUWo7oK9F6 E6usZJk4K3PMvaP7HDSOTP2vyc+4+eVyyT0Ctx+k7xalrLoj2lmy4MCDJ+XfqVnaCDgHp /3tIqe2e0HyAhPD7IbyXiBz+FKLMmP1XNrHG770e9GzbY53z+BTPP1zco+jIWcHB4PA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q8+8OQQk; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id C6EB7606A31C; Sun, 29 Nov 2026 21:41:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q8+8OQQk Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id 1D0181F00896; Sun, 29 Nov 2026 21:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795988479; bh=vY1ybWNep9dp4QumEI887mKVEQeFVbvSecu1f8BIAzI=; h=From:To:Cc:Subject:Date; b=Q8+8OQQkKWBvc8+ZMu6zNp9ldV+Goss2DfS4/T5JyExY/EOZDdlU12fnl+JgI0xU3 aFr5H52CXw2RSZ6Twk+r3XH4aXV03xgj/CCCKxkD7fo4HABEme/VcAgbEi+GRY4QZG jZvh9z0X4xbnYrpZk08bhapxfdxE6Bd/Lw1f+I1/YuIYQkvWzciuxcWOVMgTadO24e CQXEwgyIGKBNqs7jeJBcjogN4goOkSVI+S6Tl9JllqohkYPvUqbDNYdbWpBeBKD0Al FyfzWqTzJbZF23SfUM/CmFDyqLpR4QmO2qrca3y1O2NPWxKGsHwcapGvbxACcD333T a/Gnxc8/RfKRQ== From: Jarkko Sakkinen To: keyrings@vger.kernel.org Cc: Jarkko Sakkinen , linux-doc@vger.kernel.org, linux-security-module@vger.kernel.org, David Howells , Guicai Ma , James Morris , Jann Horn , Jonathan Corbet , Paul Moore , Randy Dunlap , "Serge E. Hallyn" , Shuah Khan Subject: [PATCH 0/2] KEYS: Fix credential handling in lookup_user_key() Date: Sun, 29 Nov 2026 23:41:12 +0200 Message-ID: <20261129214115.3043489-1-jarkko@kernel.org> X-Mailer: git-send-email 2.47.3 X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The commit messages looked a bit too stub so I refined them just a bit and piggybacked these changes for a sanity check round: 1. Return the user session keyring directly on non-creating KEY_SPEC_SESSION_KEYRING lookups instead of mutating task credentials. 2. Reject KEY_LOOKUP_CREATE with -EPERM when subjective credentials are overridden, avoiding the BUG_ON() in commit_creds(). Hope this helps with the clarity. They are pushed to my -next mirror branch but I can still either drop or add more tags. If nothing comes up, I'll just move forward with the PR. Link: https://lore.kernel.org/keyrings/CAG48ez0XjVSR=M--UBauTm8sJuc+ZbhKzaPa3a6wrSVHyoKevw@mail.gmail.com/ Cc: keyrings@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: David Howells Cc: Guicai Ma Cc: James Morris Cc: Jann Horn Cc: Jonathan Corbet Cc: Paul Moore Cc: Randy Dunlap Cc: "Serge E. Hallyn" Cc: Shuah Khan Jarkko Sakkinen (2): KEYS: Return user session keyring on lookup KEYS: Reject keyring creation with overridden credentials Documentation/security/keys/core.rst | 7 ++-- security/keys/keyctl.c | 5 ++- security/keys/process_keys.c | 50 +++++++++------------------- 3 files changed, 22 insertions(+), 40 deletions(-) base-commit: 822ba3a89c7896b26e4beb70e2ebffb881924dfe prerequisite-patch-id: 6b9f0c26cb5c2290d5a2a78c18ccf225b09a6bbb prerequisite-patch-id: 0f71199bbbbaf9fe1fa82afb1926b452c493532e prerequisite-patch-id: 97be79eb77addef7282d5cb9966c4208cf0e965e -- 2.47.3