We do not need the PS_LIBCPIN and PS_PIN flag fields anymore, which were
authorderaadt <deraadt@openbsd.org>
Wed, 21 Aug 2024 03:07:45 +0000 (03:07 +0000)
committerderaadt <deraadt@openbsd.org>
Wed, 21 Aug 2024 03:07:45 +0000 (03:07 +0000)
used during devlopment (for visibility). There is speculation claudio will
immediately use these bits for something else.

bin/ps/ps.1
sys/kern/exec_elf.c
sys/kern/kern_exec.c
sys/kern/kern_fork.c
sys/sys/proc.h
sys/uvm/uvm_mmap.c

index 0bb930b..4452bdc 100644 (file)
@@ -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
index 2976afb..f631480 100644 (file)
@@ -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;
                }
        }
 
index 189596c..76f4e70 100644 (file)
@@ -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 */
index 2f97fab..224ed7f 100644 (file)
@@ -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;
        }
 
        /*
index 79f25fd..8c9067a 100644 (file)
@@ -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 \
index d890691..5a69fa7 100644 (file)
@@ -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 */