• Jan Kara's avatar
    audit: Fix possible spurious -ENOSPC error · a5789b07
    Jan Kara authored
    
    
    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: default avatarRichard Guy Briggs <rgb@redhat.com>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
    a5789b07
audit_tree.c 23.6 KB