]> git.baikalelectronics.ru Git - kernel.git/commit
audit: Fix possible spurious -ENOSPC error
authorJan Kara <jack@suse.cz>
Mon, 12 Nov 2018 14:54:48 +0000 (09:54 -0500)
committerPaul Moore <paul@paul-moore.com>
Mon, 12 Nov 2018 14:54:48 +0000 (09:54 -0500)
commit05eee3cf4eda6b8115c1b7daed87333dde491971
tree72090bebf2b65c0bd3f312166cf2a0a4514cfea0
parent2c6310100c4c04d5a5815e47935e1ef2f0aadb27
audit: Fix possible spurious -ENOSPC error

When an inode is tagged with a tree, tag_chunk() checks whether there is
audit_tree_group mark attached to the inode and adds one if not. However
nothing protects another tag_chunk() to add the mark between we've
checked and try to add the fsnotify mark thus resulting in an error from
fsnotify_add_mark() and consequently an ENOSPC error from tag_chunk().

Fix the problem by holding mark_mutex over the whole check-insert code
sequence.

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/audit_tree.c