1
From: John Johansen <jjohansen@suse.de>
2
Subject: AppArmor: reintroduce ATTR_FILE
4
The fsetattr patch removed ATTR_FILE but AppArmor needs it to distinguish
7
Note: Now that LSMs must be static, it would be better to add a file
8
pointer argument to security_operations->inode_setattr() instead. Then
9
move the fs.h chunk to patches.apparmor/fsetattr-restore-ia_file. -jeffm
11
Signed-off-by: John Johansen <jjohansen@suse.de>
15
include/linux/fs.h | 1 +
16
2 files changed, 4 insertions(+)
20
@@ -207,6 +207,9 @@ int do_truncate(struct dentry *dentry, s
21
newattrs.ia_size = length;
22
newattrs.ia_valid = ATTR_SIZE | time_attrs;
25
+ newattrs.ia_valid |= ATTR_FILE;
27
/* Remove suid/sgid on truncate too */
28
newattrs.ia_valid |= should_remove_suid(dentry);
30
--- a/include/linux/fs.h
31
+++ b/include/linux/fs.h
32
@@ -331,6 +331,7 @@ typedef void (dio_iodone_t)(struct kiocb
33
#define ATTR_ATTR_FLAG 1024
34
#define ATTR_KILL_SUID 2048
35
#define ATTR_KILL_SGID 4096
36
+#define ATTR_FILE 8192
37
#define ATTR_KILL_PRIV 16384
38
#define ATTR_OPEN 32768 /* Truncating from open(O_TRUNC) */