From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] KEYS: Protect user key quota access during instantiation
Date: Mon, 12 Oct 2026 03:25:08 +0000 [thread overview]
Message-ID: <sashiko-outbox-167576@kernel.org> (raw)
In-Reply-To: <pm-key-management-objects-candidate-0001-v6-9876bf3e2116d47c065e@gmail.com>
> The owner account must remain alive throughout payload quota
> reservation. The user key type calls generic_key_instantiate(), which
> dereferences key->user in key_payload_reserve(), without holding
> key->sem. The construction mutex excludes other instantiators but does
> not exclude keyctl_chown_key().
>
> A kernel caller can allocate an in-quota user key, retain its reference
> and instantiate it with a nonempty payload after publishing its serial.
> A concurrent task with Setattr permission and CAP_SYS_ADMIN can chown
> the still-uninstantiated key through KEY_LOOKUP_PARTIAL. If the key
> holds the last reference to its non-root account, instantiation has no
> authorization key, and the new owner has sufficient quota, this ordering
> is possible:
>
> Instantiator Chown task
> [ ... ]
> BUG: KASAN: slab-use-after-free in key_payload_reserve+0x54d/0x560
>
>
> Fixes: 5801649d8b83 ("[PATCH] keys: let keyctl_chown() change a key's owner")
> Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/pm-key-management-objects-candidate-0001-v6-9876bf3e2116d47c065e@gmail.com?part=1
next prev parent reply other threads:[~2026-10-12 3:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 3:15 [PATCH] KEYS: Protect user key quota access during instantiation Cen Zhang
2026-10-12 3:25 ` sashiko-bot [this message]
2026-10-12 13:00 ` Jarkko Sakkinen
2026-10-12 13:03 ` Jarkko Sakkinen
2026-10-12 13:30 ` Cen Zhang
2026-10-12 13:33 ` Cen Zhang
2026-10-12 15:01 ` Jarkko Sakkinen
2026-10-12 13:49 ` Jarkko Sakkinen
2026-10-12 13:59 ` 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-167576@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