mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
autofs: fix missing fput for FSCONFIG_SET_FD
If you pass an fd using FSCONFIG_SET_FD, autofs_parse_fd() "steals" the
param->file and so the fs_context infrastructure will not do fput() for
us.
Fixes: e6ec453bd0
("autofs: convert autofs to use the new mount api")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Link: https://lore.kernel.org/r/20240731-fsconfig-fsparam_fd-fixes-v2-1-e7c472224417@cyphar.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
6c203968f5
commit
6a64c5220c
@ -172,8 +172,7 @@ static int autofs_parse_fd(struct fs_context *fc, struct autofs_sb_info *sbi,
|
|||||||
ret = autofs_check_pipe(pipe);
|
ret = autofs_check_pipe(pipe);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
errorf(fc, "Invalid/unusable pipe");
|
errorf(fc, "Invalid/unusable pipe");
|
||||||
if (param->type != fs_value_is_file)
|
fput(pipe);
|
||||||
fput(pipe);
|
|
||||||
return -EBADF;
|
return -EBADF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user