Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162166303
D54982.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D54982.diff
View Options
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -546,11 +546,6 @@
{
int error;
- /*
- * Currently the only function calling this ioctl routine is rtioctl_fib().
- * Typically, only root can create the raw socket in order to execute
- * this ioctl method, however the request might be coming from a prison
- */
error = priv_check(curthread, PRIV_NETINET_MROUTE);
if (error)
return (error);
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -89,6 +89,7 @@
#include <sys/mbuf.h>
#include <sys/module.h>
#include <sys/domain.h>
+#include <sys/priv.h>
#include <sys/protosw.h>
#include <sys/sdt.h>
#include <sys/signalvar.h>
@@ -458,24 +459,26 @@
static int
X_mrt6_ioctl(u_long cmd, caddr_t data)
{
- int ret;
-
- ret = EINVAL;
+ int error;
+ error = priv_check(curthread, PRIV_NETINET_MROUTE);
+ if (error)
+ return (error);
+ error = EINVAL;
switch (cmd) {
case SIOCGETSGCNT_IN6:
- ret = get_sg_cnt((struct sioc_sg_req6 *)data);
+ error = get_sg_cnt((struct sioc_sg_req6 *)data);
break;
case SIOCGETMIFCNT_IN6:
- ret = get_mif6_cnt((struct sioc_mif_req6 *)data);
+ error = get_mif6_cnt((struct sioc_mif_req6 *)data);
break;
default:
break;
}
- return (ret);
+ return (error);
}
/*
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -604,6 +604,9 @@
case MRT6_ADD_MFC:
case MRT6_DEL_MFC:
case MRT6_PIM:
+ error = priv_check(curthread, PRIV_NETINET_MROUTE);
+ if (error != 0)
+ return (error);
if (inp->inp_ip_p != IPPROTO_ICMPV6)
return (EOPNOTSUPP);
error = ip6_mrouter_get ? ip6_mrouter_get(so, sopt) :
@@ -627,6 +630,9 @@
case MRT6_ADD_MFC:
case MRT6_DEL_MFC:
case MRT6_PIM:
+ error = priv_check(curthread, PRIV_NETINET_MROUTE);
+ if (error != 0)
+ return (error);
if (inp->inp_ip_p != IPPROTO_ICMPV6)
return (EOPNOTSUPP);
error = ip6_mrouter_set ? ip6_mrouter_set(so, sopt) :
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 11, 12:06 PM (8 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34959456
Default Alt Text
D54982.diff (2 KB)
Attached To
Mode
D54982: ip_mroute: Make privilege checking more consistent
Attached
Detach File
Event Timeline
Log In to Comment