Skip to content

Commit 7dbe608

Browse files
amir73iljankara
authored andcommitted
audit: do not set FS_EVENT_ON_CHILD in audit marks mask
The audit group marks mask does not contain any events possible on a child so setting the flag FS_EVENT_ON_CHILD in the mask is counter productive. It may lead to the undesired outcome of setting the dentry flag DCACHE_FSNOTIFY_PARENT_WATCHED on a directory inode even though it is not watching children, because the audit mark contribute the flag FS_EVENT_ON_CHILD to the inode's fsnotify_mask and another mark could be contributing an event that is possible on child to the inode's mask. Furthermore in the following patches we want to use FS_EVENT_ON_CHILD for non-dir inodes for other purposes so stop using the flag. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Amir Goldstein <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 957f7b4 commit 7dbe608

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kernel/audit_fsnotify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static struct fsnotify_group *audit_fsnotify_group;
3636

3737
/* fsnotify events we care about. */
3838
#define AUDIT_FS_EVENTS (FS_MOVE | FS_CREATE | FS_DELETE | FS_DELETE_SELF |\
39-
FS_MOVE_SELF | FS_EVENT_ON_CHILD)
39+
FS_MOVE_SELF)
4040

4141
static void audit_fsnotify_mark_free(struct audit_fsnotify_mark *audit_mark)
4242
{

kernel/audit_watch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static struct fsnotify_group *audit_watch_group;
5353

5454
/* fsnotify events we care about. */
5555
#define AUDIT_FS_WATCH (FS_MOVE | FS_CREATE | FS_DELETE | FS_DELETE_SELF |\
56-
FS_MOVE_SELF | FS_EVENT_ON_CHILD | FS_UNMOUNT)
56+
FS_MOVE_SELF | FS_UNMOUNT)
5757

5858
static void audit_free_parent(struct audit_parent *parent)
5959
{

0 commit comments

Comments
 (0)