From 3b5541ba8d82142735a6c0f1a8786a25401a1c58 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 16 Jan 2024 19:08:37 +0000 Subject: [PATCH] print flag 'l' for base program or ld.so being under pinsyscalls enforcement, and 'L' for libc.so. This flag printing may be deleted once we are entirely confident this is working correctly. ok kettenis --- bin/ps/print.c | 6 +++++- bin/ps/ps.1 | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bin/ps/print.c b/bin/ps/print.c index 1704522b71e..b493e37bd73 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.86 2023/03/08 14:47:02 tobhe Exp $ */ +/* $OpenBSD: print.c,v 1.87 2024/01/16 19:08:37 deraadt Exp $ */ /* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */ /*- @@ -303,6 +303,10 @@ printstate(const struct pinfo *pi, VARENT *ve) *cp++ = '+'; if (kp->p_psflags & PS_PLEDGE) *cp++ = 'p'; + if (kp->p_psflags & PS_PIN) + *cp++ = 'l'; + if (kp->p_psflags & PS_LIBCPIN) + *cp++ = 'L'; if (kp->p_eflag & EPROC_UNVEIL) { if (kp->p_eflag & EPROC_LKUNVEIL) *cp++ = 'U'; diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 3abfd34f3bc..f28a3c68aa6 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ps.1,v 1.131 2023/11/10 09:17:02 kn Exp $ +.\" $OpenBSD: ps.1,v 1.132 2024/01/16 19:08:37 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: November 10 2023 $ +.Dd $Mdocdate: January 16 2024 $ .Dt PS 1 .Os .Sh NAME @@ -359,6 +359,9 @@ 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 .Ed .It Cm re Core residency time (in seconds; 127 = infinity). @@ -475,6 +478,11 @@ scheduling priority. .It p The process has called .Xr pledge 2 . +.It l +.Xr ld.so 1 +or a static executable has syscall pinning. +.It L +libc.so has syscall pinning. .\" .It S .\" The process has asked for FIFO .\" page replacement -- 2.20.1