untrusted comment: verify with openbsd-78-base.pub
RWS3/nvFmk4SWTwZxUPuhaI0PBMJPrYpP0fMM6MinmHOwe1BS/BVaNojkCgjDIeaNG1Febt2a/fW6g8++gUXaeS5EtMVJa4Mfw8=

OpenBSD 7.8 errata 022, March 15, 2026:

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

Apply by doing:
    signify -Vep /etc/signify/openbsd-78-base.pub -x 022_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.333.2.2 kern_pledge.c
--- sys/kern/kern_pledge.c	3 Mar 2026 14:58:53 -0000	1.333.2.2
+++ sys/kern/kern_pledge.c	11 Mar 2026 01:51:50 -0000
@@ -743,7 +743,7 @@ pledge_recvfd(struct proc *p, struct fil
 		if (vp->v_type != VDIR)
 			return (0);
 	}
-	return pledge_fail(p, EINVAL, PLEDGE_RECVFD);
+	return (EPERM);
 }
 
 /*
