Networking: use CAP_NET_ADMIN when deciding to call request_module
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv4 / tcp_cong.c
index e92beb9e55e0d834c3184e4b2a5c6e4faa5ea057..6428b342b16442d48864c53ee7d4f8b25fc6a42c 100644 (file)
@@ -116,7 +116,7 @@ int tcp_set_default_congestion_control(const char *name)
        spin_lock(&tcp_cong_list_lock);
        ca = tcp_ca_find(name);
 #ifdef CONFIG_MODULES
-       if (!ca && capable(CAP_SYS_MODULE)) {
+       if (!ca && capable(CAP_NET_ADMIN)) {
                spin_unlock(&tcp_cong_list_lock);
 
                request_module("tcp_%s", name);
@@ -246,7 +246,7 @@ int tcp_set_congestion_control(struct sock *sk, const char *name)
 
 #ifdef CONFIG_MODULES
        /* not found attempt to autoload module */
-       if (!ca && capable(CAP_SYS_MODULE)) {
+       if (!ca && capable(CAP_NET_ADMIN)) {
                rcu_read_unlock();
                request_module("tcp_%s", name);
                rcu_read_lock();