fanotify: synchronize adding/removing a mark by means of group mutex
authorLino Sanfilippo <LinoSanfilippo@gmx.de>
Thu, 2 Dec 2010 10:03:43 +0000 (11:03 +0100)
committerEric Paris <eparis@redhat.com>
Wed, 15 Dec 2010 18:58:45 +0000 (13:58 -0500)
When removing flags from the mask of a mark the mask may go to 0 and the mark should
be destroyed. But right before we destroy it there is a race which allows a
concurrent process to add flags to the mask of the same marks that we are going to destroy.
Thus we might end up destroying a mark that has not all flags cleared in its mask.

This patch uses the group mutex to serialize the access to a mark, so that a concurrent
concurrent process can no longer access it if it is going to be destroyed.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Eric Paris <eparis@redhat.com>

No differences found