]>
Commit | Line | Data |
---|---|---|
6a930a95 BS |
1 | From: John Johansen <jjohansen@suse.de> |
2 | Subject: AppArmor: reintroduce ATTR_FILE | |
3 | ||
4 | The fsetattr patch removed ATTR_FILE but AppArmor needs it to distinguish | |
5 | file based writes. | |
6 | ||
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 | |
10 | ||
11 | Signed-off-by: John Johansen <jjohansen@suse.de> | |
12 | ||
13 | --- | |
14 | fs/open.c | 3 +++ | |
15 | 1 file changed, 3 insertions(+) | |
16 | ||
17 | --- a/fs/open.c | |
18 | +++ b/fs/open.c | |
19 | @@ -208,6 +208,9 @@ int do_truncate(struct dentry *dentry, s | |
20 | newattrs.ia_size = length; | |
21 | newattrs.ia_valid = ATTR_SIZE | time_attrs; | |
22 | ||
23 | + if (filp) | |
24 | + newattrs.ia_valid |= ATTR_FILE; | |
25 | + | |
26 | /* Remove suid/sgid on truncate too */ | |
27 | newattrs.ia_valid |= should_remove_suid(dentry); | |
28 |