From: Oliver Ford <ojford@gmail.com>
To: linux-fsdevel@vger.kernel.org, jack@suse.cz, amir73il@gmail.com
Cc: linux-kernel@vger.kernel.org, ojford@gmail.com
Subject: [PATCH 0/1] fs: inotify: Add full paths option to inotify
Date: Mon, 6 Jun 2022 23:42:40 +0100 [thread overview]
Message-ID: <20220606224241.25254-1-ojford@gmail.com> (raw)
Adds an option to return the full path in inotify events. Currently, user space has to keep track of watch descriptors and paths, mapping the descriptor returned when reading inotify events to the path. Adding an option to return the full path simplifies user space code.
The patch adds a flag, IN_FULL_PATHS, to the available mask in inotify_add_watch. When set, the full path is returned when events are added to the watch queue and a path is available. For the event IN_MOVE_SELF, a check is performed that the user has access to the new path. This prevents exposing the names of directories if, for example, root moves "/home/dmr/watched" to "/root/top_secret/watched". In that case, the watch is removed and a Permission Denied error is returned. For the IN_DELETE_SELF/IN_IGNORED pair, no path is returned.
Oliver Ford (1):
fs: inotify: Add full paths option to inotify
fs/notify/inotify/inotify_fsnotify.c | 55 ++++++++++++++++++++++------
fs/notify/inotify/inotify_user.c | 19 +++++++++-
include/linux/inotify.h | 2 +-
include/uapi/linux/inotify.h | 1 +
4 files changed, 63 insertions(+), 14 deletions(-)
--
2.35.1
next reply other threads:[~2022-06-06 22:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 22:42 Oliver Ford [this message]
2022-06-06 22:42 ` [PATCH 1/1] fs: inotify: Add full paths option to inotify Oliver Ford
2022-06-07 5:01 ` kernel test robot
2022-06-07 5:31 ` Al Viro
2022-06-07 4:30 ` [PATCH 0/1] " Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220606224241.25254-1-ojford@gmail.com \
--to=ojford@gmail.com \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).