untrusted comment: verify with openbsd-77-base.pub
RWSbCCUoGpcxVbaHuiB6fuZTmLCKuPRLbymSjAvswrui4rllDgmSmjqmpF6k5syB2kq2C1rQcicWptMnXn8jFZ6nQ0qqTNRfvQA=

OpenBSD 7.7 errata 028, March 15, 2026:

pledge(2) "recvfd" should not kill a process who receives bad descriptors.

Apply by doing:
    signify -Vep /etc/signify/openbsd-77-base.pub -x 028_recvfd.patch.sig \
        -m - | (cd /usr/src && patch -p0)

And then rebuild and install a new kernel:
    KK=`sysctl -n kern.osversion | cut -d# -f1`
    cd /usr/src/sys/arch/`machine`/compile/$KK
    make obj
    make config
    make
    make install

Index: sys/kern/kern_pledge.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_pledge.c,v
diff -u -p -u -r1.323.4.3 kern_pledge.c
--- sys/kern/kern_pledge.c	3 Mar 2026 14:59:24 -0000	1.323.4.3
+++ sys/kern/kern_pledge.c	11 Mar 2026 01:51:59 -0000
@@ -747,7 +747,7 @@ pledge_recvfd(struct proc *p, struct fil
 		if (vp->v_type != VDIR)
 			return (0);
 	}
-	return pledge_fail(p, EINVAL, PLEDGE_RECVFD);
+	return (EPERM);
 }
 
 /*
