fanotify: limit the number of marks in a single fanotify group

There is currently no limit on the number of marks a given fanotify group
can have.  Since fanotify is gated on CAP_SYS_ADMIN this was not seen as
a serious DoS threat.  This patch implements a default of 8192, the same as
inotify to work towards removing the CAP_SYS_ADMIN gating and eliminating
the default DoS'able status.

Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
Eric Paris
2010-10-28 17:21:57 -04:00
parent 5dd03f55fd
commit e7099d8a5a
2 changed files with 10 additions and 0 deletions

View File

@ -169,6 +169,7 @@ struct fsnotify_group {
bool bypass_perm; /* protected by access_mutex */
#endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */
int f_flags;
unsigned int max_marks;
} fanotify_data;
#endif /* CONFIG_FANOTIFY */
};