From 3f6663fc831f9fc3ec3712ab7b186572384297ad Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 17 Jan 2024 18:56:13 +0000 Subject: [PATCH] Since pinsyscalls(2) applies to all system calls and does a more precise check earlier, the pinsyscall(SYS_execve mechanism has become redundant. It needs to be removed delicately since ld.so and static binaries use it. As a first step, neuter the checking code in sys_execve(). Further steps will follow slowly. ok kettenis --- sys/kern/kern_exec.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 47048040c22..a00e2372145 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.253 2024/01/16 19:05:01 deraadt Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.254 2024/01/17 18:56:13 deraadt Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -268,21 +268,11 @@ sys_execve(struct proc *p, void *v, register_t *retval) #ifdef MACHINE_STACK_GROWS_UP size_t slen; #endif - vaddr_t pc = PROC_PC(p); char *stack; struct ps_strings arginfo; struct vmspace *vm = p->p_vmspace; struct vnode *otvp; - if (vm->vm_execve && - (pc >= vm->vm_execve_end || pc < vm->vm_execve)) { - printf("%s(%d): execve %lx outside %lx-%lx\n", pr->ps_comm, - pr->ps_pid, pc, vm->vm_execve, vm->vm_execve_end); - p->p_p->ps_acflag |= AEXECVE; - sigabort(p); - return (0); - } - /* * Get other threads to stop, if contested return ERESTART, * so the syscall is restarted after halting in userret. -- 2.20.1