[PATCH] fsconfig: ensure that dirfd is set to aux

From: Christian Brauner
Date: Fri Sep 22 2023 - 07:49:05 EST


The code in fs_param_is_fd() expects param->dirfd to be set to the fd
that was used to set param->file to initialize result->uint_32. So make
sure it's set so users like autofs using FSCONFIG_SET_FD with the new
mount api can rely on this to be set to the correct value.

Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
---
fs/fsopen.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/fsopen.c b/fs/fsopen.c
index ce03f6521c88..6593ae518115 100644
--- a/fs/fsopen.c
+++ b/fs/fsopen.c
@@ -465,6 +465,7 @@ SYSCALL_DEFINE5(fsconfig,
param.file = fget(aux);
if (!param.file)
goto out_key;
+ param.dirfd = aux;
break;
default:
break;
--
2.34.1