X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=security%2Fkeys%2Fkeyctl.c;h=3868c6700b588512acc36814682f895644116089;hb=9d1ac65a9698513d00e5608d93fca0c53f536c14;hp=b2b0998d6abda7759433d7032d255eb0a317c126;hpb=ff3cb3fec3c5bbb5110e652bbdd410bc99a47e9f;p=net-next-2.6.git diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index b2b0998d6ab..3868c6700b5 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c @@ -1272,6 +1272,7 @@ long keyctl_session_to_parent(void) keyring_r = NULL; me = current; + rcu_read_lock(); write_lock_irq(&tasklist_lock); parent = me->real_parent; @@ -1319,6 +1320,7 @@ long keyctl_session_to_parent(void) set_ti_thread_flag(task_thread_info(parent), TIF_NOTIFY_RESUME); write_unlock_irq(&tasklist_lock); + rcu_read_unlock(); if (oldcred) put_cred(oldcred); return 0; @@ -1327,6 +1329,7 @@ already_same: ret = 0; not_permitted: write_unlock_irq(&tasklist_lock); + rcu_read_unlock(); put_cred(cred); return ret;