]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/sockmap: Read psock ingress_msg before sk_receive_queue
authorLingpeng Chen <forrest0579@gmail.com>
Thu, 9 Jan 2020 01:48:33 +0000 (09:48 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 9 Jan 2020 22:13:48 +0000 (23:13 +0100)
commitd479869cc354e89c36cc95d68b5087f08ba6d069
treedadfdc408f412c057c4fb1bb74b38fc0578d6bc0
parent3e333561e8eb52d45f9c4279270e69645d35ef01
bpf/sockmap: Read psock ingress_msg before sk_receive_queue

Right now in tcp_bpf_recvmsg, sock read data first from sk_receive_queue
if not empty than psock->ingress_msg otherwise. If a FIN packet arrives
and there's also some data in psock->ingress_msg, the data in
psock->ingress_msg will be purged. It is always happen when request to a
HTTP1.0 server like python SimpleHTTPServer since the server send FIN
packet after data is sent out.

Fixes: 38506f4bbc9de ("bpf, sockmap: convert to generic sk_msg interface")
Reported-by: Arika Chen <eaglesora@gmail.com>
Suggested-by: Arika Chen <eaglesora@gmail.com>
Signed-off-by: Lingpeng Chen <forrest0579@gmail.com>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200109014833.18951-1-forrest0579@gmail.com
net/ipv4/tcp_bpf.c