diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-08 13:21:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-08 13:21:07 +0000 |
commit | 8a665465c2b1358be2017d89b403c619747c60f9 (patch) | |
tree | 5d7857a684b044fe1e19f32fb5e5a829f06ceb33 /sys/kern | |
parent | 32612ca036ada5606ee0c22617859912ad5fb636 (diff) |
Only in TAME_ROUTE, allow ioctl SIOCGIFADDR/SIOCGIFFLAGS/SIOCGIFRDOMAIN,
because many routing daemon processes with this attribute need to fetch
that information to work.
discussed with claudio and renato
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_tame.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/kern/kern_tame.c b/sys/kern/kern_tame.c index ccd26b1b58e..fc36a710d05 100644 --- a/sys/kern/kern_tame.c +++ b/sys/kern/kern_tame.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_tame.c,v 1.67 2015/10/07 19:52:54 deraadt Exp $ */ +/* $OpenBSD: kern_tame.c,v 1.68 2015/10/08 13:21:06 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -1040,6 +1040,17 @@ tame_ioctl_check(struct proc *p, long com, void *v) } } + if ((p->p_p->ps_tame & TAME_ROUTE)) { + switch (com) { + case SIOCGIFADDR: + case SIOCGIFFLAGS: + case SIOCGIFRDOMAIN: + if (fp->f_type == DTYPE_SOCKET) + return (0); + break; + } + } + if ((p->p_p->ps_tame & TAME_TTY)) { switch (com) { case TIOCSPGRP: |