Skip to content

Commit 3836a03

Browse files
eparistorvalds
authored andcommitted
anon_inodes: mark the anon inode private
Inotify was switched to use anon_inode instead of its own private filesystem which only had one inode in commit c44dcc5 "switch inotify_user to anon_inode" The problem with this is that now the inotify inode is not a distinct inode which can be managed by LSMs. userspace tools which use inotify were allowed to use the inotify inode but may not have had permission to do read/write type operations on the anon_inode. After looking at the anon_inode and its users it looks like the best solution is to just mark the anon_inode as S_PRIVATE so the security system will ignore it. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 83c0fb6 commit 3836a03

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/anon_inodes.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ static struct inode *anon_inode_mkinode(void)
209209
inode->i_mode = S_IRUSR | S_IWUSR;
210210
inode->i_uid = current_fsuid();
211211
inode->i_gid = current_fsgid();
212+
inode->i_flags |= S_PRIVATE;
212213
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
213214
return inode;
214215
}

0 commit comments

Comments
 (0)