Linux Security Modules development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH v2] keys: Protect the read method check against type removal
Date: Mon, 19 Oct 2026 16:10:15 +0000	[thread overview]
Message-ID: <sashiko-outbox-177820@kernel.org> (raw)
In-Reply-To: <pm-key-management-objects-candidate-0010-v7-fc85721ff5cfb9e33ac6@gmail.com>

> keyctl_read_key() checks key->type->read without holding key->sem.
> A reference keeps the key alive, but does not pin the module containing
> its type. A surviving RxRPC key can therefore be read while AF_RXRPC
> is being unloaded:
> 
>   KEYCTL_READ task                    Module unload and key GC
>   ----------------                   ------------------------
>   lookup_user_key()
>   permission / possession checks
>   load key->type
>                                      af_rxrpc_exit()
>                                        unregister_key_type()
>                                          GC: down_write(key->sem)
>                                          GC: retype to key_type_dead
>                                          GC: up_write(key->sem)
> [ ... ]
> allocation and copying to userspace remain outside the semaphore.
> 
> Suggested-by: Jarkko Sakkinen <jarkko@kernel.org>
> Assisted-by: LLM
> 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-key-management-objects-candidate-0010-v7-fc85721ff5cfb9e33ac6@gmail.com?part=1


      parent reply	other threads:[~2026-10-19 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 14:57 [PATCH v2] keys: Protect the read method check against type removal Cen Zhang
2026-10-19 15:17 ` Jarkko Sakkinen
2026-10-19 16:02   ` David Howells
2026-10-19 16:10 ` 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-177820@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