aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/ibmasm/ibmasmfs.c
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2019-07-18 19:28:14 -0700
committerDavid S. Miller <[email protected]>2019-07-18 20:33:48 -0700
commit8d650cdedaabb33e85e9b7c517c0c71fcecc1de9 (patch)
treeab0428e5e973eb2b4e8b1f4859a508e2c0d07859 /drivers/misc/ibmasm/ibmasmfs.c
parent269b7c5ff78264e3728b95828d219e0e0eeaec94 (diff)
tcp: fix tcp_set_congestion_control() use from bpf hook
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 'current' in bpf context makes no sense, since packets are processed from softirq context. As Neal stated : The capability check in tcp_set_congestion_control() was written assuming a system call context, and then was reused from a BPF call site. The fix is to add a new parameter to tcp_set_congestion_control(), so that the ns_capable() call is only performed under the right context. Fixes: 91b5b21c7c16 ("bpf: Add support for changing congestion control") Signed-off-by: Eric Dumazet <[email protected]> Cc: Lawrence Brakmo <[email protected]> Reported-by: Neal Cardwell <[email protected]> Acked-by: Neal Cardwell <[email protected]> Acked-by: Lawrence Brakmo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/misc/ibmasm/ibmasmfs.c')
0 files changed, 0 insertions, 0 deletions