Skip to content
Commit 809e4dc7 authored by Xu Kuohai's avatar Xu Kuohai Committed by Martin KaFai Lau
Browse files

bpf, sockmap: Fix bug that strp_done cannot be called

strp_done is only called when psock->progs.stream_parser is not NULL,
but stream_parser was set to NULL by sk_psock_stop_strp(), called
by sk_psock_drop() earlier. So, strp_done can never be called.

Introduce SK_PSOCK_RX_ENABLED to mark whether there is strp on psock.
Change the condition for calling strp_done from judging whether
stream_parser is set to judging whether this flag is set. This flag is
only set once when strp_init() succeeds, and will never be cleared later.

Fixes: c0d95d33

 ("bpf, sockmap: Re-evaluate proto ops when psock is removed from sockmap")
Signed-off-by: default avatarXu Kuohai <xukuohai@huawei.com>
Reviewed-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20230804073740.194770-3-xukuohai@huaweicloud.com
Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
parent 7e96ec0e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment