[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240719-fsconfig-fsparam_fd-fixes-v1-1-7ccd315c2ad4@cyphar.com>
Date: Fri, 19 Jul 2024 00:34:22 +1000
From: Aleksa Sarai <cyphar@...har.com>
To: Ian Kent <raven@...maw.net>, Bill O'Donnell <bodonnel@...hat.com>,
Christian Brauner <brauner@...nel.org>, Jan Harkes <jaharkes@...cmu.edu>,
coda@...cmu.edu, Eric Sandeen <sandeen@...hat.com>,
David Howells <dhowells@...hat.com>
Cc: autofs@...r.kernel.org, linux-kernel@...r.kernel.org,
codalist@...a.cs.cmu.edu, Aleksa Sarai <cyphar@...har.com>
Subject: [PATCH 1/2] 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@...har.com>
---
fs/autofs/inode.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 1f5db6863663..bb404bfce036 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -172,8 +172,7 @@ static int autofs_parse_fd(struct fs_context *fc, struct autofs_sb_info *sbi,
ret = autofs_check_pipe(pipe);
if (ret < 0) {
errorf(fc, "Invalid/unusable pipe");
- if (param->type != fs_value_is_file)
- fput(pipe);
+ fput(pipe);
return -EBADF;
}
--
2.45.2
Powered by blists - more mailing lists