Skip to content

KEYS: fix atomicity issues with key flags

Eric Biggers keyrings linux-security-module lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 1 replyIn review
  2. v11 patch 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6KEYS: fix race between updating and finding negative keyinclude/linux/key.h security/keys/key.c security/keys/keyctl.c +2 more+42 -141 reply
2/6KEYS: load key flags atomically in key_is_instantiated()include/linux/key.h+5 -20 replies
3/6KEYS: load key flags and expiry time atomically in key_validate()security/keys/permission.c+4 -30 replies
4/6KEYS: load key flags and expiry time atomically in keyring_search_iterator()security/keys/keyring.c+4 -20 replies
5/6KEYS: load key flags and expiry time atomically in proc_keys_show()security/keys/proc.c+16 -120 replies
6/6KEYS: remove KEY_FLAG_NEGATIVEinclude/linux/key.h security/keys/encrypted-keys/encrypted.c security/keys/gc.c +7 more+21 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] KEYS: fix atomicity issues with key flags

From: Eric Biggers <[email protected]>

The first patch in this series fixes the race between updating and finding a negative key, which could be used by an unprivileged user to cause a kernel oops. That patch is Cc'ed to stable.

The remaining patches fix some other, more theoretical atomicity issues with accessing key->flags and key->expiry, then eliminate KEY_FLAG_NEGATIVE, which becomes unnecessary after the first patch.

Eric Biggers (6):
KEYS: fix race between updating and finding negative key
KEYS: load key flags atomically in key_is_instantiated()
KEYS: load key flags and expiry time atomically in key_validate()
KEYS: load key flags and expiry time atomically in
keyring_search_iterator()
KEYS: load key flags and expiry time atomically in proc_keys_show()
KEYS: remove KEY_FLAG_NEGATIVE

 include/linux/key.h                      | 37 +++++++++++++++++++++++---------
 security/keys/encrypted-keys/encrypted.c |  2 +-
 security/keys/gc.c                       |  4 +---
 security/keys/key.c                      | 24 +++++++++++++++------
 security/keys/keyctl.c                   |  5 ++++-
 security/keys/keyring.c                  | 12 ++++++-----
 security/keys/permission.c               |  7 +++---
 security/keys/proc.c                     | 28 +++++++++++++-----------
 security/keys/request_key.c              | 11 ++++++----
 security/keys/trusted.c                  |  2 +-
 security/keys/user_defined.c             |  2 +-
 11 files changed, 86 insertions(+), 48 deletions(-)
Signature · 1 line
2.14.1.992.g2c7b836f3a-goog