From d247611467e079f34a1a3f762e2a18c00a3f2bdd Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 17 Jan 2022 11:42:28 -0500 Subject: exec: Introduce the PROC_PS_STRINGS() macro Rather than fetching the ps_strings address directly from a process' sysentvec, use this macro. With stack address randomization the ps_strings address is no longer fixed. Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 706f4a81a81250a326ea25914e7effe1768f1a37) --- sys/i386/linux/linux_sysvec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/i386/linux/linux_sysvec.c') diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 20108f37584f..1478ff0bf163 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -198,7 +198,7 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) p = imgp->proc; issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; - arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; + arginfo = (struct ps_strings *)PROC_PS_STRINGS(p); uplatform = (Elf32_Addr *)((caddr_t)arginfo - linux_szplatform); args = (Elf32_Auxargs *)imgp->auxargs; argarray = pos = malloc(LINUX_AT_COUNT * sizeof(*pos), M_TEMP, @@ -278,7 +278,7 @@ linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) struct proc *p; p = imgp->proc; - arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; + arginfo = (struct ps_strings *)PROC_PS_STRINGS(p); destp = (uintptr_t)arginfo; /* Install LINUX_PLATFORM. */ -- cgit v1.3