Annotate struct fs_struct's usage count restriction
authorDavid Howells <dhowells@redhat.com>
Sat, 28 Mar 2009 23:23:01 +0000 (23:23 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 29 Mar 2009 00:30:00 +0000 (17:30 -0700)
Annotate struct fs_struct's usage count to indicate the restrictions upon it.
It may not be incremented, except by clone(CLONE_FS), as this affects the
check in check_unsafe_exec() in fs/exec.c.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/fs_struct.h

index a97c053d3a9ae2b9063da2b67c374be3145fd05a..18b467dbe278bf4b399274ff272355d2984530ce 100644 (file)
@@ -4,7 +4,10 @@
 #include <linux/path.h>
 
 struct fs_struct {
-       atomic_t count;
+       atomic_t count; /* This usage count is used by check_unsafe_exec() for
+                        * security checking purposes - therefore it may not be
+                        * incremented, except by clone(CLONE_FS).
+                        */
        rwlock_t lock;
        int umask;
        struct path root, pwd;