Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

audit: fix oops removing watch if audit disabled

Removing a watched file will oops if audit is disabled (auditctl -e 0).

To reproduce:
- auditctl -e 1
- touch /tmp/foo
- auditctl -w /tmp/foo
- auditctl -e 0
- rm /tmp/foo (or mv)

Signed-off-by: Tony Jones <tonyj@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Tony Jones and committed by
Linus Torvalds
7b018b28 266f5aa0

+1 -1
+1 -1
kernel/auditfilter.c
··· 947 947 948 948 /* If the update involves invalidating rules, do the inode-based 949 949 * filtering now, so we don't omit records. */ 950 - if (invalidating && 950 + if (invalidating && current->audit_context && 951 951 audit_filter_inodes(current, current->audit_context) == AUDIT_RECORD_CONTEXT) 952 952 audit_set_auditable(current->audit_context); 953 953