All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Cen Zhang <zzzccc427@gmail.com>,
	dhowells@redhat.com, paul@paul-moore.com, jmorris@namei.org,
	serge@hallyn.com, keyrings@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, baijiaju1990@gmail.com,
	jjzuming@gmail.com
Subject: Re: [PATCH v3] keys: Protect the update method check against type removalg
Date: Mon, 2 Nov 2026 09:27:30 +0200	[thread overview]
Message-ID: <aug7YvK_mhbm51JR@kernel.org> (raw)
In-Reply-To: <aug072sNik47BXxQ@kernel.org>

On Mon, Nov 02, 2026 at 09:00:03AM +0200, Jarkko Sakkinen wrote:
> On Sun, Nov 01, 2026 at 02:15:19PM -0800, Eric Biggers wrote:
> > On Sat, Oct 31, 2026 at 05:26:36PM +0800, Cen Zhang wrote:
> > > Take key->sem before the first access to key->type and hold it until
> > > 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.
> > 
> > Reviewed-by: Eric Biggers <ebiggers@kernel.org>
> > 
> > But it seems broken that a key type can be removed while keys of that
> > type still exist.
> 
> It might sense add ->owner and use try_module_get(). That would lead
> into removal of key_type_dead.
> 
> I'd think that is doable but I would first consider applying
> https://lore.kernel.org/keyrings/20261030205412.3138975-1-jarkko@kernel.org/
> as that is more substantial multi-subsystem change.

I would probably favor this idea but it would also change visible
semantics how key types behave with rmmod.

I.e. -EBUSY instead of immediate success. I'm only worried here
of user space relaying on how it works right now.

Br, Jarkko

      reply	other threads:[~2026-11-02  7:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  9:26 [PATCH v3] keys: Protect the update method check against type removal Cen Zhang
2026-10-31  9:33 ` sashiko-bot
2026-10-31  9:50 ` Jarkko Sakkinen
2026-11-01 22:15 ` Eric Biggers
2026-11-02  6:59   ` [PATCH v3] keys: Protect the update method check against type removalg Jarkko Sakkinen
2026-11-02  7:27     ` Jarkko Sakkinen [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=aug7YvK_mhbm51JR@kernel.org \
    --to=jarkko@kernel.org \
    --cc=baijiaju1990@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=jjzuming@gmail.com \
    --cc=jmorris@namei.org \
    --cc=keyrings@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 \
    --cc=zzzccc427@gmail.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 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.