summaryrefslogtreecommitdiff
path: root/include/linux/input
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-09-19 14:44:30 -0700
committerBen Hutchings <ben@decadent.org.uk>2016-11-20 01:17:33 +0000
commit2426513015c851bd714537c5967498ccc80b23d0 (patch)
tree02a60fd13f724100e720660649409b66d6bb4f63 /include/linux/input
parent460da2d56d7c6f27259a92c4b31b3445049ff343 (diff)
fanotify: fix list corruption in fanotify_get_response()
commit 96d41019e3ac55f6f0115b0ce97e4f24a3d636d2 upstream. fanotify_get_response() calls fsnotify_remove_event() when it finds that group is being released from fanotify_release() (bypass_perm is set). However the event it removes need not be only in the group's notification queue but it can have already moved to access_list (userspace read the event before closing the fanotify instance fd) which is protected by a different lock. Thus when fsnotify_remove_event() races with fanotify_release() operating on access_list, the list can get corrupted. Fix the problem by moving all the logic removing permission events from the lists to one place - fanotify_release(). Fixes: 5838d4442bd5 ("fanotify: fix double free of pending permission events") Link: http://lkml.kernel.org/r/1473797711-14111-3-git-send-email-jack@suse.cz Signed-off-by: Jan Kara <jack@suse.cz> Reported-by: Miklos Szeredi <mszeredi@redhat.com> Tested-by: Miklos Szeredi <mszeredi@redhat.com> Reviewed-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> [bwh: Backported to 3.16: - s/fsnotify_remove_first_event/fsnotify_remove_notify_event/ - Adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/linux/input')
0 files changed, 0 insertions, 0 deletions