Re: [RFC PATCH v2 02/11] nvme-keyring: Add a missing key_put() call to nvme_tls_key_lookup()

From
Jarkko Sakkinen <jarkko@kernel.org>
Date
2026-11-03 12:29:15
Also in
keyrings, linux-integrity, linux-nvme, lkml, stable
Reply to
Christoph Hellwig, 2026-11-03
On Tue, Nov 03, 2026 at 06:33:03AM +0100, Christoph Hellwig wrote:
On Tue, Nov 03, 2026 at 05:02:07AM +0200, Jarkko Sakkinen wrote:
quoted
Call key_put() before returning -EKEYREVOKED, as the reference count gets
incremented by key_lookup().
Looks good, but I only got this one patch out of a 11 patch series,
so without the full context it's hard to fully review it.
I can it is just I rather do it on request because some people complain
when doing what you asked :-) Regardless, the bug is independent of any
patch set changes.

I'll summarize the context below (ignore or read).

I tried to tackle: https://lore.kernel.org/lkml/20261101221519.GB2689@quark/ (local)

And essentially what I would want is key_type_dead not to exist.

This version is based on module pinning, and  thus not having that
key_put() would keep key type module alive in that case. However, it
turned out this approach will not fly as AF_RXRPC and DNS resolver will
hit the wall given e.g., the remote pinnings.

The approach I'm going for next is to have a type registry instead,
which is independent of the module system (to put story really short).
I think I'm doing this with right process as this really needs a few
trials in order to find patterns that stick.

Br, Jarkko
Thread (41 messages) 41 messages, 6 authors, last reply 14h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help