The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=20845a6994c548977874d1f413044d43c8474f0a
commit 20845a6994c548977874d1f413044d43c8474f0a Author: Dmitry Chagin <dcha...@freebsd.org> AuthorDate: 2023-09-05 18:19:08 +0000 Commit: Dmitry Chagin <dcha...@freebsd.org> CommitDate: 2023-09-05 18:19:08 +0000 linux(4): Validate exec_setregs on arm64 The lr register is cleared at the beginning of the _dl_start and _start, so there is no need to initialize it. Gnu libc _start takes an rtld_fini pointer in x0 which is set by ld.so for __libc_start_main, the kernel does not register any atexit pointers. While here fix whitespaces. MFC after: 1 week --- sys/arm64/linux/linux_sysvec.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 885ac4657380..3072732de768 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -51,7 +51,6 @@ #include <arm64/linux/linux.h> #include <arm64/linux/linux_proto.h> -#include <compat/linux/linux_dtrace.h> #include <compat/linux/linux_elf.h> #include <compat/linux/linux_emul.h> #include <compat/linux/linux_fork.h> @@ -107,12 +106,6 @@ static void linux_exec_sysvec_init(void *param); static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp); -/* DTrace init */ -LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); - -/* DTrace probes */ -LIN_SDT_PROBE_DEFINE0(sysvec, linux_exec_setregs, todo); - LINUX_VDSO_SYM_CHAR(linux_platform); LINUX_VDSO_SYM_INTPTR(kern_timekeep_base); LINUX_VDSO_SYM_INTPTR(__user_rt_sigreturn); @@ -178,19 +171,9 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp, struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; - /* LINUXTODO: validate */ - LIN_SDT_PROBE0(sysvec, linux_exec_setregs, todo); - memset(regs, 0, sizeof(*regs)); - /* glibc start.S registers function pointer in x0 with atexit. */ - regs->tf_sp = stack; -#if 0 /* LINUXTODO: See if this is used. */ - regs->tf_lr = imgp->entry_addr; -#else - regs->tf_lr = 0xffffffffffffffff; -#endif - regs->tf_elr = imgp->entry_addr; - + regs->tf_sp = stack; + regs->tf_elr = imgp->entry_addr; pcb->pcb_tpidr_el0 = 0; pcb->pcb_tpidrro_el0 = 0; WRITE_SPECIALREG(tpidrro_el0, 0);