aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/request_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/keys/request_key.c')
-rw-r--r--security/keys/request_key.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index 1919540f047d..54aa7b70e63b 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -175,13 +175,12 @@ static struct key *__request_key_construction(struct key_type *type,
175 key->expiry = now.tv_sec + key_negative_timeout; 175 key->expiry = now.tv_sec + key_negative_timeout;
176 176
177 if (current->signal->session_keyring) { 177 if (current->signal->session_keyring) {
178 unsigned long flags;
179 struct key *keyring; 178 struct key *keyring;
180 179
181 spin_lock_irqsave(&current->sighand->siglock, flags); 180 rcu_read_lock();
182 keyring = current->signal->session_keyring; 181 keyring = rcu_dereference(current->signal->session_keyring);
183 atomic_inc(&keyring->usage); 182 atomic_inc(&keyring->usage);
184 spin_unlock_irqrestore(&current->sighand->siglock, flags); 183 rcu_read_unlock();
185 184
186 key_link(keyring, key); 185 key_link(keyring, key);
187 key_put(keyring); 186 key_put(keyring);