All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	David Howells <dhowells@redhat.com>,
	keyrings@vger.kernel.org,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>, Kees Cook <kees@kernel.org>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	Anastasia Eskova <anastasia.eskova@ibm.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/cert_store: Hold the keyring->sem while invalidating keys
Date: Wed, 28 Oct 2026 17:59:21 +0200	[thread overview]
Message-ID: <auIb2VIyDPqcgSgS@kernel.org> (raw)
In-Reply-To: <20261028153419.8417E3b-hca@linux.ibm.com>

On Wed, Oct 28, 2026 at 04:34:19PM +0100, Heiko Carstens wrote:
> On Sat, Oct 24, 2026 at 05:42:25PM +0300, Jarkko Sakkinen wrote:
> > invalidate_keyring_keys() does not hold keyring->sem while calling
> > keyring_read(), which is contrary to what keyring assumes from its callers,
> > and can lead to reoccuring bugs.
> > 
> > KEY_FLAG_KEEP alone does not e.g.,  protect from  the following call path:
> > 
> > 1. keyctl_keyring_move()
> > 2. key_move()
> > 3. __key_unlink()
> > 
> > Address the issue by guarding the critical section.
> > 
> > Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates")
> > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> > ---
> > This came up as a side product while working on assoc_array to
> > rhashtable migration and going through various callers of the keyring.
> > It's made by me but please keep in mind that I don't even have a
> > toolchain for s390 setup so it is based only on reading code and I have
> > not even compiled this.
> > 
> > Just wanted to clarify the background for this fix as I'm not a regular
> > contributor over here. If for any reason it turned out to be false
> > positive, I'm fine with that too.
> 
> It is not a false positive. There seem to be more bugs in the code.
> I'll take your patch and create a series with other fixes.

OK, great :-)

> 
> Thanks a lot!

You're welcome!

Br, Jarkko

      reply	other threads:[~2026-10-28 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24 14:42 [PATCH] s390/cert_store: Hold the keyring->sem while invalidating keys Jarkko Sakkinen
2026-10-24 14:58 ` sashiko-bot
2026-10-24 16:15   ` Jarkko Sakkinen
2026-10-28 15:34 ` Heiko Carstens
2026-10-28 15:59   ` 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=auIb2VIyDPqcgSgS@kernel.org \
    --to=jarkko@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=anastasia.eskova@ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=dhowells@redhat.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=kees@kernel.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=oberpar@linux.ibm.com \
    --cc=svens@linux.ibm.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.