From: Mateusz Guzik <mjguzik@gmail.com>
To: brauner@kernel.org
Cc: viro@zeniv.linux.org.uk, jack@suse.cz,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Mateusz Guzik <mjguzik@gmail.com>
Subject: [PATCH v2 2/3] vfs: catch invalid modes in may_open()
Date: Thu, 6 Feb 2025 18:03:06 +0100 [thread overview]
Message-ID: <20250206170307.451403-3-mjguzik@gmail.com> (raw)
In-Reply-To: <20250206170307.451403-1-mjguzik@gmail.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---
fs/namei.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/namei.c b/fs/namei.c
index 3ab9440c5b93..21630a0f8e30 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3415,6 +3415,8 @@ static int may_open(struct mnt_idmap *idmap, const struct path *path,
if ((acc_mode & MAY_EXEC) && path_noexec(path))
return -EACCES;
break;
+ default:
+ VFS_BUG_ON_INODE(1, inode);
}
error = inode_permission(idmap, inode, MAY_OPEN | acc_mode);
--
2.43.0
next prev parent reply other threads:[~2025-02-06 17:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 17:03 [PATCH v2 0/3] CONFIG_VFS_DEBUG at last Mateusz Guzik
2025-02-06 17:03 ` [PATCH v2 1/3] vfs: add initial support for CONFIG_VFS_DEBUG Mateusz Guzik
2025-02-07 13:15 ` Jan Kara
2025-02-08 16:10 ` Mateusz Guzik
2025-02-06 17:03 ` Mateusz Guzik [this message]
2025-02-07 13:16 ` [PATCH v2 2/3] vfs: catch invalid modes in may_open() Jan Kara
2025-02-06 17:03 ` [PATCH v2 3/3] vfs: use the new debug macros in inode_set_cached_link() Mateusz Guzik
2025-02-07 13:16 ` Jan Kara
2025-02-06 17:33 ` [PATCH v2 0/3] CONFIG_VFS_DEBUG at last Mateusz Guzik
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=20250206170307.451403-3-mjguzik@gmail.com \
--to=mjguzik@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®