Skip to content

Conversation

@kernel-patches-daemon-bpf
Copy link

Pull request for series with
subject: bpf, sockmap: Fix tp->copied_seq update in, tcp_bpf_strp_read_sock
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1020412

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: b54a8e1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1020412
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6f1f4c1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1020412
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f8c67d8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1020412
version: 1

In the tcp_read_sock_noack function, received packets may be
destined for either the current sk or another sk.

In my test case, the first packet of the connection is sent to
the current sk, while subsequent packets are sent to another sk.

When the first packet is forwarded, tp->copied_seq is updated in
tcp_bpf_recvmsg_parser. However, since psock->copied_seq
accumulates the length of every processed packet,
using psock->copied_seq to update tp->copied_seq when
processing the second packet would lead to incorrect behavior.

Therefore, we only need to update tp->copied_seq in cases where
packets are forwarded to another sk.

Signed-off-by: GuoYong Zheng <zhenggy@chinatelecom.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant