fanotify: if set by user unset FMODE_NONOTIFY before fsnotify_perm() is called
authorLino Sanfilippo <LinoSanfilippo@gmx.de>
Fri, 5 Nov 2010 16:05:27 +0000 (17:05 +0100)
committerEric Paris <eparis@redhat.com>
Tue, 7 Dec 2010 21:14:21 +0000 (16:14 -0500)
commitb1085ba80cd2784400a7beec3fda5099198ed01c
treec83530f7d7f161c898d464fc1ce65be38a0268c1
parent88d60c32765716289abeb362c44adf6c35c6824c
fanotify: if set by user unset FMODE_NONOTIFY before fsnotify_perm() is called

Unsetting FMODE_NONOTIFY in fsnotify_open() is too late, since fsnotify_perm()
is called before. If FMODE_NONOTIFY is set fsnotify_perm() will skip permission
checks, so a user can still disable permission checks by setting this flag
in an open() call.
This patch corrects this by unsetting the flag before fsnotify_perm is called.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
fs/namei.c
include/linux/fsnotify.h