]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fanotify: sanitize failure exits in copy_event_to_user()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 19 Aug 2012 16:30:45 +0000 (12:30 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 22 Aug 2012 21:29:30 +0000 (17:29 -0400)
commit61a13846b56fb1c2bb3dbf635883550f3314fd15
tree8ffaf2c14bc30fed469c7146478cb78afbef6e57
parent2b0dcf9ab35fe7305de0514ecc19568a30f9c429
fanotify: sanitize failure exits in copy_event_to_user()

* do copy_to_user() before prepare_for_access_response(); that kills
the need in remove_access_response().
* don't do fd_install() until we are past the last possible failure
exit.  Don't use sys_close() on cleanup side - just put_unused_fd()
and fput().  Less racy that way...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/notify/fanotify/fanotify_user.c