diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2010-10-19 03:13:04 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-10-19 03:13:04 -0400 |
commit | fa251f89903d73989e2f63e13d0eaed1e07ce0da (patch) | |
tree | 3f7fe779941e3b6d67754dd7c44a32f48ea47c74 /security/keys/keyctl.c | |
parent | dd3932eddf428571762596e17b65f5dc92ca361b (diff) | |
parent | cd07202cc8262e1669edff0d97715f3dd9260917 (diff) |
Merge branch 'v2.6.36-rc8' into for-2.6.37/barrier
Conflicts:
block/blk-core.c
drivers/block/loop.c
mm/swapfile.c
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'security/keys/keyctl.c')
-rw-r--r-- | security/keys/keyctl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index b2b0998d6abd..60924f6a52db 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c | |||
@@ -1272,6 +1272,7 @@ long keyctl_session_to_parent(void) | |||
1272 | keyring_r = NULL; | 1272 | keyring_r = NULL; |
1273 | 1273 | ||
1274 | me = current; | 1274 | me = current; |
1275 | rcu_read_lock(); | ||
1275 | write_lock_irq(&tasklist_lock); | 1276 | write_lock_irq(&tasklist_lock); |
1276 | 1277 | ||
1277 | parent = me->real_parent; | 1278 | parent = me->real_parent; |
@@ -1304,7 +1305,8 @@ long keyctl_session_to_parent(void) | |||
1304 | goto not_permitted; | 1305 | goto not_permitted; |
1305 | 1306 | ||
1306 | /* the keyrings must have the same UID */ | 1307 | /* the keyrings must have the same UID */ |
1307 | if (pcred->tgcred->session_keyring->uid != mycred->euid || | 1308 | if ((pcred->tgcred->session_keyring && |
1309 | pcred->tgcred->session_keyring->uid != mycred->euid) || | ||
1308 | mycred->tgcred->session_keyring->uid != mycred->euid) | 1310 | mycred->tgcred->session_keyring->uid != mycred->euid) |
1309 | goto not_permitted; | 1311 | goto not_permitted; |
1310 | 1312 | ||
@@ -1319,6 +1321,7 @@ long keyctl_session_to_parent(void) | |||
1319 | set_ti_thread_flag(task_thread_info(parent), TIF_NOTIFY_RESUME); | 1321 | set_ti_thread_flag(task_thread_info(parent), TIF_NOTIFY_RESUME); |
1320 | 1322 | ||
1321 | write_unlock_irq(&tasklist_lock); | 1323 | write_unlock_irq(&tasklist_lock); |
1324 | rcu_read_unlock(); | ||
1322 | if (oldcred) | 1325 | if (oldcred) |
1323 | put_cred(oldcred); | 1326 | put_cred(oldcred); |
1324 | return 0; | 1327 | return 0; |
@@ -1327,6 +1330,7 @@ already_same: | |||
1327 | ret = 0; | 1330 | ret = 0; |
1328 | not_permitted: | 1331 | not_permitted: |
1329 | write_unlock_irq(&tasklist_lock); | 1332 | write_unlock_irq(&tasklist_lock); |
1333 | rcu_read_unlock(); | ||
1330 | put_cred(cred); | 1334 | put_cred(cred); |
1331 | return ret; | 1335 | return ret; |
1332 | 1336 | ||