Skip to content

Commit

Permalink
allow reading of sysctl kern.somaxconn in "inet", due to
Browse files Browse the repository at this point in the history
operational behaviour of "go" which is not unreasonable
from Jimmy Brush
  • Loading branch information
deraadt committed Feb 4, 2020
1 parent 67d0e46 commit 5d6a987
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sys/kern/kern_pledge.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: kern_pledge.c,v 1.257 2020/01/23 01:02:34 dlg Exp $ */
/* $OpenBSD: kern_pledge.c,v 1.258 2020/02/04 10:09:37 deraadt Exp $ */

/*
* Copyright (c) 2015 Nicholas Marriott <[email protected]>
Expand Down Expand Up @@ -904,6 +904,12 @@ pledge_sysctl(struct proc *p, int miblen, int *mib, void *new)
return (0);
}

if ((p->p_p->ps_pledge & PLEDGE_INET)) {
if (miblen == 2 && /* kern.somaxconn */
mib[0] == CTL_KERN && mib[1] == KERN_SOMAXCONN)
return (0);
}

if ((p->p_p->ps_pledge & (PLEDGE_ROUTE | PLEDGE_INET | PLEDGE_DNS))) {
if (miblen == 6 && /* getifaddrs() */
mib[0] == CTL_NET && mib[1] == PF_ROUTE &&
Expand Down

0 comments on commit 5d6a987

Please sign in to comment.