From: claudio Date: Thu, 30 Jun 2022 15:35:14 +0000 (+0000) Subject: Allow sysctl mib CTL_NET.PF_INET6 with a length of 3 in PLEDGE_VMINFO. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=90c5cf9bef8df567049d00799709252c78c3e42e;p=openbsd Allow sysctl mib CTL_NET.PF_INET6 with a length of 3 in PLEDGE_VMINFO. This will be used for sysconf(3) and getconf(1) to handle _POSIX_IPV6 without opening a socket. OK sthen@ deraadt@ --- diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index c09d5342d1c..0c69ac3f8a2 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.284 2022/06/29 12:17:31 jca Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.285 2022/06/30 15:35:14 claudio Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -933,6 +933,9 @@ pledge_sysctl(struct proc *p, int miblen, int *mib, void *new) mib[0] == CTL_VFS && mib[1] == VFS_GENERIC && mib[2] == VFS_BCACHESTAT) return (0); + if (miblen == 3 && /* for sysconf(3) */ + mib[0] == CTL_NET && mib[1] == PF_INET6) + return (0); } if ((pledge & (PLEDGE_INET | PLEDGE_UNIX))) {