git: 53726a1f1ed7 - main - linux(4): Fix execve() on amd64/linux32 after a125ed50
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 May 2022 10:20:14 UTC
The branch main has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=53726a1f1ed75a6788f5235833597e78781fffba
commit 53726a1f1ed75a6788f5235833597e78781fffba
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-05-23 10:17:39 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-05-23 10:17:39 +0000
linux(4): Fix execve() on amd64/linux32 after a125ed50
MFC after: 2 weeks
---
sys/amd64/linux32/linux32_machdep.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c
index e1d7742d0a21..9746c4bd7cdf 100644
--- a/sys/amd64/linux32/linux32_machdep.c
+++ b/sys/amd64/linux32/linux32_machdep.c
@@ -134,11 +134,15 @@ linux_execve(struct thread *td, struct linux_execve_args *args)
char *path;
int error;
- LCONVPATHEXIST(args->path, &path);
-
- error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE,
- args->argp, args->envp);
- free(path, M_TEMP);
+ if (!LUSECONVPATH(td)) {
+ error = freebsd32_exec_copyin_args(&eargs, args->path, UIO_USERSPACE,
+ args->argp, args->envp);
+ } else {
+ LCONVPATHEXIST(args->path, &path);
+ error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE,
+ args->argp, args->envp);
+ LFREEPATH(path);
+ }
if (error == 0)
error = linux_common_execve(td, &eargs);
AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td);