[PATCH 4/4] Annotate struct fs_struct's usage count restriction

Hugh Dickins
2009-03-28T23:24:45Z

From: David Howells <dhowells@redhat.com>

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
---

include/linux/fs_struct.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

--- 2.6.29/include/linux/fs_struct.h 2009-03-23 23:12:14.000000000 +0000
+++ linux/include/linux/fs_struct.h 2009-03-28 18:06:02.000000000 +0000
@@ -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;