All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: keyrings@vger.kernel.org,
	Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>,
	stable@vger.kernel.org, David Howells <dhowells@redhat.com>,
	Lukas Wunner <lukas@wunner.de>,
	Ignat Korchagin <ignat@cloudflare.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Mimi Zohar <zohar@linux.ibm.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH v7] KEYS: Add a list for unreferenced keys
Date: Mon, 7 Apr 2025 14:23:43 +0300	[thread overview]
Message-ID: <Z_O1v8awuTeJ9qfS@kernel.org> (raw)
In-Reply-To: <32c1e996-ac34-496f-933e-a266b487da1a@samsung.com>

On Mon, Apr 07, 2025 at 12:25:11PM +0200, Marek Szyprowski wrote:
> On 07.04.2025 04:39, Jarkko Sakkinen wrote:
> > From: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>
> >
> > Add an isolated list of unreferenced keys to be queued for deletion, and
> > try to pin the keys in the garbage collector before processing anything.
> > Skip unpinnable keys.
> >
> > Use this list for blocking the reaping process during the teardown:
> >
> > 1. First off, the keys added to `keys_graveyard` are snapshotted, and the
> >     list is flushed. This the very last step in `key_put()`.
> > 2. `key_put()` reaches zero. This will mark key as busy for the garbage
> >     collector.
> > 3. `key_garbage_collector()` will try to increase refcount, which won't go
> >     above zero. Whenever this happens, the key will be skipped.
> >
> > Cc: stable@vger.kernel.org # v6.1+ Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>
> This patch landed in today's linux-next as commit b0d023797e3e ("keys: 
> Add a list for unreferenced keys"). In my tests I found that it triggers 
> the following lockdep issue:
> 
> ================================
> WARNING: inconsistent lock state
> 6.15.0-rc1-next-20250407 #15630 Not tainted
> --------------------------------
> inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
> ksoftirqd/3/32 [HC0[0]:SC1[1]:HE1:SE0] takes:
> c13fdd68 (key_serial_lock){+.?.}-{2:2}, at: key_put+0x74/0x128
> {SOFTIRQ-ON-W} state was registered at:
>    lock_acquire+0x134/0x384
>    _raw_spin_lock+0x38/0x48
>    key_alloc+0x2fc/0x4d8
>    keyring_alloc+0x40/0x90
>    system_trusted_keyring_init+0x50/0x7c
>    do_one_initcall+0x68/0x314
>    kernel_init_freeable+0x1c0/0x224
>    kernel_init+0x1c/0x12c
>    ret_from_fork+0x14/0x28
> irq event stamp: 234
> hardirqs last  enabled at (234): [<c0cb7060>] 
> _raw_spin_unlock_irqrestore+0x5c/0x60
> hardirqs last disabled at (233): [<c0cb6dd0>] 
> _raw_spin_lock_irqsave+0x64/0x68
> softirqs last  enabled at (42): [<c013bcd8>] handle_softirqs+0x328/0x520
> softirqs last disabled at (47): [<c013bf10>] run_ksoftirqd+0x40/0x68

OK what went to -next went there by accident and has been removed,
sorry. I think it was like the very first version of this patch.

Thanks for informing anyhow!

BR, Jarkko

  reply	other threads:[~2025-04-07 11:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250407102514eucas1p1b297b7b6012a5ece4ccdca8e0e2c7956@eucas1p1.samsung.com>
2025-04-07  2:39 ` [PATCH v7] KEYS: Add a list for unreferenced keys Jarkko Sakkinen
2025-04-07 10:25   ` Marek Szyprowski
2025-04-07 11:23     ` Jarkko Sakkinen [this message]
2025-04-07 12:08       ` Jarkko Sakkinen
2025-04-07 12:42         ` Marek Szyprowski
2025-04-07 12:49           ` Jarkko Sakkinen

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=Z_O1v8awuTeJ9qfS@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=ignat@cloudflare.com \
    --cc=jarkko.sakkinen@opinsys.com \
    --cc=jgg@ziepe.ca \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=m.szyprowski@samsung.com \
    --cc=paul@paul-moore.com \
    --cc=peterhuewe@gmx.de \
    --cc=serge@hallyn.com \
    --cc=stable@vger.kernel.org \
    --cc=zohar@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.