svn commit: r311955 - stable/11/sys/netinet

Hiren Panchasara hiren at FreeBSD.org
Thu Jan 12 00:50:39 UTC 2017


Author: hiren
Date: Thu Jan 12 00:50:37 2017
New Revision: 311955
URL: https://svnweb.freebsd.org/changeset/base/311955

Log:
  MFC r311453
  
  sysctl net.inet.tcp.hostcache.list in a jail can see connections from other
  jails and the host. This commit fixes it.
  
  PR:		200361

Modified:
  stable/11/sys/netinet/tcp_hostcache.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_hostcache.c
==============================================================================
--- stable/11/sys/netinet/tcp_hostcache.c	Thu Jan 12 00:48:06 2017	(r311954)
+++ stable/11/sys/netinet/tcp_hostcache.c	Thu Jan 12 00:50:37 2017	(r311955)
@@ -69,10 +69,12 @@ __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/jail.h>
 #include <sys/kernel.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
 #include <sys/malloc.h>
+#include <sys/proc.h>
 #include <sys/sbuf.h>
 #include <sys/socket.h>
 #include <sys/socketvar.h>
@@ -623,6 +625,9 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS)
 	char ip6buf[INET6_ADDRSTRLEN];
 #endif
 
+	if (jailed_without_vnet(curthread->td_ucred) != 0)
+		return (EPERM);
+
 	sbuf_new(&sb, NULL, linesize * (V_tcp_hostcache.cache_count + 1),
 		SBUF_INCLUDENUL);
 


More information about the svn-src-stable mailing list