From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH v2] keys: Protect the update method check against type removal
Date: Thu, 29 Oct 2026 16:13:34 +0000 [thread overview]
Message-ID: <sashiko-outbox-189651@kernel.org> (raw)
In-Reply-To: <pm-keys-update-type-removal-20261029-v7-e79d113bcff91e140d04@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
> [ ... ]
> the preparsed payload has been freed. Once a key exists, only the GC
> changes key->type, and it does so with key->sem held for writing.
>
> 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-v7-e79d113bcff91e140d04@gmail.com?part=1
prev parent reply other threads:[~2026-10-29 16:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 16:07 [PATCH v2] keys: Protect the update method check against type removal Cen Zhang
2026-10-29 16:13 ` sashiko-bot [this message]
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-189651@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox