Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177689068
D57332.1795037938.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D57332.1795037938.diff
View Options
diff --git a/sys/netlink/route/iface_drivers.c b/sys/netlink/route/iface_drivers.c
--- a/sys/netlink/route/iface_drivers.c
+++ b/sys/netlink/route/iface_drivers.c
@@ -83,6 +83,10 @@
if ((lattrs->ifi_change & IFF_UP) != 0 || lattrs->ifi_change == 0) {
/* Request to up or down the interface */
+ if (!nlp_has_priv(npt->nlp, PRIV_NET_SETIFFLAGS)) {
+ nlmsg_report_err_msg(npt, "Not enough privileges to set flags");
+ return (EPERM);
+ }
if (lattrs->ifi_flags & IFF_UP)
if_up(ifp);
else
@@ -104,7 +108,7 @@
}
if ((lattrs->ifi_change & IFF_PROMISC) != 0 ||
- lattrs->ifi_change == 0)
+ lattrs->ifi_change == 0) {
/*
* When asking for IFF_PROMISC, set permanent flag instead
* (IFF_PPROMISC) as we have no way of doing promiscuity
@@ -112,7 +116,12 @@
* function either sets or unsets IFF_PROMISC, and ifi_change
* is usually set to 0xFFFFFFFF.
*/
+ if (!nlp_has_priv(npt->nlp, PRIV_NET_SETIFFLAGS)) {
+ nlmsg_report_err_msg(npt, "Not enough privileges to set promisc");
+ return (EPERM);
+ }
if_setppromisc(ifp, (lattrs->ifi_flags & IFF_PROMISC) != 0);
+ }
if (lattrs->ifla_address != NULL) {
if (!nlp_has_priv(npt->nlp, PRIV_NET_SETIFMAC)) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 18, 9:38 PM (2 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41813307
Default Alt Text
D57332.1795037938.diff (1 KB)
Attached To
Mode
D57332: netlink: Check permission for interface flag changes
Attached
Detach File
Event Timeline