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

From: Hugh Dickins
Date: Sat Mar 28 2009 - 19:24:46 EST


From: David Howells <dhowells@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>
Cc: stable@xxxxxxxxxx
---

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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/