* [PATCH] autofs: fix thinko in validate_dev_ioctl()
@ 2024-10-27 22:47 Ian Kent
2024-10-28 12:18 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Ian Kent @ 2024-10-27 22:47 UTC (permalink / raw)
To: Christian Brauner
Cc: Ian Kent, Al Viro, autofs mailing list, Kernel Mailing List,
linux-fsdevel
I was so sure the per-dentry expire timeout patch worked ok but my
testing was flawed.
In validate_dev_ioctl() the check for ioctl AUTOFS_DEV_IOCTL_TIMEOUT_CMD
should use the ioctl number not the passed in ioctl command.
Signed-off-by: Ian Kent <raven@themaw.net>
---
fs/autofs/dev-ioctl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c
index f011e026358e..6d57efbb8110 100644
--- a/fs/autofs/dev-ioctl.c
+++ b/fs/autofs/dev-ioctl.c
@@ -110,6 +110,7 @@ static inline void free_dev_ioctl(struct autofs_dev_ioctl *param)
*/
static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
{
+ unsigned int inr = _IOC_NR(cmd);
int err;
err = check_dev_ioctl_version(cmd, param);
@@ -133,7 +134,7 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
* check_name() return for AUTOFS_DEV_IOCTL_TIMEOUT_CMD.
*/
err = check_name(param->path);
- if (cmd == AUTOFS_DEV_IOCTL_TIMEOUT_CMD)
+ if (inr == AUTOFS_DEV_IOCTL_TIMEOUT_CMD)
err = err ? 0 : -EINVAL;
if (err) {
pr_warn("invalid path supplied for cmd(0x%08x)\n",
@@ -141,8 +142,6 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
goto out;
}
} else {
- unsigned int inr = _IOC_NR(cmd);
-
if (inr == AUTOFS_DEV_IOCTL_OPENMOUNT_CMD ||
inr == AUTOFS_DEV_IOCTL_REQUESTER_CMD ||
inr == AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD) {
--
2.46.2
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] autofs: fix thinko in validate_dev_ioctl()
2024-10-27 22:47 [PATCH] autofs: fix thinko in validate_dev_ioctl() Ian Kent
@ 2024-10-28 12:18 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2024-10-28 12:18 UTC (permalink / raw)
To: Ian Kent
Cc: Christian Brauner, Al Viro, autofs mailing list,
Kernel Mailing List, linux-fsdevel
On Mon, 28 Oct 2024 06:47:17 +0800, Ian Kent wrote:
> I was so sure the per-dentry expire timeout patch worked ok but my
> testing was flawed.
>
> In validate_dev_ioctl() the check for ioctl AUTOFS_DEV_IOCTL_TIMEOUT_CMD
> should use the ioctl number not the passed in ioctl command.
>
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] autofs: fix thinko in validate_dev_ioctl()
https://git.kernel.org/vfs/vfs/c/f19910006eff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-28 12:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-27 22:47 [PATCH] autofs: fix thinko in validate_dev_ioctl() Ian Kent
2024-10-28 12:18 ` Christian Brauner
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®