git: 464d2fec8854 - stable/13 - linux(4): Fix execve() on amd64/linux32 after a125ed50
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 17 Jun 2022 19:40:58 UTC
The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=464d2fec8854b452cf4800c2dd0f1e4b94540a0e commit 464d2fec8854b452cf4800c2dd0f1e4b94540a0e Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2022-05-23 10:17:39 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2022-06-17 19:35:28 +0000 linux(4): Fix execve() on amd64/linux32 after a125ed50 MFC after: 2 weeks (cherry picked from commit 53726a1f1ed75a6788f5235833597e78781fffba) --- 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);