mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
autofs: fix thinko in validate_dev_ioctl()
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.
Fixes: 433f9d76a0
("autofs: add per dentry expire timeout")
Cc: <stable@vger.kernel.org> # mainline only
Signed-off-by: Ian Kent <raven@themaw.net>
Link: https://lore.kernel.org/r/20241027224732.5507-1-raven@themaw.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
e65a0dc1ca
commit
f19910006e
@ -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)
|
static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
|
||||||
{
|
{
|
||||||
|
unsigned int inr = _IOC_NR(cmd);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = check_dev_ioctl_version(cmd, param);
|
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.
|
* check_name() return for AUTOFS_DEV_IOCTL_TIMEOUT_CMD.
|
||||||
*/
|
*/
|
||||||
err = check_name(param->path);
|
err = check_name(param->path);
|
||||||
if (cmd == AUTOFS_DEV_IOCTL_TIMEOUT_CMD)
|
if (inr == AUTOFS_DEV_IOCTL_TIMEOUT_CMD)
|
||||||
err = err ? 0 : -EINVAL;
|
err = err ? 0 : -EINVAL;
|
||||||
if (err) {
|
if (err) {
|
||||||
pr_warn("invalid path supplied for cmd(0x%08x)\n",
|
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;
|
goto out;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unsigned int inr = _IOC_NR(cmd);
|
|
||||||
|
|
||||||
if (inr == AUTOFS_DEV_IOCTL_OPENMOUNT_CMD ||
|
if (inr == AUTOFS_DEV_IOCTL_OPENMOUNT_CMD ||
|
||||||
inr == AUTOFS_DEV_IOCTL_REQUESTER_CMD ||
|
inr == AUTOFS_DEV_IOCTL_REQUESTER_CMD ||
|
||||||
inr == AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD) {
|
inr == AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD) {
|
||||||
|
Loading…
Reference in New Issue
Block a user