]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 06:00:53 +0000 (01:00 -0500)
commit5ee43d53828f77a9e0dc1a7749c399e0aceeb4a4
treea8cd6bef7315500d41a0d2d3e8d146f864f71708
parent8e7347fc9adb3e4e0a4dd13f1db93c649864e692
bpf/sockmap: Read psock ingress_msg before sk_receive_queue

BugLink: https://bugs.launchpad.net/bugs/1862429
commit e7a5f1f1cd0008e5ad379270a8657e121eedb669 upstream.

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: 604326b41a6fb ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/ipv4/tcp_bpf.c