]> asedeno.scripts.mit.edu Git - linux.git/commit
fanotify: Dont allow a mask of 0 if setting or removing a mark
authorLino Sanfilippo <LinoSanfilippo@gmx.de>
Mon, 22 Nov 2010 17:46:33 +0000 (18:46 +0100)
committerEric Paris <eparis@redhat.com>
Tue, 7 Dec 2010 21:14:21 +0000 (16:14 -0500)
commit1734dee4e3a296cb72b4819fc2e7ef2440737dff
tree1923b47c601a521ebe5989b1878cd4d1f17d2b20
parentfa218ab98c31eeacd12b89501e6b99d146ea56cc
fanotify: Dont allow a mask of 0 if setting or removing a mark

In mark_remove_from_mask() we destroy marks that have their event mask cleared.
Thus we should not allow the creation of those marks in the first place.
With this patch we check if the mask given from user is 0 in case of FAN_MARK_ADD.
If so we return an error. Same for FAN_MARK_REMOVE since this does not have any
effect.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
fs/notify/fanotify/fanotify_user.c