Whenever the ULP data on the socket is mangled, enforce that the
caller has the socket lock held as otherwise things may race with
initialization and cleanup callbacks from ulp ops as both would
mangle internal socket state.
Joint work with John.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
{
struct inet_connection_sock *icsk = inet_csk(sk);
+ sock_owned_by_me(sk);
+
if (!icsk->icsk_ulp_ops)
return;
const struct tcp_ulp_ops *ulp_ops;
int err = 0;
+ sock_owned_by_me(sk);
if (icsk->icsk_ulp_ops)
return -EEXIST;
const struct tcp_ulp_ops *ulp_ops;
int err;
+ sock_owned_by_me(sk);
if (icsk->icsk_ulp_ops)
return -EEXIST;