From: Mohammed EL Kadiri <med08elkadiri@gmail.com>
To: jarkko@kernel.org, dhowells@redhat.com
Cc: paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com,
kees@kernel.org, keyrings@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
Mohammed EL Kadiri <med08elkadiri@gmail.com>
Subject: [PATCH 1/2] keys: request_key: replace BUG with return -EINVAL
Date: Sat, 13 Jun 2026 14:04:07 +0100 [thread overview]
Message-ID: <20260613130408.13709-2-med08elkadiri@gmail.com> (raw)
In-Reply-To: <20260613130408.13709-1-med08elkadiri@gmail.com>
Replace BUG() in construct_get_dest_keyring() default case
with return -EINVAL to handle the unimplemented group keyring
destination gracefully.
Signed-off-by: Mohammed EL Kadiri <med08elkadiri@gmail.com>
---
security/keys/request_key.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index a7673ad86d18..fa2bb9f2f538 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -332,7 +332,7 @@ static int construct_get_dest_keyring(struct key **_dest_keyring)
case KEY_REQKEY_DEFL_GROUP_KEYRING:
default:
- BUG();
+ return -EINVAL;
}
/*
--
2.43.0
next prev parent reply other threads:[~2026-06-13 13:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-13 13:04 [PATCH 0/2] security/keys: replace BUG() in unreachable default cases Mohammed EL Kadiri
2026-06-13 13:04 ` Mohammed EL Kadiri [this message]
2026-06-15 12:06 ` [PATCH 1/2] keys: request_key: replace BUG with return -EINVAL Jarkko Sakkinen
2026-06-13 13:04 ` [PATCH 2/2] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Mohammed EL Kadiri
2026-06-15 12:06 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260613130408.13709-2-med08elkadiri@gmail.com \
--to=med08elkadiri@gmail.com \
--cc=dhowells@redhat.com \
--cc=jarkko@kernel.org \
--cc=jmorris@namei.org \
--cc=kees@kernel.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox