]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fsconfig: ensure that dirfd is set to aux
authorChristian Brauner <brauner@kernel.org>
Fri, 22 Sep 2023 11:49:05 +0000 (13:49 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 22 Sep 2023 12:09:06 +0000 (14:09 +0200)
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.

Link: https://lore.kernel.org/lkml/20230922-vorbringen-spaghetti-946729122076@brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/fsopen.c

index ce03f6521c8870fb31127dc85be0cdeff370074b..6593ae51811556207ee5026ace8fe29ed80b31ba 100644 (file)
@@ -465,6 +465,7 @@ SYSCALL_DEFINE5(fsconfig,
                param.file = fget(aux);
                if (!param.file)
                        goto out_key;
+               param.dirfd = aux;
                break;
        default:
                break;