diff options
| author | Dmitry Chagin <dchagin@FreeBSD.org> | 2023-05-29 08:16:46 +0000 |
|---|---|---|
| committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2023-05-29 08:16:46 +0000 |
| commit | fd745e1db6b561900b8e5e9caa4ed05cf15398b3 (patch) | |
| tree | 70a8872a57c71fc4bbf7818c5c5c51db03d2c836 /sys/amd64 | |
| parent | 3d2fec7db856c67e1a94a87a846d8ffe6f48b61f (diff) | |
linux(4): Use pwd_altroot() to tell namei() about ABI root path
PR: 72920
Differential Revision: https://reviews.freebsd.org/D40090
MFC after: 2 month
Diffstat (limited to 'sys/amd64')
| -rw-r--r-- | sys/amd64/linux/linux_sysvec.c | 6 | ||||
| -rw-r--r-- | sys/amd64/linux32/linux32_machdep.c | 12 | ||||
| -rw-r--r-- | sys/amd64/linux32/linux32_sysvec.c | 6 |
3 files changed, 4 insertions, 20 deletions
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 05afcdfcd045..943df00328fc 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -593,7 +593,6 @@ struct sysentvec elf_linux_sysvec = { .sv_elf_core_osabi = ELFOSABI_NONE, .sv_elf_core_abi_vendor = LINUX_ABI_VENDOR, .sv_elf_core_prepare_notes = linux64_prepare_notes, - .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS_LA48, @@ -633,7 +632,7 @@ linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) error = linux_map_vdso(p, linux_vdso_obj, linux_vdso_base, LINUX_VDSOPAGE_SIZE, imgp); if (error == 0) - linux_on_exec(p, imgp); + error = linux_on_exec(p, imgp); return (error); } @@ -775,7 +774,6 @@ static Elf64_Brandinfo linux_glibc2brand = { .brand = ELFOSABI_LINUX, .machine = EM_X86_64, .compat_3_brand = "Linux", - .emul_path = linux_emul_path, .interp_path = "/lib64/ld-linux-x86-64.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -787,7 +785,6 @@ static Elf64_Brandinfo linux_glibc2brandshort = { .brand = ELFOSABI_LINUX, .machine = EM_X86_64, .compat_3_brand = "Linux", - .emul_path = linux_emul_path, .interp_path = "/lib64/ld-linux.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -799,7 +796,6 @@ static Elf64_Brandinfo linux_muslbrand = { .brand = ELFOSABI_LINUX, .machine = EM_X86_64, .compat_3_brand = "Linux", - .emul_path = linux_emul_path, .interp_path = "/lib/ld-musl-x86_64.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 23d8f8767282..4e5d6eb55fc6 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -118,18 +118,10 @@ int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; - char *path; int error; - 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); - } + error = freebsd32_exec_copyin_args(&eargs, args->path, UIO_USERSPACE, + args->argp, args->envp); if (error == 0) error = linux_common_execve(td, &eargs); AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 3cec5d2e9eeb..e51ae68a229d 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -794,7 +794,6 @@ struct sysentvec elf_linux_sysvec = { .sv_elf_core_osabi = ELFOSABI_NONE, .sv_elf_core_abi_vendor = LINUX_ABI_VENDOR, .sv_elf_core_prepare_notes = linux32_prepare_notes, - .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = LINUX32_MAXUSER, @@ -834,7 +833,7 @@ linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) error = linux_map_vdso(p, linux_vdso_obj, linux_vdso_base, LINUX32_VDSOPAGE_SIZE, imgp); if (error == 0) - linux_on_exec(p, imgp); + error = linux_on_exec(p, imgp); return (error); } @@ -973,7 +972,6 @@ static Elf32_Brandinfo linux_brand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = linux_emul_path, .interp_path = "/lib/ld-linux.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -985,7 +983,6 @@ static Elf32_Brandinfo linux_glibc2brand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = linux_emul_path, .interp_path = "/lib/ld-linux.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -997,7 +994,6 @@ static Elf32_Brandinfo linux_muslbrand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = linux_emul_path, .interp_path = "/lib/ld-musl-i386.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, |
