Skip to content
Commit 0b9dc6c9 authored by Jann Horn's avatar Jann Horn Committed by James Morris
Browse files

keys: safe concurrent user->{session,uid}_keyring access



The current code can perform concurrent updates and reads on
user->session_keyring and user->uid_keyring. Add a comment to
struct user_struct to document the nontrivial locking semantics, and use
READ_ONCE() for unlocked readers and smp_store_release() for writers to
prevent memory ordering issues.

Fixes: 69664cf1 ("keys: don't generate user and user session keyrings unless they're accessed")
Signed-off-by: default avatarJann Horn <jannh@google.com>
Signed-off-by: default avatarJames Morris <james.morris@microsoft.com>
parent 5c7e372c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment