aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-07-29 07:45:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-07-29 18:16:18 -0400
commit8f92054e7ca1d3a3ae50fb42d2253ac8730d9b2a (patch)
tree29d1bcf78bf04fe41c7e811f806f58d655c41f9f /Documentation
parentde09a9771a5346029f4d11e4ac886be7f9bfdd75 (diff)
CRED: Fix __task_cred()'s lockdep check and banner comment
Fix __task_cred()'s lockdep check by removing the following validation condition: lockdep_tasklist_lock_is_held() as commit_creds() does not take the tasklist_lock, and nor do most of the functions that call it, so this check is pointless and it can prevent detection of the RCU lock not being held if the tasklist_lock is held. Instead, add the following validation condition: task->exit_state >= 0 to permit the access if the target task is dead and therefore unable to change its own credentials. Fix __task_cred()'s comment to: (1) discard the bit that says that the caller must prevent the target task from being deleted. That shouldn't need saying. (2) Add a comment indicating the result of __task_cred() should not be passed directly to get_cred(), but rather than get_task_cred() should be used instead. Also put a note into the documentation to enforce this point there too. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/credentials.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/Documentation/credentials.txt b/Documentation/credentials.txt
index a2db35287003..995baf379c07 100644
--- a/Documentation/credentials.txt
+++ b/Documentation/credentials.txt
@@ -417,6 +417,9 @@ reference on them using:
417This does all the RCU magic inside of it. The caller must call put_cred() on 417This does all the RCU magic inside of it. The caller must call put_cred() on
418the credentials so obtained when they're finished with. 418the credentials so obtained when they're finished with.
419 419
420 [*] Note: The result of __task_cred() should not be passed directly to
421 get_cred() as this may race with commit_cred().
422
420There are a couple of convenience functions to access bits of another task's 423There are a couple of convenience functions to access bits of another task's
421credentials, hiding the RCU magic from the caller: 424credentials, hiding the RCU magic from the caller:
422 425