summaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-11-23 17:33:39 +0100
committerChristian Brauner <brauner@kernel.org>2025-11-28 12:42:33 +0100
commit1ad7810c6ddae66b2fcd541672bca10fc3b9bbc0 (patch)
tree9cd357e09ab9cc91dc9f874b7d06422017571597 /fs/exec.c
parent7352c6fce34c2e3d902a9bb0af1684c535805e08 (diff)
exec: convert begin_new_exec() to FD_ADD()
Link: https://patch.msgid.link/20251123-work-fd-prepare-v4-21-b6efa1706cfd@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 6b70c6726d31..621898a26515 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1280,10 +1280,9 @@ int begin_new_exec(struct linux_binprm * bprm)
/* Pass the opened binary to the interpreter. */
if (bprm->have_execfd) {
- retval = get_unused_fd_flags(0);
+ retval = FD_ADD(0, bprm->executable);
if (retval < 0)
goto out_unlock;
- fd_install(retval, bprm->executable);
bprm->executable = NULL;
bprm->execfd = retval;
}