From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] keys: Protect the update method check against type removal
Date: Thu, 29 Oct 2026 12:05:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-189252@kernel.org> (raw)
In-Reply-To: <pm-keys-update-type-removal-20261029-v6-3d92b2f9693854230a02@gmail.com>
> key_update() reads key->type->update, ->def_datalen and ->preparse
> before it takes key->sem. A reference on the key does not pin the
> module that provides its type, so KEYCTL_UPDATE can race with the
> unloading of that module, for example dns_resolver:
>
> KEYCTL_UPDATE task Module unload and key GC
> ------------------ ------------------------
> keyctl_update_key()
> key_update()
> key_permission()
> load key->type
> exit_dns_resolver()
> unregister_key_type()
> GC: down_write(&key->sem)
> GC: retype to key_type_dead
> [ ... ]
> method and key_update() returns -EOPNOTSUPP.
>
> Assisted-by: LLM
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/pm-keys-update-type-removal-20261029-v6-3d92b2f9693854230a02@gmail.com?part=1
next prev parent reply other threads:[~2026-10-29 12:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 11:58 [PATCH] keys: Protect the update method check against type removal Cen Zhang
2026-10-29 12:05 ` sashiko-bot [this message]
2026-10-29 13:14 ` Jarkko Sakkinen
2026-10-29 14:04 ` Cen Zhang
2026-10-29 15:04 ` Jarkko Sakkinen
2026-10-29 15:49 ` Cen Zhang
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=sashiko-outbox-189252@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.