Skip to content

keys: fix keyring assoc-array out-of-bounds read and index inconsistency

Michael Bommarito keyrings linux-security-module lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesIn review
  2. v23 patches 6 repliesSuperseded
  3. v13 patches 6 repliesSuperseded

Changes in v3 from the cover letter

Per Jarkko's review, patch 1 no longer extends the existing keyring_get_key_chunk() declaration line; the new offset is declared on its own line as unsigned int. No functional change.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3keys: fix out-of-bounds read in keyring_get_key_chunk()security/keys/keyring.c+5 -40 replies
2/3keys: make keyring key-chunk byte order agree with keyring_diff_objects()security/keys/keyring.c+3 -20 replies
3/3assoc_array: trim the final shortcut word using the current chunk endlib/assoc_array.c+2 -10 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJarkko Sakkinen
SeriesR-b T-b
1/3
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] keys: fix keyring assoc-array out-of-bounds read and index inconsistency

An unprivileged keyring whose keys collide through the description-chunk path can drive assoc_array node splitting into an out-of-bounds slot write. Patch 1 stops the out-of-bounds read in keyring_get_key_chunk(); patch 2 makes the chunk byte order agree with keyring_diff_objects(); patch 3 fixes the shortcut-walk trim so the walk cannot be steered down the wrong descendant.

v3 changes (patch 1 only; patches 2 and 3 are unchanged):
Per Jarkko's review, patch 1 no longer extends the existing keyring_get_key_chunk() declaration line; the new offset is declared on its own line as unsigned int. No functional change.

Patches 2 and 3 are unchanged from v2 and carry Jarkko's Reviewed-by.

v2: https://lore.kernel.org/keyrings/[email protected]/
v1: https://lore.kernel.org/keyrings/[email protected]/

Michael Bommarito (3):
keys: fix out-of-bounds read in keyring_get_key_chunk()
keys: make keyring key-chunk byte order agree with
keyring_diff_objects()
assoc_array: trim the final shortcut word using the current chunk end

 lib/assoc_array.c       |  3 ++-
 security/keys/keyring.c | 14 ++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

base-commit: 2c7c88a412aa6d09cd04b414211b4ef8553b5309

Signature · 1 line
2.53.0