* [GIT PULL] KEYS: changes for v7.4-rc1
@ 2026-10-21 14:22 Jarkko Sakkinen
2026-10-22 20:06 ` Linus Torvalds
2026-10-22 20:50 ` pr-tracker-bot
0 siblings, 2 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2026-10-21 14:22 UTC (permalink / raw)
To: Linus Torvalds
Cc: David Howells, Herbert Xu, David S. Miller, James Bottomley,
Mimi Zohar, Eric Biggers, Kyle Zeng, keyrings, linux-integrity,
linux-security-module
The following changes since commit c03c1a14507dfaf8b856c2608f9ac216021fc222:
Linux 7.3 (2026-10-18 13:14:58 -1000)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git tags/keys-v7.4-rc1
for you to fetch changes up to 722658cac48a6ba49f5506fd74d010ad9dbb2f05:
keys/trusted_keys: reuse TPM version in option handling (2026-10-20 18:15:40 +0300)
----------------------------------------------------------------
KEYS: changes for v7.4-rc1
HIGHLIGHTS
==========
A patch that Kyle Zeng submitted addresses a critical bug and complements
the ongoing rhashtable migration. The commit in question is de891c73c1cf
("keys: make keyring indexes independent of kernel addresses").
The index value for the associative array has been calculated with the
following formula:
mult_64x32_and_fold(description + type address + domain address)
By creating a sequence of dummy keys (e.g., "A", "B", "C", ...), it is
trivial to form a group of equations with a predictable hash function, and
ultimately break KASLR.
Kyle's solution is based on an ephemeral SipHash key and an atomic 64-bit
counter, which is encapsulated to a key_index_id(). This function is then
used to assign identifiers for types and domains, and since the IDs are
unique for each power on, they are as unique as memory addresses are.
With these ingredients the index value calculation can be changed into
form, which is not leaking any kernel addresses:
SipHash(description + type id + domain id)
This is exactly what the Kyle's commit does.
FEATURES AND IMPROVEMENTS
=========================
- TPM fields were moved from trusted_key_options to the TPM backend.
They cost memory for non-TPM backends.
- A TPM trusted key now caches tpm_is_tpm2() at the root of each call
chain, and passes the result as a parameter. This decreases the amount
of I/O traffic given that tpm_is_tpm2() starts and stops the chip via
tpm_try_get_ops() and tpm_put_ops().
BUGS
====
- A TPM trusted key corrupted the return value of a failed key unsealing
operation if the pcrlock feature was used.
- A TPM 2 trusted key allocated an off-by-four too large buffer for the
decoded ASN.1 blob coming from keyctl add trusted.
- Sometimes a TPM 2 trusted key rejected created keys based on the
TPM2_Create response size, treating them as too large. Now it correctly
checks the extracted TPM2 key blob size.
- The keyctl reject operation raced with keyctl restrict_keyring because
keyring->sem was not held in key_reject_and_link() before accessing
keyring->restrict_link.
- keyctl_describe_key() was not holding key->sem while accessing its
fields, which can lead to use-after-free of a retired key type.
- find_keyring_by_name() and procfs code were reading the UID from
key->user->uid instead of key->uid. The latter is the cached value and
is meant to protect against a use-after-free caused by keyctl chown.
- search_process_keyrings_rcu() did not properly RCU-dereference the
authorization key payload, which could cause a null dereference if the
payload was revoked.
- keyctl_read_key() checked key->type->read without holding key->sem,
which can lead to use-after-free if the type is retired. Based on my
suggestion, this was addressed in __keyctl_read_key(), which already
did take key->sem.
----------------------------------------------------------------
Adrian Martinez (1):
KEYS: Fix key_reject_and_link() race with keyring restriction
Cen Zhang (5):
keys: Protect the type name while describing a key
keys: Avoid the owner account dereference in named keyring lookup
keys: Check the authorization payload in process keyring searches
keys: Avoid owner account dereferences in /proc/keys
keys: Protect the read method check against type removal
Kyle Zeng (1):
keys: make keyring indexes independent of kernel addresses
Srish Srinivasan (4):
keys/trusted_keys: return immediately after TPM unseal failure
keys/trusted_keys: move TPM-specific fields into struct trusted_key_tpm
keys/trusted/tpm2: Validate TPM2_Create object sizes separately
keys/trusted_keys: reuse TPM version in option handling
Stefano Garzarella (1):
KEYS: trusted: Fix blob allocation size in tpm2_key_decode()
Thomas Huth (1):
security: keys: Fix comment of search_process_keyrings_rcu()
include/keys/trusted-type.h | 11 ---
include/keys/trusted_tpm.h | 14 +++
include/linux/key-type.h | 1 +
include/linux/key.h | 5 +
security/keys/key.c | 13 ++-
security/keys/keyctl.c | 15 +--
security/keys/keyring.c | 152 +++++++++++++++--------------
security/keys/proc.c | 4 +-
security/keys/process_keys.c | 7 +-
security/keys/trusted-keys/trusted_tpm1.c | 154 ++++++++++++++++--------------
security/keys/trusted-keys/trusted_tpm2.c | 94 ++++++++++--------
11 files changed, 258 insertions(+), 212 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [GIT PULL] KEYS: changes for v7.4-rc1
2026-10-21 14:22 [GIT PULL] KEYS: changes for v7.4-rc1 Jarkko Sakkinen
@ 2026-10-22 20:06 ` Linus Torvalds
2026-10-22 20:53 ` Jarkko Sakkinen
2026-10-22 20:50 ` pr-tracker-bot
1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2026-10-22 20:06 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: David Howells, Herbert Xu, David S. Miller, James Bottomley,
Mimi Zohar, Eric Biggers, Kyle Zeng, keyrings, linux-integrity,
linux-security-module
On Wed, 21 Oct 2026 at 04:22, Jarkko Sakkinen <jarkko@kernel.org> wrote:
>
> A patch that Kyle Zeng submitted addresses a critical bug [..]
Note that breaking local KASLR is not a "critical bug". We just call
it "Thursday".
Breaking KASRL locally is trivial using just all the normal local CPU
timing attacks.
KASLR is there to make remote attacks harder.
Linus
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [GIT PULL] KEYS: changes for v7.4-rc1
2026-10-22 20:06 ` Linus Torvalds
@ 2026-10-22 20:53 ` Jarkko Sakkinen
0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2026-10-22 20:53 UTC (permalink / raw)
To: Linus Torvalds
Cc: David Howells, Herbert Xu, David S. Miller, James Bottomley,
Mimi Zohar, Eric Biggers, Kyle Zeng, keyrings, linux-integrity,
linux-security-module
On Thu, Oct 22, 2026 at 10:06:56AM -1000, Linus Torvalds wrote:
> On Wed, 21 Oct 2026 at 04:22, Jarkko Sakkinen <jarkko@kernel.org> wrote:
> >
> > A patch that Kyle Zeng submitted addresses a critical bug [..]
>
> Note that breaking local KASLR is not a "critical bug". We just call
> it "Thursday".
>
> Breaking KASRL locally is trivial using just all the normal local CPU
> timing attacks.
>
> KASLR is there to make remote attacks harder.
>
> Linus
Ok, that's fair and makes sense.
Br, Jarkko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [GIT PULL] KEYS: changes for v7.4-rc1
2026-10-21 14:22 [GIT PULL] KEYS: changes for v7.4-rc1 Jarkko Sakkinen
2026-10-22 20:06 ` Linus Torvalds
@ 2026-10-22 20:50 ` pr-tracker-bot
1 sibling, 0 replies; 4+ messages in thread
From: pr-tracker-bot @ 2026-10-22 20:50 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: Linus Torvalds, David Howells, Herbert Xu, David S. Miller,
James Bottomley, Mimi Zohar, Eric Biggers, Kyle Zeng, keyrings,
linux-integrity, linux-security-module
The pull request you sent on Wed, 21 Oct 2026 17:22:43 +0300:
> git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git tags/keys-v7.4-rc1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/14785eff402944f56466ef0058408334cfc2f91d
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-22 20:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 14:22 [GIT PULL] KEYS: changes for v7.4-rc1 Jarkko Sakkinen
2026-10-22 20:06 ` Linus Torvalds
2026-10-22 20:53 ` Jarkko Sakkinen
2026-10-22 20:50 ` pr-tracker-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox