fanotify: Do check against max_marks and increase number of group marks atomically
authorLino Sanfilippo <LinoSanfilippo@gmx.de>
Tue, 9 Nov 2010 18:19:04 +0000 (19:19 +0100)
committerEric Paris <eparis@redhat.com>
Wed, 15 Dec 2010 18:58:44 +0000 (13:58 -0500)
The number of group marks is checked against max_marks and increased afterwards
in a non atomic way. This may result in 2 or more processes passing the check
at the same time and increasing the number of group marks above the max_marks
limit afterwards.
With this patch the check against max_marks is done in fsnotify_add_mark(),
after the group lock has been aquired to ensure that concurrent processes
cant exceed the group marks limit.

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

Simple merge
Simple merge