diff options
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 974199daa911..0afae8ba413e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5279,7 +5279,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
5279 | case SIOCGMIIPHY: | 5279 | case SIOCGMIIPHY: |
5280 | case SIOCGMIIREG: | 5280 | case SIOCGMIIREG: |
5281 | case SIOCSIFNAME: | 5281 | case SIOCSIFNAME: |
5282 | if (!capable(CAP_NET_ADMIN)) | 5282 | if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) |
5283 | return -EPERM; | 5283 | return -EPERM; |
5284 | dev_load(net, ifr.ifr_name); | 5284 | dev_load(net, ifr.ifr_name); |
5285 | rtnl_lock(); | 5285 | rtnl_lock(); |
@@ -5300,16 +5300,25 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
5300 | * - require strict serialization. | 5300 | * - require strict serialization. |
5301 | * - do not return a value | 5301 | * - do not return a value |
5302 | */ | 5302 | */ |
5303 | case SIOCSIFMAP: | ||
5304 | case SIOCSIFTXQLEN: | ||
5305 | if (!capable(CAP_NET_ADMIN)) | ||
5306 | return -EPERM; | ||
5307 | /* fall through */ | ||
5308 | /* | ||
5309 | * These ioctl calls: | ||
5310 | * - require local superuser power. | ||
5311 | * - require strict serialization. | ||
5312 | * - do not return a value | ||
5313 | */ | ||
5303 | case SIOCSIFFLAGS: | 5314 | case SIOCSIFFLAGS: |
5304 | case SIOCSIFMETRIC: | 5315 | case SIOCSIFMETRIC: |
5305 | case SIOCSIFMTU: | 5316 | case SIOCSIFMTU: |
5306 | case SIOCSIFMAP: | ||
5307 | case SIOCSIFHWADDR: | 5317 | case SIOCSIFHWADDR: |
5308 | case SIOCSIFSLAVE: | 5318 | case SIOCSIFSLAVE: |
5309 | case SIOCADDMULTI: | 5319 | case SIOCADDMULTI: |
5310 | case SIOCDELMULTI: | 5320 | case SIOCDELMULTI: |
5311 | case SIOCSIFHWBROADCAST: | 5321 | case SIOCSIFHWBROADCAST: |
5312 | case SIOCSIFTXQLEN: | ||
5313 | case SIOCSMIIREG: | 5322 | case SIOCSMIIREG: |
5314 | case SIOCBONDENSLAVE: | 5323 | case SIOCBONDENSLAVE: |
5315 | case SIOCBONDRELEASE: | 5324 | case SIOCBONDRELEASE: |
@@ -5318,7 +5327,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
5318 | case SIOCBRADDIF: | 5327 | case SIOCBRADDIF: |
5319 | case SIOCBRDELIF: | 5328 | case SIOCBRDELIF: |
5320 | case SIOCSHWTSTAMP: | 5329 | case SIOCSHWTSTAMP: |
5321 | if (!capable(CAP_NET_ADMIN)) | 5330 | if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) |
5322 | return -EPERM; | 5331 | return -EPERM; |
5323 | /* fall through */ | 5332 | /* fall through */ |
5324 | case SIOCBONDSLAVEINFOQUERY: | 5333 | case SIOCBONDSLAVEINFOQUERY: |