|
@@ -325,7 +325,7 @@ lookup_protocol:
|
|
}
|
|
}
|
|
|
|
|
|
err = -EPERM;
|
|
err = -EPERM;
|
|
- if (answer->capability > 0 && !capable(answer->capability))
|
|
|
|
|
|
+ if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW))
|
|
goto out_rcu_unlock;
|
|
goto out_rcu_unlock;
|
|
|
|
|
|
err = -EAFNOSUPPORT;
|
|
err = -EAFNOSUPPORT;
|
|
@@ -947,7 +947,6 @@ static struct inet_protosw inetsw_array[] =
|
|
.protocol = IPPROTO_TCP,
|
|
.protocol = IPPROTO_TCP,
|
|
.prot = &tcp_prot,
|
|
.prot = &tcp_prot,
|
|
.ops = &inet_stream_ops,
|
|
.ops = &inet_stream_ops,
|
|
- .capability = -1,
|
|
|
|
.no_check = 0,
|
|
.no_check = 0,
|
|
.flags = INET_PROTOSW_PERMANENT |
|
|
.flags = INET_PROTOSW_PERMANENT |
|
|
INET_PROTOSW_ICSK,
|
|
INET_PROTOSW_ICSK,
|
|
@@ -958,7 +957,6 @@ static struct inet_protosw inetsw_array[] =
|
|
.protocol = IPPROTO_UDP,
|
|
.protocol = IPPROTO_UDP,
|
|
.prot = &udp_prot,
|
|
.prot = &udp_prot,
|
|
.ops = &inet_dgram_ops,
|
|
.ops = &inet_dgram_ops,
|
|
- .capability = -1,
|
|
|
|
.no_check = UDP_CSUM_DEFAULT,
|
|
.no_check = UDP_CSUM_DEFAULT,
|
|
.flags = INET_PROTOSW_PERMANENT,
|
|
.flags = INET_PROTOSW_PERMANENT,
|
|
},
|
|
},
|
|
@@ -969,7 +967,6 @@ static struct inet_protosw inetsw_array[] =
|
|
.protocol = IPPROTO_IP, /* wild card */
|
|
.protocol = IPPROTO_IP, /* wild card */
|
|
.prot = &raw_prot,
|
|
.prot = &raw_prot,
|
|
.ops = &inet_sockraw_ops,
|
|
.ops = &inet_sockraw_ops,
|
|
- .capability = CAP_NET_RAW,
|
|
|
|
.no_check = UDP_CSUM_DEFAULT,
|
|
.no_check = UDP_CSUM_DEFAULT,
|
|
.flags = INET_PROTOSW_REUSE,
|
|
.flags = INET_PROTOSW_REUSE,
|
|
}
|
|
}
|