Re: [PATCH net] tcp: fix tcp_set_congestion_control() use from bpf hook

2019-07-18 Thread David Miller
From: Eric Dumazet Date: Thu, 18 Jul 2019 19:28:14 -0700 > Neal reported incorrect use of ns_capable() from bpf hook. > > bpf_setsockopt(...TCP_CONGESTION...) > -> tcp_set_congestion_control() >-> ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) > -> ns_capable_common() > -> curre

Re: [PATCH net] tcp: fix tcp_set_congestion_control() use from bpf hook

2019-07-18 Thread Lawrence Brakmo
On 7/18/19, 7:28 PM, "Eric Dumazet" wrote: Neal reported incorrect use of ns_capable() from bpf hook. bpf_setsockopt(...TCP_CONGESTION...) -> tcp_set_congestion_control() -> ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) -> ns_capable_common() -> curre

Re: [PATCH net] tcp: fix tcp_set_congestion_control() use from bpf hook

2019-07-18 Thread Neal Cardwell
On Thu, Jul 18, 2019 at 10:28 PM Eric Dumazet wrote: > > Neal reported incorrect use of ns_capable() from bpf hook. > > bpf_setsockopt(...TCP_CONGESTION...) > -> tcp_set_congestion_control() >-> ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) > -> ns_capable_common() > -> current_c

[PATCH net] tcp: fix tcp_set_congestion_control() use from bpf hook

2019-07-18 Thread Eric Dumazet
Neal reported incorrect use of ns_capable() from bpf hook. bpf_setsockopt(...TCP_CONGESTION...) -> tcp_set_congestion_control() -> ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) -> ns_capable_common() -> current_cred() -> rcu_dereference_protected(current->cred, 1) Accessing