From c7735c59e17935eb6c3526463bca8d0825697222 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 21 Aug 2024 03:07:45 +0000 Subject: [PATCH] We do not need the PS_LIBCPIN and PS_PIN flag fields anymore, which were used during devlopment (for visibility). There is speculation claudio will immediately use these bits for something else. --- bin/ps/ps.1 | 7 ++----- sys/kern/exec_elf.c | 4 +--- sys/kern/kern_exec.c | 5 +---- sys/kern/kern_fork.c | 4 +--- sys/sys/proc.h | 4 +--- sys/uvm/uvm_mmap.c | 3 +-- 6 files changed, 7 insertions(+), 20 deletions(-) diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 0bb930bac71..4452bdcc418 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ps.1,v 1.136 2024/07/29 09:50:30 claudio Exp $ +.\" $OpenBSD: ps.1,v 1.137 2024/08/21 03:07:45 deraadt Exp $ .\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $ .\" .\" Copyright (c) 1980, 1990, 1991, 1993, 1994 @@ -30,7 +30,7 @@ .\" .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" -.Dd $Mdocdate: July 29 2024 $ +.Dd $Mdocdate: August 21 2024 $ .Dt PS 1 .Os .Sh NAME @@ -357,9 +357,6 @@ PS_EXECPLEDGE 0x00400000 has exec pledges PS_ORPHAN 0x00800000 process is on an orphan list PS_CHROOT 0x01000000 process is chrooted PS_NOBTCFI 0x02000000 no Branch Target CFI -PS_PIN 0x08000000 ld.so or static executable that - has syscalls pinned -PS_LIBCPIN 0x10000000 libc.so has syscalls pinned PS_CONTINUED 0x20000000 process continued from stopped state but has not been waited for yet .Ed diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 2976afb7ada..f6314803585 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.188 2024/07/14 11:36:54 jca Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.189 2024/08/21 03:07:45 deraadt Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -569,7 +569,6 @@ elf_load_file(struct proc *p, char *path, struct exec_package *epp, pr->ps_pin.pn_end = base + len; pr->ps_pin.pn_pins = pins; pr->ps_pin.pn_npins = npins; - pr->ps_flags |= PS_PIN; } } @@ -867,7 +866,6 @@ exec_elf_makecmds(struct proc *p, struct exec_package *epp) epp->ep_pinend = base + len; epp->ep_pins = pins; epp->ep_npins = npins; - p->p_p->ps_flags |= PS_PIN; } } diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 189596c534c..76f4e70e2a6 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.257 2024/08/06 08:44:54 claudio Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.258 2024/08/21 03:07:45 deraadt Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -514,12 +514,10 @@ sys_execve(struct proc *p, void *v, register_t *retval) pr->ps_pin.pn_pins = pack.ep_pins; pack.ep_pins = NULL; pr->ps_pin.pn_npins = pack.ep_npins; - pr->ps_flags |= PS_PIN; } else { pr->ps_pin.pn_start = pr->ps_pin.pn_end = 0; pr->ps_pin.pn_pins = NULL; pr->ps_pin.pn_npins = 0; - pr->ps_flags &= ~PS_PIN; } if (pr->ps_libcpin.pn_pins) { free(pr->ps_libcpin.pn_pins, M_PINSYSCALL, @@ -527,7 +525,6 @@ sys_execve(struct proc *p, void *v, register_t *retval) pr->ps_libcpin.pn_start = pr->ps_libcpin.pn_end = 0; pr->ps_libcpin.pn_pins = NULL; pr->ps_libcpin.pn_npins = 0; - pr->ps_flags &= ~PS_LIBCPIN; } stopprofclock(pr); /* stop profiling */ diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 2f97fabaf89..224ed7fff7a 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.264 2024/08/20 07:48:23 mvs Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.265 2024/08/21 03:07:45 deraadt Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -256,14 +256,12 @@ process_new(struct proc *p, struct process *parent, int flags) sizeof(u_int), M_PINSYSCALL, M_WAITOK); memcpy(pr->ps_pin.pn_pins, parent->ps_pin.pn_pins, parent->ps_pin.pn_npins * sizeof(u_int)); - pr->ps_flags |= PS_PIN; } if (parent->ps_libcpin.pn_pins) { pr->ps_libcpin.pn_pins = mallocarray(parent->ps_libcpin.pn_npins, sizeof(u_int), M_PINSYSCALL, M_WAITOK); memcpy(pr->ps_libcpin.pn_pins, parent->ps_libcpin.pn_pins, parent->ps_libcpin.pn_npins * sizeof(u_int)); - pr->ps_flags |= PS_LIBCPIN; } /* diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 79f25fdf33e..8c9067a9baa 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.369 2024/08/11 21:07:05 mvs Exp $ */ +/* $OpenBSD: proc.h,v 1.370 2024/08/21 03:07:45 deraadt Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -303,8 +303,6 @@ struct process { #define PS_CHROOT 0x01000000 /* Process is chrooted */ #define PS_NOBTCFI 0x02000000 /* No Branch Target CFI */ #define PS_ITIMER 0x04000000 /* Virtual interval timers running */ -#define PS_PIN 0x08000000 /* ld.so or static syscall pin */ -#define PS_LIBCPIN 0x10000000 /* libc.so syscall pin */ #define PS_CONTINUED 0x20000000 /* Continued proc not yet waited for */ #define PS_BITS \ diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index d8906912716..5a69fa7578b 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_mmap.c,v 1.191 2024/04/05 14:16:05 deraadt Exp $ */ +/* $OpenBSD: uvm_mmap.c,v 1.192 2024/08/21 03:07:45 deraadt Exp $ */ /* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */ /* @@ -647,7 +647,6 @@ err: pr->ps_libcpin.pn_end = base + len; pr->ps_libcpin.pn_pins = pins; pr->ps_libcpin.pn_npins = npins; - pr->ps_flags |= PS_LIBCPIN; #ifdef PMAP_CHECK_COPYIN /* Assume (and insist) on libc.so text being execute-only */ -- 2.20.1