mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
bpf: Sockmap/tls, push write_space updates through ulp updates
commit 33bfe20dd7117dd81fd896a53f743a233e1ad64f upstream.
When sockmap sock with TLS enabled is removed we cleanup bpf/psock state
and call tcp_update_ulp() to push updates to TLS ULP on top. However, we
don't push the write_space callback up and instead simply overwrite the
op with the psock stored previous op. This may or may not be correct so
to ensure we don't overwrite the TLS write space hook pass this field to
the ULP and have it fixup the ctx.
This completes a previous fix that pushed the ops through to the ULP
but at the time missed doing this for write_space, presumably because
write_space TLS hook was added around the same time.
Fixes: 95fa145479 ("bpf: sockmap/tls, close can race with map free")
Signed-off-by: John Fastabend <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: Jakub Sitnicki <[email protected]>
Acked-by: Jonathan Lemon <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/bpf/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
20ae0cb898
commit
2aa7a1ed37
4 changed files with 23 additions and 11 deletions
|
|
@ -798,15 +798,19 @@ out:
|
|||
return rc;
|
||||
}
|
||||
|
||||
static void tls_update(struct sock *sk, struct proto *p)
|
||||
static void tls_update(struct sock *sk, struct proto *p,
|
||||
void (*write_space)(struct sock *sk))
|
||||
{
|
||||
struct tls_context *ctx;
|
||||
|
||||
ctx = tls_get_ctx(sk);
|
||||
if (likely(ctx))
|
||||
if (likely(ctx)) {
|
||||
ctx->sk_write_space = write_space;
|
||||
ctx->sk_proto = p;
|
||||
else
|
||||
} else {
|
||||
sk->sk_prot = p;
|
||||
sk->sk_write_space = write_space;
|
||||
}
|
||||
}
|
||||
|
||||
static int tls_get_info(const struct sock *sk, struct sk_buff *skb)
|
||||
|
|
|
|||
Loading…
Reference in a new issue