The branch stable/15 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=74145b2f9f980ea1c8f455f6b97d5a88e0564dc9

commit 74145b2f9f980ea1c8f455f6b97d5a88e0564dc9
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-07-07 23:46:56 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-09-05 00:33:42 +0000

    pdopenpid(2): allow in capability mode with restrictions
    
    (cherry picked from commit 73c92a978ccef5e1683914510ea35e6e338646d1)
---
 sys/kern/sys_procdesc.c  | 6 ++++++
 sys/kern/syscalls.master | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c
index 5ee8a4734248..b9329cd38088 100644
--- a/sys/kern/sys_procdesc.c
+++ b/sys/kern/sys_procdesc.c
@@ -665,6 +665,12 @@ pdopenpid1(struct thread *td, pid_t pid, struct procdesc 
**pdf, struct file *fp)
                PROC_UNLOCK(p);
                return (EBUSY);
        }
+       error = p_canopen(td, p);
+       if (error != 0) {
+               PROC_UNLOCK(p);
+               return (error);
+       }
+
        pd = p->p_procdesc;
        if (pd != NULL) {
                MPASS((p->p_zombieref & PZOMBIEREF_PROCDESC) != 0);
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index b717f9029543..5a93ee43b00f 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -3422,7 +3422,7 @@
                    int flags
                );
        }
-603    AUE_PDOPENPID   STD {
+603    AUE_PDOPENPID   STD|CAPENABLED {
                int pdopenpid(
                    pid_t pid,
                    int flags

Reply via email to