fanotify: display group registration info
From: Eric Paris <eparis@redhat.com>
new file /security/fanotify/[name]/info will display registration
information so a process can know if the group gives what it wants, needs
to be cleanup up, should be reused, etc etc.
Signed-off-by: Eric Paris <eparis@redhat.com>
---
fs/notify/Makefile | 2 +
fs/notify/fanotify.h | 4 ++
fs/notify/group.c | 7 ++++
fs/notify/info_user.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 97 insertions(+), 1 deletions(-)
create mode 100644 fs/notify/info_user.c
diff --git a/fs/notify/Makefile b/fs/notify/Makefile
index 21ca1da..01915f7 100644
--- a/fs/notify/Makefile
+++ b/fs/notify/Makefile
@@ -3,4 +3,4 @@ obj-$(CONFIG_INOTIFY_USER) += inotify_user.o
obj-$(CONFIG_DNOTIFY) += dnotify.o
-obj-$(CONFIG_FANOTIFY) += fanotify.o notification.o notification_user.o group.o group_user.o
+obj-$(CONFIG_FANOTIFY) += fanotify.o notification.o notification_user.o group.o group_user.o info_user.o
diff --git a/fs/notify/fanotify.h b/fs/notify/fanotify.h
index d6bc0c0..78d8be0 100644
--- a/fs/notify/fanotify.h
+++ b/fs/notify/fanotify.h
@@ -24,6 +24,7 @@ struct fanotify_group {
char *name; /* group name used for register/unregister matching */
struct dentry *subdir; /* pointer to fanotify/name dentry */
struct dentry *notification; /* pointer to fanotify/name/notification dentry */
+ struct dentry *info; /* pointer to fanotify/name/info dentry */
};
/*
@@ -66,6 +67,9 @@ extern struct list_head groups;
extern __init int fanotify_register_init(void);
extern __init int fanotify_register_uninit(void);
+extern int fanotify_info_user_destroy(struct fanotify_group *group);
+extern int fanotify_info_user_create(struct fanotify_group *group);
+
extern int fanotify_notification_user_destroy(struct fanotify_group *group);
extern int fanotify_notification_user_create(struct fanotify_group *group);
diff --git a/fs/notify/group.c ...