]> git.baikalelectronics.ru Git - kernel.git/commit
fanotify: Fix use after free for permission events
authorJan Kara <jack@suse.cz>
Tue, 28 Jan 2014 20:38:06 +0000 (21:38 +0100)
committerJan Kara <jack@suse.cz>
Wed, 29 Jan 2014 12:57:17 +0000 (13:57 +0100)
commitb8c41566810ad61f896c2bf93997691d818568a0
treedd9a5103e62f15e74b2d7729e972d141845462aa
parent1b84db975b98875ada1f345f100b7839c661c394
fanotify: Fix use after free for permission events

Currently struct fanotify_event_info has been destroyed immediately
after reporting its contents to userspace. However that is wrong for
permission events because those need to stay around until userspace
provides response which is filled back in fanotify_event_info. So change
to code to free permission events only after we have got the response
from userspace.

Reported-and-tested-by: Jiri Kosina <jkosina@suse.cz>
Reported-and-tested-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/fanotify/fanotify.c
fs/notify/fanotify/fanotify.h
fs/notify/fanotify/fanotify_user.c