* [PATCH v2 00/16] Fanotify event with name info
@ 2020-02-17 13:14 Amir Goldstein
2020-02-17 13:14 ` [PATCH v2 10/16] fanotify: send FAN_DIR_MODIFY event flavor with dir inode and name Amir Goldstein
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Amir Goldstein @ 2020-02-17 13:14 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-fsdevel, linux-api, Matthew Bobrowski
Jan,
This is v2 of the fanotify name info series.
The user requirement for the name info feature, as well as early UAPI
discussions can be found in this [1] lore thread.
The "prep" part of v1 was posted to the list [2] and includes two
minor bug fixes, but I decided not to split the submission into
two series this posting.
The patches are also available on my github branch fanotify_name [3]
along with LTP tests [4], man page draft [5] and a demo [6].
Patches 1-7 are cleanup and minor re-factoring in prep for the name
info patches.
Patches 8-9 are fixes for minor bug that I found during the work.
The referred LTP branch [4] includes improvements to ltp tests fanotify09
and fanotify15 to cover these bugs. I did not mark those patches for
stable, because backporting is not trivial and the bugs are really minor.
For the same reason, I did not bother to provide bug fix patches that are
not dependent on the cleanup patches.
Patches 10-13 implement the new event type FAN_DIR_MODIFY per your
suggestion, which includes the directory fid and entry name info.
Patches 14-15 implement the FAN_REPORT_NAME init flag for reporting
name info on path type events.
Patch 16 is a "bonus" patch that implements an unprivileged fanotify
watch. It is not proposed for merging at this time, but is provided
in order to demonstrate how name info reporting is applicable for an
unprivileged watcher, should we decide to implement the feature.
LTP tests, man page draft for unprivileged fanotify written by Matthew
Bobrowski are available on fanotify_unpriv branches in respective trees.
The inotify demo branch [6] includes a script test_demo.sh whose
output [7] can be seen here below. The demo generates filesystem
events including file and directory renames, sleeps 2 seconds and
then reads the events from the queue and generates a report on
changes in the filesystem.
At event report time, the watcher uses open_by_handle_at(2) to report
up-to-date paths for parent dirs. The last name element in the path
is reported as it was recorded at event time, but the watcher uses
fstatat(2) to check whether the reported entry is negative or positive.
Negative entry paths are annotated with "(deleted)" postfix.
The idea is that file change monitors will use this information to
query the content of modified directories and file and update a
secondary data structure or take other actions.
The demo scripts can run as root and non-root user. When run as
non-root user, if the bonus FAN_UNPRIVILEGED patch is applied, it
demonstrates the unprivileged fanotify recursive watcher and produces
the exact same report information as the privileged filesystem watcher.
Thanks,
Amir.
Changes since v1:
- A few more cleanup patches
- Drop the abstract take_name_snapshot() vfs interface change
- Do not obfuscate event type for path type events
- Deal with the corner cases of event on root and disconnected dentry
- Bonus FAN_UNPRIVILEGED patch
[1] https://lore.kernel.org/linux-fsdevel/CADKPpc2RuncyN+ZONkwBqtW7iBb5ep_3yQN7PKe7ASn8DpNvBw@mail.gmail.com/
[2] https://lore.kernel.org/linux-fsdevel/20200114151655.29473-1-amir73il@gmail.com/
[3] https://github.com/amir73il/linux/commits/fanotify_name
[4] https://github.com/amir73il/ltp/commits/fanotify_name
[5] https://github.com/amir73il/man-pages/commits/fanotify_name
[6] https://github.com/amir73il/inotify-tools/commits/fanotify_name
[7] Demo run of inotifywatch race free monitor
==============================================
~# ./test_demo.sh /vdf
+ WD=/vdf
+ cd /vdf
+ rm -rf a
+ mkdir -p a/b/c/d/e/f/g/
+ touch a/b/c/0 a/b/c/1 a/b/c/d/e/f/g/0
+ id -u
+ [ 0 = 0 ]
+ MODE=--global
+ EVENTS=-e dir_modify -e modify -e attrib -e close_write
+ sleep 1
+ inotifywatch --global -e dir_modify -e modify -e attrib -e
close_write --timeout -2 /vdf
Establishing filesystem global watch...
Finished establishing watches, now collecting statistics.
Sleeping for 2 seconds...
+
+ t=Create files and dirs...
+ touch a/0 a/1 a/2 a/3
+ mkdir a/dir0 a/dir1 a/dir2
+
+ t=Rename files and dirs...
+ mv a/0 a/3
+ mv a/dir0 a/dir3
+
+ t=Delete files and dirs...
+ rm a/1
+ rmdir a/dir1
+
+ t=Modify files and dirs...
+ chmod +x a/b/c/d
+ echo
+
+ t=Move files and dirs...
+ mv a/b/c/1 a/b/c/d/e/f/g/1
+ mv a/b/c/d/e/f/g a/b/c/d/e/G
+
[fid=fd50.0.2007403;name='0'] /vdf/a/0 (deleted)
[fid=fd50.0.2007403;name='1'] /vdf/a/1 (deleted)
[fid=fd50.0.2007403;name='2'] /vdf/a/2
[fid=fd50.0.2007403;name='3'] /vdf/a/3
[fid=fd50.0.2007403;name='dir0'] /vdf/a/dir0 (deleted)
[fid=fd50.0.2007403;name='dir1'] /vdf/a/dir1 (deleted)
[fid=fd50.0.2007403;name='dir2'] /vdf/a/dir2
[fid=fd50.0.2007403;name='dir3'] /vdf/a/dir3
[fid=fd50.0.86;name='d'] /vdf/a/b/c/d
[fid=fd50.0.86;name='0'] /vdf/a/b/c/0
[fid=fd50.0.86;name='1'] /vdf/a/b/c/1 (deleted)
[fid=fd50.0.87;name='1'] /vdf/a/b/c/d/e/G/1
[fid=fd50.0.3000083;name='g'] /vdf/a/b/c/d/e/f/g (deleted)
[fid=fd50.0.2007404;name='G'] /vdf/a/b/c/d/e/G
total modify attrib close_write dir_modify filename
3 0 1 1 2 /vdf/a/0 (deleted)
3 0 1 1 2 /vdf/a/1 (deleted)
3 0 1 1 2 /vdf/a/3
2 0 1 1 1 /vdf/a/2
2 0 0 0 2 /vdf/a/dir0 (deleted)
2 0 0 0 2 /vdf/a/dir1 (deleted)
1 0 0 0 1 /vdf/a/dir2
1 0 0 0 1 /vdf/a/dir3
1 0 1 0 0 /vdf/a/b/c/d
1 1 0 1 0 /vdf/a/b/c/0
1 0 0 0 1 /vdf/a/b/c/1 (deleted)
1 0 0 0 1 /vdf/a/b/c/d/e/G/1
1 0 0 0 1 /vdf/a/b/c/d/e/f/g (deleted)
1 0 0 0 1 /vdf/a/b/c/d/e/G
==============================================
Amir Goldstein (16):
fsnotify: tidy up FS_ and FAN_ constants
fsnotify: factor helpers fsnotify_dentry() and fsnotify_file()
fsnotify: funnel all dirent events through fsnotify_name()
fsnotify: use helpers to access data by data_type
fsnotify: simplify arguments passing to fsnotify_parent()
fsnotify: pass dentry instead of inode for events possible on child
fsnotify: replace inode pointer with tag
fanotify: merge duplicate events on parent and child
fanotify: fix merging marks masks with FAN_ONDIR
fanotify: send FAN_DIR_MODIFY event flavor with dir inode and name
fanotify: prepare to encode both parent and child fid's
fanotify: record name info for FAN_DIR_MODIFY event
fanotify: report name info for FAN_DIR_MODIFY event
fanotify: report parent fid + name with FAN_REPORT_NAME
fanotify: refine rules for when name is reported
fanotify: support limited functionality for unprivileged users
fs/notify/fanotify/fanotify.c | 231 +++++++++++++++++++++------
fs/notify/fanotify/fanotify.h | 111 ++++++++++---
fs/notify/fanotify/fanotify_user.c | 182 +++++++++++++++++----
fs/notify/fsnotify.c | 22 +--
fs/notify/inotify/inotify_fsnotify.c | 10 +-
include/linux/fanotify.h | 21 ++-
include/linux/fsnotify.h | 135 +++++++---------
include/linux/fsnotify_backend.h | 87 +++++++---
include/uapi/linux/fanotify.h | 11 +-
kernel/audit_fsnotify.c | 13 +-
kernel/audit_watch.c | 16 +-
11 files changed, 584 insertions(+), 255 deletions(-)
base-commit: 11a48a5a18c63fd7621bb050228cebf13566e4d8
--
2.17.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 10/16] fanotify: send FAN_DIR_MODIFY event flavor with dir inode and name
2020-02-17 13:14 [PATCH v2 00/16] Fanotify event with name info Amir Goldstein
@ 2020-02-17 13:14 ` Amir Goldstein
2020-02-17 13:14 ` [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event Amir Goldstein
` (3 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Amir Goldstein @ 2020-02-17 13:14 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-fsdevel, linux-api
Dirent events are going to be supported in two flavors:
1. Directory fid info + mask that includes the specific event types
(e.g. FAN_CREATE) and an optional FAN_ONDIR flag.
2. Directory fid info + name + mask that includes only FAN_DIR_MODIFY.
To request the second event flavor, user needs to set the event type
FAN_DIR_MODIFY in the mark mask.
The first flavor is supported since kernel v5.1 for groups initialized
with flag FAN_REPORT_FID. It is intended to be used for watching
directories in "batch mode" - the watcher is notified when directory is
changed and re-scans the directory content in response. This event
flavor is stored more compactly in the event queue, so it is optimal
for workloads with frequent directory changes.
The second event flavor is intended to be used for watching large
directories, where the cost of re-scan of the directory on every change
is considered too high. The watcher getting the event with the directory
fid and entry name is expected to call fstatat(2) to query the content of
the entry after the change.
Legacy inotify events are reported with name and event mask (e.g. "foo",
FAN_CREATE | FAN_ONDIR). That can lead users to the conclusion that
there is *currently* an entry "foo" that is a sub-directory, when in fact
"foo" may be negative or non-dir by the time user gets the event.
To make it clear that the current state of the named entry is unknown,
when reporting an event with name info, fanotify obfuscates the specific
event types (e.g. create,delete,rename) and uses a common event type -
FAN_DIR_MODIFY to decribe the change. This should make it harder for
users to make wrong assumptions and write buggy filesystem monitors.
At this point, name info reporting is not yet implemented, so trying to
set FAN_DIR_MODIFY in mark mask will return -EINVAL.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
fs/notify/fanotify/fanotify.c | 7 ++++---
fs/notify/fsnotify.c | 2 +-
include/linux/fsnotify.h | 6 ++++++
include/linux/fsnotify_backend.h | 4 +++-
include/uapi/linux/fanotify.h | 1 +
5 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index 36903542aa57..1f60823931b7 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -194,9 +194,9 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group,
test_mask = event_mask & marks_mask & ~marks_ignored_mask;
/*
- * dirent modification events (create/delete/move) do not carry the
- * child entry name/inode information. Instead, we report FAN_ONDIR
- * for mkdir/rmdir so user can differentiate them from creat/unlink.
+ * For dirent modification events (create/delete/move) that do not carry
+ * the child entry name information, we report FAN_ONDIR for mkdir/rmdir
+ * so user can differentiate them from creat/unlink.
*
* For backward compatibility and consistency, do not report FAN_ONDIR
* to user in legacy fanotify mode (reporting fd) and report FAN_ONDIR
@@ -399,6 +399,7 @@ static int fanotify_handle_event(struct fsnotify_group *group,
BUILD_BUG_ON(FAN_MOVED_FROM != FS_MOVED_FROM);
BUILD_BUG_ON(FAN_CREATE != FS_CREATE);
BUILD_BUG_ON(FAN_DELETE != FS_DELETE);
+ BUILD_BUG_ON(FAN_DIR_MODIFY != FS_DIR_MODIFY);
BUILD_BUG_ON(FAN_DELETE_SELF != FS_DELETE_SELF);
BUILD_BUG_ON(FAN_MOVE_SELF != FS_MOVE_SELF);
BUILD_BUG_ON(FAN_EVENT_ON_CHILD != FS_EVENT_ON_CHILD);
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 193530f57963..72d332ce8e12 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -383,7 +383,7 @@ static __init int fsnotify_init(void)
{
int ret;
- BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_BITS) != 25);
+ BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_BITS) != 26);
ret = init_srcu_struct(&fsnotify_mark_srcu);
if (ret)
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 7ba40c19bc7e..fb54d9d70552 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -30,6 +30,12 @@ static inline void fsnotify_name(struct inode *dir, __u32 mask,
const struct qstr *name, u32 cookie)
{
fsnotify(dir, mask, child, FSNOTIFY_EVENT_INODE, name, cookie);
+ /*
+ * Send another flavor of the event without child inode data and
+ * without the specific event type (e.g. FS_CREATE|FS_IS_DIR).
+ * The name is relative to the dir inode the event is reported to.
+ */
+ fsnotify(dir, FS_DIR_MODIFY, dir, FSNOTIFY_EVENT_INODE, name, 0);
}
static inline void fsnotify_dirent(struct inode *dir, struct dentry *dentry,
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index cd106b5c87a4..310c639de04e 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -47,6 +47,7 @@
#define FS_OPEN_PERM 0x00010000 /* open event in an permission hook */
#define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */
#define FS_OPEN_EXEC_PERM 0x00040000 /* open/exec event in a permission hook */
+#define FS_DIR_MODIFY 0x00080000 /* Directory entry was modified */
#define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */
/* This inode cares about things that happen to its children. Always set for
@@ -66,7 +67,8 @@
* The watching parent may get an FS_ATTRIB|FS_EVENT_ON_CHILD event
* when a directory entry inside a child subdir changes.
*/
-#define ALL_FSNOTIFY_DIRENT_EVENTS (FS_CREATE | FS_DELETE | FS_MOVE)
+#define ALL_FSNOTIFY_DIRENT_EVENTS (FS_CREATE | FS_DELETE | FS_MOVE | \
+ FS_DIR_MODIFY)
#define ALL_FSNOTIFY_PERM_EVENTS (FS_OPEN_PERM | FS_ACCESS_PERM | \
FS_OPEN_EXEC_PERM)
diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h
index 2a1844edda47..615fa2c87179 100644
--- a/include/uapi/linux/fanotify.h
+++ b/include/uapi/linux/fanotify.h
@@ -24,6 +24,7 @@
#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
#define FAN_OPEN_EXEC_PERM 0x00040000 /* File open/exec in perm check */
+#define FAN_DIR_MODIFY 0x00080000 /* Directory entry was modified */
#define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */
--
2.17.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event
2020-02-17 13:14 [PATCH v2 00/16] Fanotify event with name info Amir Goldstein
2020-02-17 13:14 ` [PATCH v2 10/16] fanotify: send FAN_DIR_MODIFY event flavor with dir inode and name Amir Goldstein
@ 2020-02-17 13:14 ` Amir Goldstein
2020-02-19 9:43 ` kbuild test robot
` (3 more replies)
2020-02-17 13:14 ` [PATCH v2 14/16] fanotify: report parent fid + name with FAN_REPORT_NAME Amir Goldstein
` (2 subsequent siblings)
4 siblings, 4 replies; 13+ messages in thread
From: Amir Goldstein @ 2020-02-17 13:14 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-fsdevel, linux-api
Report event FAN_DIR_MODIFY with name in a variable length record similar
to how fid's are reported. With name info reporting implemented, setting
FAN_DIR_MODIFY in mark mask is now allowed.
When events are reported with name, the reported fid identifies the
directory and the name follows the fid. The info record type for this
event info is FAN_EVENT_INFO_TYPE_DFID_NAME.
For now, all reported events have at most one info record which is
either FAN_EVENT_INFO_TYPE_FID or FAN_EVENT_INFO_TYPE_DFID_NAME (for
FAN_DIR_MODIFY). Later on, events "on child" will report both records.
There are several ways that an application can use this information:
1. When watching a single directory, the name is always relative to
the watched directory, so application need to fstatat(2) the name
relative to the watched directory.
2. When watching a set of directories, the application could keep a map
of dirfd for all watched directories and hash the map by fid obtained
with name_to_handle_at(2). When getting a name event, the fid in the
event info could be used to lookup the base dirfd in the map and then
call fstatat(2) with that dirfd.
3. When watching a filesystem (FAN_MARK_FILESYSTEM) or a large set of
directories, the application could use open_by_handle_at(2) with the fid
in event info to obtain dirfd for the directory where event happened and
call fstatat(2) with this dirfd.
The last option scales better for a large number of watched directories.
The first two options may be available in the future also for non
privileged fanotify watchers, because open_by_handle_at(2) requires
the CAP_DAC_READ_SEARCH capability.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
fs/notify/fanotify/fanotify.c | 2 +-
fs/notify/fanotify/fanotify_user.c | 120 ++++++++++++++++++++++-------
include/linux/fanotify.h | 3 +-
include/uapi/linux/fanotify.h | 1 +
4 files changed, 98 insertions(+), 28 deletions(-)
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index fc75dc53a218..b651c18d3a93 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -478,7 +478,7 @@ static int fanotify_handle_event(struct fsnotify_group *group,
BUILD_BUG_ON(FAN_OPEN_EXEC != FS_OPEN_EXEC);
BUILD_BUG_ON(FAN_OPEN_EXEC_PERM != FS_OPEN_EXEC_PERM);
- BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 19);
+ BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 20);
mask = fanotify_group_event_mask(group, iter_info, mask, data,
data_type);
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 284f3548bb79..a1bafc21ebbb 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -51,20 +51,32 @@ struct kmem_cache *fanotify_name_event_cachep __read_mostly;
struct kmem_cache *fanotify_perm_event_cachep __read_mostly;
#define FANOTIFY_EVENT_ALIGN 4
+#define FANOTIFY_INFO_HDR_LEN \
+ (sizeof(struct fanotify_event_info_fid) + sizeof(struct file_handle))
-static int fanotify_fid_info_len(struct fanotify_fid_hdr *fh)
+static int fanotify_fid_info_len(int fh_len, int name_len)
{
- return roundup(sizeof(struct fanotify_event_info_fid) +
- sizeof(struct file_handle) + fh->len,
- FANOTIFY_EVENT_ALIGN);
+ int info_len = fh_len;
+
+ if (name_len)
+ info_len += name_len + 1;
+
+ return roundup(FANOTIFY_INFO_HDR_LEN + info_len, FANOTIFY_EVENT_ALIGN);
}
static int fanotify_event_info_len(struct fanotify_event *event)
{
- if (!fanotify_event_has_fid(event))
- return 0;
+ int info_len = 0;
+
+ if (fanotify_event_has_fid(event))
+ info_len += fanotify_fid_info_len(event->fh.len, 0);
+
+ if (fanotify_event_has_dfid_name(event)) {
+ info_len += fanotify_fid_info_len(event->dfh.len,
+ fanotify_event_name_len(event));
+ }
- return fanotify_fid_info_len(&event->fh);
+ return info_len;
}
/*
@@ -210,23 +222,34 @@ static int process_access_response(struct fsnotify_group *group,
return -ENOENT;
}
-static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
- struct fanotify_fid *fid, char __user *buf)
+static int copy_info_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
+ struct fanotify_fid *fid, const struct qstr *name,
+ char __user *buf, size_t count)
{
struct fanotify_event_info_fid info = { };
struct file_handle handle = { };
- unsigned char bounce[FANOTIFY_INLINE_FH_LEN], *data;
+ unsigned char bounce[max(FANOTIFY_INLINE_FH_LEN, DNAME_INLINE_LEN)];
+ const unsigned char *data;
size_t fh_len = fh->len;
- size_t len = fanotify_fid_info_len(fh);
+ size_t name_len = name ? name->len : 0;
+ size_t info_len = fanotify_fid_info_len(fh_len, name_len);
+ size_t len = info_len;
+
+ pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
+ __func__, fh_len, name_len, info_len, count);
- if (!len)
+ if (!fh_len || (name && !name_len))
return 0;
- if (WARN_ON_ONCE(len < sizeof(info) + sizeof(handle) + fh_len))
+ if (WARN_ON_ONCE(len < sizeof(info) || len > count))
return -EFAULT;
- /* Copy event info fid header followed by vaiable sized file handle */
- info.hdr.info_type = FAN_EVENT_INFO_TYPE_FID;
+ /*
+ * Copy event info fid header followed by vaiable sized file handle
+ * and optionally followed by vaiable sized filename.
+ */
+ info.hdr.info_type = name_len ? FAN_EVENT_INFO_TYPE_DFID_NAME :
+ FAN_EVENT_INFO_TYPE_FID;
info.hdr.len = len;
info.fsid = *fsid;
if (copy_to_user(buf, &info, sizeof(info)))
@@ -234,6 +257,9 @@ static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
buf += sizeof(info);
len -= sizeof(info);
+ if (WARN_ON_ONCE(len < sizeof(handle)))
+ return -EFAULT;
+
handle.handle_type = fh->type;
handle.handle_bytes = fh_len;
if (copy_to_user(buf, &handle, sizeof(handle)))
@@ -241,9 +267,12 @@ static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
buf += sizeof(handle);
len -= sizeof(handle);
+ if (WARN_ON_ONCE(len < fh_len))
+ return -EFAULT;
+
/*
- * For an inline fh, copy through stack to exclude the copy from
- * usercopy hardening protections.
+ * For an inline fh and inline file name, copy through stack to exclude
+ * the copy from usercopy hardening protections.
*/
data = fanotify_fid_fh(fid, fh_len);
if (fh_len <= FANOTIFY_INLINE_FH_LEN) {
@@ -253,14 +282,33 @@ static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
if (copy_to_user(buf, data, fh_len))
return -EFAULT;
- /* Pad with 0's */
buf += fh_len;
len -= fh_len;
+
+ if (name_len) {
+ /* Copy the filename with terminating null */
+ name_len++;
+ if (WARN_ON_ONCE(len < name_len))
+ return -EFAULT;
+
+ data = name->name;
+ if (name_len <= DNAME_INLINE_LEN) {
+ memcpy(bounce, data, name_len);
+ data = bounce;
+ }
+ if (copy_to_user(buf, data, name_len))
+ return -EFAULT;
+
+ buf += name_len;
+ len -= name_len;
+ }
+
+ /* Pad with 0's */
WARN_ON_ONCE(len < 0 || len >= FANOTIFY_EVENT_ALIGN);
if (len > 0 && clear_user(buf, len))
return -EFAULT;
- return 0;
+ return info_len;
}
static ssize_t copy_event_to_user(struct fsnotify_group *group,
@@ -282,12 +330,12 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
metadata.mask = event->mask & FANOTIFY_OUTGOING_EVENTS;
metadata.pid = pid_vnr(event->pid);
- if (fanotify_event_has_path(event)) {
+ if (FAN_GROUP_FLAG(group, FAN_REPORT_FID)) {
+ metadata.event_len += fanotify_event_info_len(event);
+ } else if (fanotify_event_has_path(event)) {
fd = create_fd(group, event, &f);
if (fd < 0)
return fd;
- } else if (fanotify_event_has_fid(event)) {
- metadata.event_len += fanotify_event_info_len(event);
}
metadata.fd = fd;
@@ -302,16 +350,36 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
if (copy_to_user(buf, &metadata, FAN_EVENT_METADATA_LEN))
goto out_close_fd;
+ buf += FAN_EVENT_METADATA_LEN;
+ count -= FAN_EVENT_METADATA_LEN;
+
if (fanotify_is_perm_event(event->mask))
FANOTIFY_PE(fsn_event)->fd = fd;
- if (fanotify_event_has_path(event)) {
+ if (f)
fd_install(fd, f);
- } else if (fanotify_event_has_fid(event)) {
- ret = copy_fid_to_user(&event->fsid, &event->fh, &event->fid,
- buf + FAN_EVENT_METADATA_LEN);
+
+ /* Event info records order is: dir fid + name, child fid */
+ if (fanotify_event_has_dfid_name(event)) {
+ struct fanotify_name_event *fne = FANOTIFY_NE(fsn_event);
+
+ ret = copy_info_to_user(&event->fsid, &event->dfh, &fne->dfid,
+ &fne->name, buf, count);
if (ret < 0)
return ret;
+
+ buf += ret;
+ count -= ret;
+ }
+
+ if (fanotify_event_has_fid(event)) {
+ ret = copy_info_to_user(&event->fsid, &event->fh, &event->fid,
+ NULL, buf, count);
+ if (ret < 0)
+ return ret;
+
+ buf += ret;
+ count -= ret;
}
return metadata.event_len;
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index b79fa9bb7359..3049a6c06d9e 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -47,7 +47,8 @@
* Directory entry modification events - reported only to directory
* where entry is modified and not to a watching parent.
*/
-#define FANOTIFY_DIRENT_EVENTS (FAN_MOVE | FAN_CREATE | FAN_DELETE)
+#define FANOTIFY_DIRENT_EVENTS (FAN_MOVE | FAN_CREATE | FAN_DELETE | \
+ FAN_DIR_MODIFY)
/* Events that can only be reported with data type FSNOTIFY_EVENT_INODE */
#define FANOTIFY_INODE_EVENTS (FANOTIFY_DIRENT_EVENTS | \
diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h
index 615fa2c87179..2b56e194b858 100644
--- a/include/uapi/linux/fanotify.h
+++ b/include/uapi/linux/fanotify.h
@@ -117,6 +117,7 @@ struct fanotify_event_metadata {
};
#define FAN_EVENT_INFO_TYPE_FID 1
+#define FAN_EVENT_INFO_TYPE_DFID_NAME 2
/* Variable length info record following event metadata */
struct fanotify_event_info_header {
--
2.17.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 14/16] fanotify: report parent fid + name with FAN_REPORT_NAME
2020-02-17 13:14 [PATCH v2 00/16] Fanotify event with name info Amir Goldstein
2020-02-17 13:14 ` [PATCH v2 10/16] fanotify: send FAN_DIR_MODIFY event flavor with dir inode and name Amir Goldstein
2020-02-17 13:14 ` [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event Amir Goldstein
@ 2020-02-17 13:14 ` Amir Goldstein
2020-02-17 13:14 ` [BONUS][PATCH v2 16/16] fanotify: support limited functionality for unprivileged users Amir Goldstein
2020-02-20 22:10 ` [PATCH v2 00/16] Fanotify event with name info Matthew Bobrowski
4 siblings, 0 replies; 13+ messages in thread
From: Amir Goldstein @ 2020-02-17 13:14 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-fsdevel, linux-api
For a group with fanotify_init() flag FAN_REPORT_NAME, we report the
parent fid and name for events possible "on child" (e.g. FAN_MODIFY)
in addition to reporting the child fid.
The flag FAN_REPORT_NAME requires the flag FAN_REPORT_FID and there is
a constant for setting both flags named FAN_REPORT_FID_NAME.
The parent fid and name are reported with an info record of type
FAN_EVENT_INFO_TYPE_DFID_NAME, similar to the way that name info is
reported for FAN_DIR_MODIFY events.
The child fid is reported with another info record of type
FAN_EVENT_INFO_TYPE_FID that follows the first info record, with the
same fid info that is reported to a group with FAN_REPORT_FID flag.
Events with name are reported the same way when reported to sb, mount
or inode marks and when reported to a directory watching children.
Events not possible "on child" (e.g. FAN_DELETE_SELF) are reported
with a single FAN_EVENT_INFO_TYPE_FID record, same as they are reported
to a group with FAN_REPORT_FID flag.
If parent is unknown (dentry is disconnected) or parent is not on the
same filesystem as child (dentry is sb root), event is also reported
with a single FAN_EVENT_INFO_TYPE_FID record.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
fs/notify/fanotify/fanotify.c | 25 +++++++++++++++++++++++--
fs/notify/fanotify/fanotify_user.c | 6 +++++-
include/linux/fanotify.h | 2 +-
include/uapi/linux/fanotify.h | 4 ++++
4 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index b651c18d3a93..43c338a8a2f1 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -302,6 +302,8 @@ struct fanotify_event *fanotify_alloc_event(struct fsnotify_group *group,
struct inode *id = fanotify_fid_inode(inode, mask, data, data_type);
const struct path *path = fsnotify_data_path(data, data_type);
struct dentry *dentry = fsnotify_data_dentry(data, data_type);
+ struct dentry *parent = NULL;
+ struct name_snapshot child_name;
struct inode *dir = NULL;
/*
@@ -339,17 +341,32 @@ struct fanotify_event *fanotify_alloc_event(struct fsnotify_group *group,
/*
* For FAN_DIR_MODIFY event, we report the fid of the directory and
* the name of the modified entry.
+ * With flag FAN_REPORT_NAME, we report the parent fid and name for
+ * events possible "on child" in addition to reporting the child fid.
+ * If parent is unknown (dentry is disconnected) or parent is not on the
+ * same filesystem as child (dentry is sb root), only "child" fid is
+ * reported. Events are reported the same way when reported to sb, mount
+ * or inode marks and when reported to a directory watching children.
* Allocate an fanotify_name_event struct and copy the name.
*/
if (mask & FAN_DIR_MODIFY && !(WARN_ON_ONCE(!file_name))) {
- char *name = NULL;
-
/*
* Make sure that fanotify_event_has_name() is true and that
* fanotify_event_has_fid() is false for FAN_DIR_MODIFY events.
*/
id = NULL;
dir = inode;
+ } else if (FAN_GROUP_FLAG(group, FAN_REPORT_NAME) &&
+ mask & FS_EVENTS_POSS_ON_CHILD &&
+ likely(dentry && !IS_ROOT(dentry))) {
+ parent = dget_parent(dentry);
+ dir = d_inode(parent);
+ take_dentry_name_snapshot(&child_name, dentry);
+ file_name = &child_name.name;
+ }
+ if (dir) {
+ char *name = NULL;
+
if (file_name->len + 1 > FANOTIFY_INLINE_NAME_LEN) {
name = kmalloc(file_name->len + 1, gfp);
if (!name)
@@ -409,6 +426,10 @@ struct fanotify_event *fanotify_alloc_event(struct fsnotify_group *group,
event->path.dentry = NULL;
}
out:
+ if (parent) {
+ dput(parent);
+ release_dentry_name_snapshot(&child_name);
+ }
memalloc_unuse_memcg();
return event;
}
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index a1bafc21ebbb..5d369aa5d1bc 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -875,6 +875,10 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
(flags & FANOTIFY_CLASS_BITS) != FAN_CLASS_NOTIF)
return -EINVAL;
+ /* Child name is reported with partent fid */
+ if ((flags & FAN_REPORT_NAME) && !(flags & FAN_REPORT_FID))
+ return -EINVAL;
+
user = get_current_user();
if (atomic_read(&user->fanotify_listeners) > FANOTIFY_DEFAULT_MAX_LISTENERS) {
free_uid(user);
@@ -1210,7 +1214,7 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark,
*/
static int __init fanotify_user_setup(void)
{
- BUILD_BUG_ON(HWEIGHT32(FANOTIFY_INIT_FLAGS) != 8);
+ BUILD_BUG_ON(HWEIGHT32(FANOTIFY_INIT_FLAGS) != 9);
BUILD_BUG_ON(HWEIGHT32(FANOTIFY_MARK_FLAGS) != 9);
fanotify_mark_cache = KMEM_CACHE(fsnotify_mark,
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index 3049a6c06d9e..5412a25c54c0 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -19,7 +19,7 @@
FAN_CLASS_PRE_CONTENT)
#define FANOTIFY_INIT_FLAGS (FANOTIFY_CLASS_BITS | \
- FAN_REPORT_TID | FAN_REPORT_FID | \
+ FAN_REPORT_TID | FAN_REPORT_FID_NAME | \
FAN_CLOEXEC | FAN_NONBLOCK | \
FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS)
diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h
index 2b56e194b858..04181769bb50 100644
--- a/include/uapi/linux/fanotify.h
+++ b/include/uapi/linux/fanotify.h
@@ -54,6 +54,10 @@
/* Flags to determine fanotify event format */
#define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */
#define FAN_REPORT_FID 0x00000200 /* Report unique file id */
+#define FAN_REPORT_NAME 0x00000400 /* Report events with name */
+
+/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_FID */
+#define FAN_REPORT_FID_NAME (FAN_REPORT_FID | FAN_REPORT_NAME)
/* Deprecated - do not use this in programs and do not add new flags here! */
#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
--
2.17.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [BONUS][PATCH v2 16/16] fanotify: support limited functionality for unprivileged users
2020-02-17 13:14 [PATCH v2 00/16] Fanotify event with name info Amir Goldstein
` (2 preceding siblings ...)
2020-02-17 13:14 ` [PATCH v2 14/16] fanotify: report parent fid + name with FAN_REPORT_NAME Amir Goldstein
@ 2020-02-17 13:14 ` Amir Goldstein
2020-02-20 22:10 ` [PATCH v2 00/16] Fanotify event with name info Matthew Bobrowski
4 siblings, 0 replies; 13+ messages in thread
From: Amir Goldstein @ 2020-02-17 13:14 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-fsdevel, linux-api, Matthew Bobrowski
Add support for new fanotify_init() flag FAN_UNPRIVILEGED.
User may request an unprivileged event listener using this flag even if
user is privileged.
An unprivileged event listener does not get an open file descriptor in
the event nor the process pid of another process. An unprivileged event
listener cannot request permission events, cannot set mount/filesystem
marks and cannot request unlimited queue/marks.
This enables the limited functionality similar to inotify when watching a
set of files and directories for OPEN/ACCESS/MODIFY/CLOSE events, without
requiring SYS_CAP_ADMIN privileges.
The FAN_DIR_MODIFY event and FAN_REPORT_FID_NAME init flag, provide a
method for an unprivileged event listener watching a set of directories
(with FAN_EVENT_ON_CHILD) to monitor all changes inside those directories.
This typically requires that the listener keeps a map of watched
directory fid to dirfd (O_PATH), where fid is obtained with
name_to_handle_at() before starting to watch for changes.
When getting an event, the reported fid of the parent should be resolved
to dirfd and fstatsat(2) with dirfd and name should be used to query the
state of the filesystem entry.
Note that even though events do not report the event creator pid,
fanotify does not merge similar events on the same object that were
generated by different processes. This is aligned with exiting behavior
when generating processes are outside of the listener pidns (which
results in reporting 0 pid to listener).
Cc: <linux-api@vger.kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
fs/notify/fanotify/fanotify_user.c | 42 ++++++++++++++++++++++++++----
include/linux/fanotify.h | 16 +++++++++++-
include/uapi/linux/fanotify.h | 1 +
3 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 5d369aa5d1bc..ac2cdb5287fe 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -328,11 +328,21 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
metadata.vers = FANOTIFY_METADATA_VERSION;
metadata.reserved = 0;
metadata.mask = event->mask & FANOTIFY_OUTGOING_EVENTS;
- metadata.pid = pid_vnr(event->pid);
+ /*
+ * An unprivileged event listener does not get an open file descriptor
+ * in the event nor another generating process pid. If the event was
+ * generated by the unprivileged process itself, self pid is reported.
+ */
+ if (!FAN_GROUP_FLAG(group, FAN_UNPRIVILEGED) ||
+ task_tgid(current) == event->pid)
+ metadata.pid = pid_vnr(event->pid);
+ else
+ metadata.pid = 0;
if (FAN_GROUP_FLAG(group, FAN_REPORT_FID)) {
metadata.event_len += fanotify_event_info_len(event);
- } else if (fanotify_event_has_path(event)) {
+ } else if (!FAN_GROUP_FLAG(group, FAN_UNPRIVILEGED) &&
+ fanotify_event_has_path(event)) {
fd = create_fd(group, event, &f);
if (fd < 0)
return fd;
@@ -845,12 +855,26 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
int f_flags, fd;
struct user_struct *user;
struct fanotify_event *oevent;
+ unsigned int class = flags & FANOTIFY_CLASS_BITS;
pr_debug("%s: flags=%x event_f_flags=%x\n",
__func__, flags, event_f_flags);
- if (!capable(CAP_SYS_ADMIN))
+ if (flags & FAN_UNPRIVILEGED) {
+ /*
+ * User can request an unprivileged event listener even if
+ * user is privileged. An unprivileged event listener does not
+ * get an open file descriptor in the event nor the proccess id
+ * of another process. An unprivileged event listener and cannot
+ * request permission events, cannot set mount/filesystem marks
+ * and cannot request unlimited queue/marks.
+ */
+ if ((flags & ~FANOTIFY_UNPRIV_INIT_FLAGS) ||
+ class != FAN_CLASS_NOTIF)
+ return -EINVAL;
+ } else if (!capable(CAP_SYS_ADMIN)) {
return -EPERM;
+ }
#ifdef CONFIG_AUDITSYSCALL
if (flags & ~(FANOTIFY_INIT_FLAGS | FAN_ENABLE_AUDIT))
@@ -916,7 +940,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
group->fanotify_data.f_flags = event_f_flags;
init_waitqueue_head(&group->fanotify_data.access_waitq);
INIT_LIST_HEAD(&group->fanotify_data.access_list);
- switch (flags & FANOTIFY_CLASS_BITS) {
+ switch (class) {
case FAN_CLASS_NOTIF:
group->priority = FS_PRIO_0;
break;
@@ -1101,6 +1125,14 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
group->priority == FS_PRIO_0)
goto fput_and_out;
+ /*
+ * An unprivileged event listener is not allowed to watch a mount
+ * point nor a filesystem.
+ */
+ if (FAN_GROUP_FLAG(group, FAN_UNPRIVILEGED) &&
+ mark_type != FAN_MARK_INODE)
+ goto fput_and_out;
+
/*
* Events with data type inode do not carry enough information to report
* event->fd, so we do not allow setting a mask for inode events unless
@@ -1214,7 +1246,7 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark,
*/
static int __init fanotify_user_setup(void)
{
- BUILD_BUG_ON(HWEIGHT32(FANOTIFY_INIT_FLAGS) != 9);
+ BUILD_BUG_ON(HWEIGHT32(FANOTIFY_INIT_FLAGS) != 10);
BUILD_BUG_ON(HWEIGHT32(FANOTIFY_MARK_FLAGS) != 9);
fanotify_mark_cache = KMEM_CACHE(fsnotify_mark,
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index 5412a25c54c0..93107b44e4e1 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -21,7 +21,21 @@
#define FANOTIFY_INIT_FLAGS (FANOTIFY_CLASS_BITS | \
FAN_REPORT_TID | FAN_REPORT_FID_NAME | \
FAN_CLOEXEC | FAN_NONBLOCK | \
- FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS)
+ FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS | \
+ FAN_UNPRIVILEGED)
+
+/*
+ * fanotify_init() flags allowed for unprivileged listener.
+ * FAN_CLASS_NOTIF in this mask is purely semantic because it is zero,
+ * but it is the only class we allow for unprivileged listener.
+ * Since unprivileged listener does not provide file descriptors in events,
+ * FAN_REPORT_FID_NAME makes sense, but it is not a must.
+ * FAN_REPORT_TID does not make sense for unprivileged listener, which uses
+ * event->pid only to filter out events generated by listener process itself.
+ */
+#define FANOTIFY_UNPRIV_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
+ FAN_CLASS_NOTIF | FAN_UNPRIVILEGED | \
+ FAN_REPORT_FID_NAME)
#define FANOTIFY_MARK_TYPE_BITS (FAN_MARK_INODE | FAN_MARK_MOUNT | \
FAN_MARK_FILESYSTEM)
diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h
index 04181769bb50..2be673862a43 100644
--- a/include/uapi/linux/fanotify.h
+++ b/include/uapi/linux/fanotify.h
@@ -50,6 +50,7 @@
#define FAN_UNLIMITED_QUEUE 0x00000010
#define FAN_UNLIMITED_MARKS 0x00000020
#define FAN_ENABLE_AUDIT 0x00000040
+#define FAN_UNPRIVILEGED 0x00000080
/* Flags to determine fanotify event format */
#define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */
--
2.17.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event
2020-02-17 13:14 ` [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event Amir Goldstein
@ 2020-02-19 9:43 ` kbuild test robot
2020-02-19 10:17 ` kbuild test robot
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: kbuild test robot @ 2020-02-19 9:43 UTC (permalink / raw)
To: Amir Goldstein; +Cc: kbuild-all, Jan Kara, linux-fsdevel, linux-api
[-- Attachment #1: Type: text/plain, Size: 8632 bytes --]
Hi Amir,
I love your patch! Perhaps something to improve:
[auto build test WARNING on 11a48a5a18c63fd7621bb050228cebf13566e4d8]
url: https://github.com/0day-ci/linux/commits/Amir-Goldstein/Fanotify-event-with-name-info/20200219-160517
base: 11a48a5a18c63fd7621bb050228cebf13566e4d8
config: c6x-randconfig-a001-20200219 (attached as .config)
compiler: c6x-elf-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=c6x
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify/fanotify/fanotify_user.c:3:
fs/notify/fanotify/fanotify_user.c: In function 'copy_info_to_user':
>> fs/notify/fanotify/fanotify_user.c:238:11: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^
include/linux/printk.h:288:21: note: in definition of macro 'pr_fmt'
#define pr_fmt(fmt) fmt
^~~
include/linux/dynamic_debug.h:143:2: note: in expansion of macro '__dynamic_func_call'
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:153:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt, __dynamic_pr_debug, \
^~~~~~~~~~~~~~~~~~
include/linux/printk.h:335:2: note: in expansion of macro 'dynamic_pr_debug'
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:11: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^
include/linux/printk.h:288:21: note: in definition of macro 'pr_fmt'
#define pr_fmt(fmt) fmt
^~~
include/linux/dynamic_debug.h:143:2: note: in expansion of macro '__dynamic_func_call'
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:153:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt, __dynamic_pr_debug, \
^~~~~~~~~~~~~~~~~~
include/linux/printk.h:335:2: note: in expansion of macro 'dynamic_pr_debug'
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:11: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t {aka unsigned int}' [-Wformat=]
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^
include/linux/printk.h:288:21: note: in definition of macro 'pr_fmt'
#define pr_fmt(fmt) fmt
^~~
include/linux/dynamic_debug.h:143:2: note: in expansion of macro '__dynamic_func_call'
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:153:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt, __dynamic_pr_debug, \
^~~~~~~~~~~~~~~~~~
include/linux/printk.h:335:2: note: in expansion of macro 'dynamic_pr_debug'
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:11: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'size_t {aka unsigned int}' [-Wformat=]
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^
include/linux/printk.h:288:21: note: in definition of macro 'pr_fmt'
#define pr_fmt(fmt) fmt
^~~
include/linux/dynamic_debug.h:143:2: note: in expansion of macro '__dynamic_func_call'
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:153:2: note: in expansion of macro '_dynamic_func_call'
_dynamic_func_call(fmt, __dynamic_pr_debug, \
^~~~~~~~~~~~~~~~~~
include/linux/printk.h:335:2: note: in expansion of macro 'dynamic_pr_debug'
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
vim +238 fs/notify/fanotify/fanotify_user.c
224
225 static int copy_info_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
226 struct fanotify_fid *fid, const struct qstr *name,
227 char __user *buf, size_t count)
228 {
229 struct fanotify_event_info_fid info = { };
230 struct file_handle handle = { };
231 unsigned char bounce[max(FANOTIFY_INLINE_FH_LEN, DNAME_INLINE_LEN)];
232 const unsigned char *data;
233 size_t fh_len = fh->len;
234 size_t name_len = name ? name->len : 0;
235 size_t info_len = fanotify_fid_info_len(fh_len, name_len);
236 size_t len = info_len;
237
> 238 pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
239 __func__, fh_len, name_len, info_len, count);
240
241 if (!fh_len || (name && !name_len))
242 return 0;
243
244 if (WARN_ON_ONCE(len < sizeof(info) || len > count))
245 return -EFAULT;
246
247 /*
248 * Copy event info fid header followed by vaiable sized file handle
249 * and optionally followed by vaiable sized filename.
250 */
251 info.hdr.info_type = name_len ? FAN_EVENT_INFO_TYPE_DFID_NAME :
252 FAN_EVENT_INFO_TYPE_FID;
253 info.hdr.len = len;
254 info.fsid = *fsid;
255 if (copy_to_user(buf, &info, sizeof(info)))
256 return -EFAULT;
257
258 buf += sizeof(info);
259 len -= sizeof(info);
260 if (WARN_ON_ONCE(len < sizeof(handle)))
261 return -EFAULT;
262
263 handle.handle_type = fh->type;
264 handle.handle_bytes = fh_len;
265 if (copy_to_user(buf, &handle, sizeof(handle)))
266 return -EFAULT;
267
268 buf += sizeof(handle);
269 len -= sizeof(handle);
270 if (WARN_ON_ONCE(len < fh_len))
271 return -EFAULT;
272
273 /*
274 * For an inline fh and inline file name, copy through stack to exclude
275 * the copy from usercopy hardening protections.
276 */
277 data = fanotify_fid_fh(fid, fh_len);
278 if (fh_len <= FANOTIFY_INLINE_FH_LEN) {
279 memcpy(bounce, data, fh_len);
280 data = bounce;
281 }
282 if (copy_to_user(buf, data, fh_len))
283 return -EFAULT;
284
285 buf += fh_len;
286 len -= fh_len;
287
288 if (name_len) {
289 /* Copy the filename with terminating null */
290 name_len++;
291 if (WARN_ON_ONCE(len < name_len))
292 return -EFAULT;
293
294 data = name->name;
295 if (name_len <= DNAME_INLINE_LEN) {
296 memcpy(bounce, data, name_len);
297 data = bounce;
298 }
299 if (copy_to_user(buf, data, name_len))
300 return -EFAULT;
301
302 buf += name_len;
303 len -= name_len;
304 }
305
306 /* Pad with 0's */
307 WARN_ON_ONCE(len < 0 || len >= FANOTIFY_EVENT_ALIGN);
308 if (len > 0 && clear_user(buf, len))
309 return -EFAULT;
310
311 return info_len;
312 }
313
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28991 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event
2020-02-17 13:14 ` [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event Amir Goldstein
2020-02-19 9:43 ` kbuild test robot
@ 2020-02-19 10:17 ` kbuild test robot
2020-02-19 11:22 ` Amir Goldstein
2020-04-16 12:16 ` Michael Kerrisk (man-pages)
3 siblings, 0 replies; 13+ messages in thread
From: kbuild test robot @ 2020-02-19 10:17 UTC (permalink / raw)
To: Amir Goldstein; +Cc: kbuild-all, Jan Kara, linux-fsdevel, linux-api
[-- Attachment #1: Type: text/plain, Size: 14178 bytes --]
Hi Amir,
I love your patch! Perhaps something to improve:
[auto build test WARNING on 11a48a5a18c63fd7621bb050228cebf13566e4d8]
url: https://github.com/0day-ci/linux/commits/Amir-Goldstein/Fanotify-event-with-name-info/20200219-160517
base: 11a48a5a18c63fd7621bb050228cebf13566e4d8
config: microblaze-randconfig-a001-20200219 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify/fanotify/fanotify_user.c:3:
fs/notify/fanotify/fanotify_user.c: In function 'copy_info_to_user':
>> include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:137:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:25: note: format string is defined here
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
~~^
%u
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify/fanotify/fanotify_user.c:3:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:137:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:38: note: format string is defined here
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
~~^
%u
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify/fanotify/fanotify_user.c:3:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:137:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:52: note: format string is defined here
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
~~^
%u
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify/fanotify/fanotify_user.c:3:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:137:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify/fanotify/fanotify_user.c:238:63: note: format string is defined here
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
--
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify//fanotify/fanotify_user.c:3:
fs/notify//fanotify/fanotify_user.c: In function 'copy_info_to_user':
>> include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:137:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/notify//fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify//fanotify/fanotify_user.c:238:25: note: format string is defined here
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
~~^
%u
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify//fanotify/fanotify_user.c:3:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:137:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/notify//fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify//fanotify/fanotify_user.c:238:38: note: format string is defined here
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
~~^
%u
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify//fanotify/fanotify_user.c:3:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:137:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/notify//fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify//fanotify/fanotify_user.c:238:52: note: format string is defined here
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
~~^
%u
In file included from include/linux/kernel.h:15:0,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/fcntl.h:5,
from fs/notify//fanotify/fanotify_user.c:3:
include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:137:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:341:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/notify//fanotify/fanotify_user.c:238:2: note: in expansion of macro 'pr_debug'
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
^~~~~~~~
fs/notify//fanotify/fanotify_user.c:238:63: note: format string is defined here
pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
vim +5 include/linux/kern_levels.h
314ba3520e513a Joe Perches 2012-07-30 4
04d2c8c83d0e3a Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'
04d2c8c83d0e3a Joe Perches 2012-07-30 7
:::::: The code at line 5 was first introduced by commit
:::::: 04d2c8c83d0e3ac5f78aeede51babb3236200112 printk: convert the format for KERN_<LEVEL> to a 2 byte pattern
:::::: TO: Joe Perches <joe@perches.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38740 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event
2020-02-17 13:14 ` [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event Amir Goldstein
2020-02-19 9:43 ` kbuild test robot
2020-02-19 10:17 ` kbuild test robot
@ 2020-02-19 11:22 ` Amir Goldstein
2020-04-16 12:16 ` Michael Kerrisk (man-pages)
3 siblings, 0 replies; 13+ messages in thread
From: Amir Goldstein @ 2020-02-19 11:22 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-fsdevel, Linux API
On Mon, Feb 17, 2020 at 3:15 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> Report event FAN_DIR_MODIFY with name in a variable length record similar
> to how fid's are reported. With name info reporting implemented, setting
> FAN_DIR_MODIFY in mark mask is now allowed.
>
> When events are reported with name, the reported fid identifies the
> directory and the name follows the fid. The info record type for this
> event info is FAN_EVENT_INFO_TYPE_DFID_NAME.
>
> For now, all reported events have at most one info record which is
> either FAN_EVENT_INFO_TYPE_FID or FAN_EVENT_INFO_TYPE_DFID_NAME (for
> FAN_DIR_MODIFY). Later on, events "on child" will report both records.
>
> There are several ways that an application can use this information:
>
> 1. When watching a single directory, the name is always relative to
> the watched directory, so application need to fstatat(2) the name
> relative to the watched directory.
>
> 2. When watching a set of directories, the application could keep a map
> of dirfd for all watched directories and hash the map by fid obtained
> with name_to_handle_at(2). When getting a name event, the fid in the
> event info could be used to lookup the base dirfd in the map and then
> call fstatat(2) with that dirfd.
>
> 3. When watching a filesystem (FAN_MARK_FILESYSTEM) or a large set of
> directories, the application could use open_by_handle_at(2) with the fid
> in event info to obtain dirfd for the directory where event happened and
> call fstatat(2) with this dirfd.
>
> The last option scales better for a large number of watched directories.
> The first two options may be available in the future also for non
> privileged fanotify watchers, because open_by_handle_at(2) requires
> the CAP_DAC_READ_SEARCH capability.
>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
> fs/notify/fanotify/fanotify.c | 2 +-
> fs/notify/fanotify/fanotify_user.c | 120 ++++++++++++++++++++++-------
> include/linux/fanotify.h | 3 +-
> include/uapi/linux/fanotify.h | 1 +
> 4 files changed, 98 insertions(+), 28 deletions(-)
>
> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
> index fc75dc53a218..b651c18d3a93 100644
> --- a/fs/notify/fanotify/fanotify.c
> +++ b/fs/notify/fanotify/fanotify.c
> @@ -478,7 +478,7 @@ static int fanotify_handle_event(struct fsnotify_group *group,
> BUILD_BUG_ON(FAN_OPEN_EXEC != FS_OPEN_EXEC);
> BUILD_BUG_ON(FAN_OPEN_EXEC_PERM != FS_OPEN_EXEC_PERM);
>
> - BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 19);
> + BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 20);
>
> mask = fanotify_group_event_mask(group, iter_info, mask, data,
> data_type);
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index 284f3548bb79..a1bafc21ebbb 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -51,20 +51,32 @@ struct kmem_cache *fanotify_name_event_cachep __read_mostly;
> struct kmem_cache *fanotify_perm_event_cachep __read_mostly;
>
> #define FANOTIFY_EVENT_ALIGN 4
> +#define FANOTIFY_INFO_HDR_LEN \
> + (sizeof(struct fanotify_event_info_fid) + sizeof(struct file_handle))
>
> -static int fanotify_fid_info_len(struct fanotify_fid_hdr *fh)
> +static int fanotify_fid_info_len(int fh_len, int name_len)
> {
> - return roundup(sizeof(struct fanotify_event_info_fid) +
> - sizeof(struct file_handle) + fh->len,
> - FANOTIFY_EVENT_ALIGN);
> + int info_len = fh_len;
> +
> + if (name_len)
> + info_len += name_len + 1;
> +
> + return roundup(FANOTIFY_INFO_HDR_LEN + info_len, FANOTIFY_EVENT_ALIGN);
> }
>
> static int fanotify_event_info_len(struct fanotify_event *event)
> {
> - if (!fanotify_event_has_fid(event))
> - return 0;
> + int info_len = 0;
> +
> + if (fanotify_event_has_fid(event))
> + info_len += fanotify_fid_info_len(event->fh.len, 0);
> +
> + if (fanotify_event_has_dfid_name(event)) {
> + info_len += fanotify_fid_info_len(event->dfh.len,
> + fanotify_event_name_len(event));
> + }
>
> - return fanotify_fid_info_len(&event->fh);
> + return info_len;
> }
>
> /*
> @@ -210,23 +222,34 @@ static int process_access_response(struct fsnotify_group *group,
> return -ENOENT;
> }
>
> -static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
> - struct fanotify_fid *fid, char __user *buf)
> +static int copy_info_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
> + struct fanotify_fid *fid, const struct qstr *name,
> + char __user *buf, size_t count)
> {
> struct fanotify_event_info_fid info = { };
> struct file_handle handle = { };
> - unsigned char bounce[FANOTIFY_INLINE_FH_LEN], *data;
> + unsigned char bounce[max(FANOTIFY_INLINE_FH_LEN, DNAME_INLINE_LEN)];
> + const unsigned char *data;
> size_t fh_len = fh->len;
> - size_t len = fanotify_fid_info_len(fh);
> + size_t name_len = name ? name->len : 0;
> + size_t info_len = fanotify_fid_info_len(fh_len, name_len);
> + size_t len = info_len;
> +
> + pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
> + __func__, fh_len, name_len, info_len, count);
>
Changed all %lu above to %zu to print size_t without a warning.
Thanks kbuild test robot,
Amir.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 00/16] Fanotify event with name info
2020-02-17 13:14 [PATCH v2 00/16] Fanotify event with name info Amir Goldstein
` (3 preceding siblings ...)
2020-02-17 13:14 ` [BONUS][PATCH v2 16/16] fanotify: support limited functionality for unprivileged users Amir Goldstein
@ 2020-02-20 22:10 ` Matthew Bobrowski
4 siblings, 0 replies; 13+ messages in thread
From: Matthew Bobrowski @ 2020-02-20 22:10 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Jan Kara, linux-fsdevel, linux-api
On Mon, Feb 17, 2020 at 03:14:39PM +0200, Amir Goldstein wrote:
> This is v2 of the fanotify name info series.
>
> The user requirement for the name info feature, as well as early UAPI
> discussions can be found in this [1] lore thread.
Oh, wonderful. I'm keen to have this feature come to fruition.
After my wedding, which is this Saturday (tomorrow), I'll come around
to reviewing this series.
/M
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event
2020-02-17 13:14 ` [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event Amir Goldstein
` (2 preceding siblings ...)
2020-02-19 11:22 ` Amir Goldstein
@ 2020-04-16 12:16 ` Michael Kerrisk (man-pages)
2020-04-20 15:53 ` Jan Kara
2020-04-20 18:45 ` Amir Goldstein
3 siblings, 2 replies; 13+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-04-16 12:16 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Jan Kara, linux-fsdevel, Linux API, Michael Kerrisk
Hello Amir,
On Mon, 17 Feb 2020 at 15:10, Amir Goldstein <amir73il@gmail.com> wrote:
>
> Report event FAN_DIR_MODIFY with name in a variable length record similar
> to how fid's are reported. With name info reporting implemented, setting
> FAN_DIR_MODIFY in mark mask is now allowed.
I see this was merged for 5.7. Would you be able to send a man-pages
patch that documents this new feature please.
Cheers,
Michael
>
> When events are reported with name, the reported fid identifies the
> directory and the name follows the fid. The info record type for this
> event info is FAN_EVENT_INFO_TYPE_DFID_NAME.
>
> For now, all reported events have at most one info record which is
> either FAN_EVENT_INFO_TYPE_FID or FAN_EVENT_INFO_TYPE_DFID_NAME (for
> FAN_DIR_MODIFY). Later on, events "on child" will report both records.
>
> There are several ways that an application can use this information:
>
> 1. When watching a single directory, the name is always relative to
> the watched directory, so application need to fstatat(2) the name
> relative to the watched directory.
>
> 2. When watching a set of directories, the application could keep a map
> of dirfd for all watched directories and hash the map by fid obtained
> with name_to_handle_at(2). When getting a name event, the fid in the
> event info could be used to lookup the base dirfd in the map and then
> call fstatat(2) with that dirfd.
>
> 3. When watching a filesystem (FAN_MARK_FILESYSTEM) or a large set of
> directories, the application could use open_by_handle_at(2) with the fid
> in event info to obtain dirfd for the directory where event happened and
> call fstatat(2) with this dirfd.
>
> The last option scales better for a large number of watched directories.
> The first two options may be available in the future also for non
> privileged fanotify watchers, because open_by_handle_at(2) requires
> the CAP_DAC_READ_SEARCH capability.
>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
> fs/notify/fanotify/fanotify.c | 2 +-
> fs/notify/fanotify/fanotify_user.c | 120 ++++++++++++++++++++++-------
> include/linux/fanotify.h | 3 +-
> include/uapi/linux/fanotify.h | 1 +
> 4 files changed, 98 insertions(+), 28 deletions(-)
>
> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
> index fc75dc53a218..b651c18d3a93 100644
> --- a/fs/notify/fanotify/fanotify.c
> +++ b/fs/notify/fanotify/fanotify.c
> @@ -478,7 +478,7 @@ static int fanotify_handle_event(struct fsnotify_group *group,
> BUILD_BUG_ON(FAN_OPEN_EXEC != FS_OPEN_EXEC);
> BUILD_BUG_ON(FAN_OPEN_EXEC_PERM != FS_OPEN_EXEC_PERM);
>
> - BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 19);
> + BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 20);
>
> mask = fanotify_group_event_mask(group, iter_info, mask, data,
> data_type);
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index 284f3548bb79..a1bafc21ebbb 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -51,20 +51,32 @@ struct kmem_cache *fanotify_name_event_cachep __read_mostly;
> struct kmem_cache *fanotify_perm_event_cachep __read_mostly;
>
> #define FANOTIFY_EVENT_ALIGN 4
> +#define FANOTIFY_INFO_HDR_LEN \
> + (sizeof(struct fanotify_event_info_fid) + sizeof(struct file_handle))
>
> -static int fanotify_fid_info_len(struct fanotify_fid_hdr *fh)
> +static int fanotify_fid_info_len(int fh_len, int name_len)
> {
> - return roundup(sizeof(struct fanotify_event_info_fid) +
> - sizeof(struct file_handle) + fh->len,
> - FANOTIFY_EVENT_ALIGN);
> + int info_len = fh_len;
> +
> + if (name_len)
> + info_len += name_len + 1;
> +
> + return roundup(FANOTIFY_INFO_HDR_LEN + info_len, FANOTIFY_EVENT_ALIGN);
> }
>
> static int fanotify_event_info_len(struct fanotify_event *event)
> {
> - if (!fanotify_event_has_fid(event))
> - return 0;
> + int info_len = 0;
> +
> + if (fanotify_event_has_fid(event))
> + info_len += fanotify_fid_info_len(event->fh.len, 0);
> +
> + if (fanotify_event_has_dfid_name(event)) {
> + info_len += fanotify_fid_info_len(event->dfh.len,
> + fanotify_event_name_len(event));
> + }
>
> - return fanotify_fid_info_len(&event->fh);
> + return info_len;
> }
>
> /*
> @@ -210,23 +222,34 @@ static int process_access_response(struct fsnotify_group *group,
> return -ENOENT;
> }
>
> -static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
> - struct fanotify_fid *fid, char __user *buf)
> +static int copy_info_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
> + struct fanotify_fid *fid, const struct qstr *name,
> + char __user *buf, size_t count)
> {
> struct fanotify_event_info_fid info = { };
> struct file_handle handle = { };
> - unsigned char bounce[FANOTIFY_INLINE_FH_LEN], *data;
> + unsigned char bounce[max(FANOTIFY_INLINE_FH_LEN, DNAME_INLINE_LEN)];
> + const unsigned char *data;
> size_t fh_len = fh->len;
> - size_t len = fanotify_fid_info_len(fh);
> + size_t name_len = name ? name->len : 0;
> + size_t info_len = fanotify_fid_info_len(fh_len, name_len);
> + size_t len = info_len;
> +
> + pr_debug("%s: fh_len=%lu name_len=%lu, info_len=%lu, count=%lu\n",
> + __func__, fh_len, name_len, info_len, count);
>
> - if (!len)
> + if (!fh_len || (name && !name_len))
> return 0;
>
> - if (WARN_ON_ONCE(len < sizeof(info) + sizeof(handle) + fh_len))
> + if (WARN_ON_ONCE(len < sizeof(info) || len > count))
> return -EFAULT;
>
> - /* Copy event info fid header followed by vaiable sized file handle */
> - info.hdr.info_type = FAN_EVENT_INFO_TYPE_FID;
> + /*
> + * Copy event info fid header followed by vaiable sized file handle
> + * and optionally followed by vaiable sized filename.
> + */
> + info.hdr.info_type = name_len ? FAN_EVENT_INFO_TYPE_DFID_NAME :
> + FAN_EVENT_INFO_TYPE_FID;
> info.hdr.len = len;
> info.fsid = *fsid;
> if (copy_to_user(buf, &info, sizeof(info)))
> @@ -234,6 +257,9 @@ static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
>
> buf += sizeof(info);
> len -= sizeof(info);
> + if (WARN_ON_ONCE(len < sizeof(handle)))
> + return -EFAULT;
> +
> handle.handle_type = fh->type;
> handle.handle_bytes = fh_len;
> if (copy_to_user(buf, &handle, sizeof(handle)))
> @@ -241,9 +267,12 @@ static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
>
> buf += sizeof(handle);
> len -= sizeof(handle);
> + if (WARN_ON_ONCE(len < fh_len))
> + return -EFAULT;
> +
> /*
> - * For an inline fh, copy through stack to exclude the copy from
> - * usercopy hardening protections.
> + * For an inline fh and inline file name, copy through stack to exclude
> + * the copy from usercopy hardening protections.
> */
> data = fanotify_fid_fh(fid, fh_len);
> if (fh_len <= FANOTIFY_INLINE_FH_LEN) {
> @@ -253,14 +282,33 @@ static int copy_fid_to_user(__kernel_fsid_t *fsid, struct fanotify_fid_hdr *fh,
> if (copy_to_user(buf, data, fh_len))
> return -EFAULT;
>
> - /* Pad with 0's */
> buf += fh_len;
> len -= fh_len;
> +
> + if (name_len) {
> + /* Copy the filename with terminating null */
> + name_len++;
> + if (WARN_ON_ONCE(len < name_len))
> + return -EFAULT;
> +
> + data = name->name;
> + if (name_len <= DNAME_INLINE_LEN) {
> + memcpy(bounce, data, name_len);
> + data = bounce;
> + }
> + if (copy_to_user(buf, data, name_len))
> + return -EFAULT;
> +
> + buf += name_len;
> + len -= name_len;
> + }
> +
> + /* Pad with 0's */
> WARN_ON_ONCE(len < 0 || len >= FANOTIFY_EVENT_ALIGN);
> if (len > 0 && clear_user(buf, len))
> return -EFAULT;
>
> - return 0;
> + return info_len;
> }
>
> static ssize_t copy_event_to_user(struct fsnotify_group *group,
> @@ -282,12 +330,12 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
> metadata.mask = event->mask & FANOTIFY_OUTGOING_EVENTS;
> metadata.pid = pid_vnr(event->pid);
>
> - if (fanotify_event_has_path(event)) {
> + if (FAN_GROUP_FLAG(group, FAN_REPORT_FID)) {
> + metadata.event_len += fanotify_event_info_len(event);
> + } else if (fanotify_event_has_path(event)) {
> fd = create_fd(group, event, &f);
> if (fd < 0)
> return fd;
> - } else if (fanotify_event_has_fid(event)) {
> - metadata.event_len += fanotify_event_info_len(event);
> }
> metadata.fd = fd;
>
> @@ -302,16 +350,36 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
> if (copy_to_user(buf, &metadata, FAN_EVENT_METADATA_LEN))
> goto out_close_fd;
>
> + buf += FAN_EVENT_METADATA_LEN;
> + count -= FAN_EVENT_METADATA_LEN;
> +
> if (fanotify_is_perm_event(event->mask))
> FANOTIFY_PE(fsn_event)->fd = fd;
>
> - if (fanotify_event_has_path(event)) {
> + if (f)
> fd_install(fd, f);
> - } else if (fanotify_event_has_fid(event)) {
> - ret = copy_fid_to_user(&event->fsid, &event->fh, &event->fid,
> - buf + FAN_EVENT_METADATA_LEN);
> +
> + /* Event info records order is: dir fid + name, child fid */
> + if (fanotify_event_has_dfid_name(event)) {
> + struct fanotify_name_event *fne = FANOTIFY_NE(fsn_event);
> +
> + ret = copy_info_to_user(&event->fsid, &event->dfh, &fne->dfid,
> + &fne->name, buf, count);
> if (ret < 0)
> return ret;
> +
> + buf += ret;
> + count -= ret;
> + }
> +
> + if (fanotify_event_has_fid(event)) {
> + ret = copy_info_to_user(&event->fsid, &event->fh, &event->fid,
> + NULL, buf, count);
> + if (ret < 0)
> + return ret;
> +
> + buf += ret;
> + count -= ret;
> }
>
> return metadata.event_len;
> diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
> index b79fa9bb7359..3049a6c06d9e 100644
> --- a/include/linux/fanotify.h
> +++ b/include/linux/fanotify.h
> @@ -47,7 +47,8 @@
> * Directory entry modification events - reported only to directory
> * where entry is modified and not to a watching parent.
> */
> -#define FANOTIFY_DIRENT_EVENTS (FAN_MOVE | FAN_CREATE | FAN_DELETE)
> +#define FANOTIFY_DIRENT_EVENTS (FAN_MOVE | FAN_CREATE | FAN_DELETE | \
> + FAN_DIR_MODIFY)
>
> /* Events that can only be reported with data type FSNOTIFY_EVENT_INODE */
> #define FANOTIFY_INODE_EVENTS (FANOTIFY_DIRENT_EVENTS | \
> diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h
> index 615fa2c87179..2b56e194b858 100644
> --- a/include/uapi/linux/fanotify.h
> +++ b/include/uapi/linux/fanotify.h
> @@ -117,6 +117,7 @@ struct fanotify_event_metadata {
> };
>
> #define FAN_EVENT_INFO_TYPE_FID 1
> +#define FAN_EVENT_INFO_TYPE_DFID_NAME 2
>
> /* Variable length info record following event metadata */
> struct fanotify_event_info_header {
> --
> 2.17.1
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event
2020-04-16 12:16 ` Michael Kerrisk (man-pages)
@ 2020-04-20 15:53 ` Jan Kara
2020-04-20 18:45 ` Amir Goldstein
1 sibling, 0 replies; 13+ messages in thread
From: Jan Kara @ 2020-04-20 15:53 UTC (permalink / raw)
To: Michael Kerrisk (man-pages)
Cc: Amir Goldstein, Jan Kara, linux-fsdevel, Linux API
On Thu 16-04-20 14:16:40, Michael Kerrisk (man-pages) wrote:
> Hello Amir,
>
> On Mon, 17 Feb 2020 at 15:10, Amir Goldstein <amir73il@gmail.com> wrote:
> >
> > Report event FAN_DIR_MODIFY with name in a variable length record similar
> > to how fid's are reported. With name info reporting implemented, setting
> > FAN_DIR_MODIFY in mark mask is now allowed.
>
> I see this was merged for 5.7. Would you be able to send a man-pages
> patch that documents this new feature please.
I know that Amir has the manpage ready. I'm not sure when he plans to
submit it.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event
2020-04-16 12:16 ` Michael Kerrisk (man-pages)
2020-04-20 15:53 ` Jan Kara
@ 2020-04-20 18:45 ` Amir Goldstein
2020-04-20 18:47 ` Michael Kerrisk (man-pages)
1 sibling, 1 reply; 13+ messages in thread
From: Amir Goldstein @ 2020-04-20 18:45 UTC (permalink / raw)
To: Michael Kerrisk (man-pages); +Cc: Jan Kara, linux-fsdevel, Linux API
On Thu, Apr 16, 2020 at 3:16 PM Michael Kerrisk (man-pages)
<mtk.manpages@gmail.com> wrote:
>
> Hello Amir,
>
> On Mon, 17 Feb 2020 at 15:10, Amir Goldstein <amir73il@gmail.com> wrote:
> >
> > Report event FAN_DIR_MODIFY with name in a variable length record similar
> > to how fid's are reported. With name info reporting implemented, setting
> > FAN_DIR_MODIFY in mark mask is now allowed.
>
> I see this was merged for 5.7. Would you be able to send a man-pages
> patch that documents this new feature please.
>
Sorry, I missed your email.
Just posted the patches.
I never know when in development cycle you expect to get the man page patches...
Thanks,
Amir.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event
2020-04-20 18:45 ` Amir Goldstein
@ 2020-04-20 18:47 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 13+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-04-20 18:47 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Jan Kara, linux-fsdevel, Linux API
On Mon, 20 Apr 2020 at 20:45, Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Thu, Apr 16, 2020 at 3:16 PM Michael Kerrisk (man-pages)
> <mtk.manpages@gmail.com> wrote:
> >
> > Hello Amir,
> >
> > On Mon, 17 Feb 2020 at 15:10, Amir Goldstein <amir73il@gmail.com> wrote:
> > >
> > > Report event FAN_DIR_MODIFY with name in a variable length record similar
> > > to how fid's are reported. With name info reporting implemented, setting
> > > FAN_DIR_MODIFY in mark mask is now allowed.
> >
> > I see this was merged for 5.7. Would you be able to send a man-pages
> > patch that documents this new feature please.
> >
>
> Sorry, I missed your email.
> Just posted the patches.
> I never know when in development cycle you expect to get the man page patches...
Ideally,m the manual page patches are posted in parallel with the
kernel patches, with a note saying that the featur eis not yet merged.
Thanks,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-04-20 18:47 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 13:14 [PATCH v2 00/16] Fanotify event with name info Amir Goldstein
2020-02-17 13:14 ` [PATCH v2 10/16] fanotify: send FAN_DIR_MODIFY event flavor with dir inode and name Amir Goldstein
2020-02-17 13:14 ` [PATCH v2 13/16] fanotify: report name info for FAN_DIR_MODIFY event Amir Goldstein
2020-02-19 9:43 ` kbuild test robot
2020-02-19 10:17 ` kbuild test robot
2020-02-19 11:22 ` Amir Goldstein
2020-04-16 12:16 ` Michael Kerrisk (man-pages)
2020-04-20 15:53 ` Jan Kara
2020-04-20 18:45 ` Amir Goldstein
2020-04-20 18:47 ` Michael Kerrisk (man-pages)
2020-02-17 13:14 ` [PATCH v2 14/16] fanotify: report parent fid + name with FAN_REPORT_NAME Amir Goldstein
2020-02-17 13:14 ` [BONUS][PATCH v2 16/16] fanotify: support limited functionality for unprivileged users Amir Goldstein
2020-02-20 22:10 ` [PATCH v2 00/16] Fanotify event with name info Matthew Bobrowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).