Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: e6ec453bd0f0 ("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>

authored by

Aleksa Sarai and committed by
Christian Brauner
6a64c522 6c203968

+1 -2
+1 -2
fs/autofs/inode.c
··· 172 172 ret = autofs_check_pipe(pipe); 173 173 if (ret < 0) { 174 174 errorf(fc, "Invalid/unusable pipe"); 175 - if (param->type != fs_value_is_file) 176 - fput(pipe); 175 + fput(pipe); 177 176 return -EBADF; 178 177 } 179 178