Re: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg

2020-06-09 Thread Alexei Starovoitov
On Tue, Jun 9, 2020 at 2:04 AM Jakub Sitnicki wrote: > > On Fri, Jun 05, 2020 at 10:46 AM CEST, dihu wrote: > > When user application calls read() with MSG_PEEK flag to read data > > of bpf sockmap socket, kernel panic happens at > > __tcp_bpf_recvmsg+0x12c/0x350. sk_msg is not removed from ingres

Re: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg

2020-06-09 Thread Jakub Sitnicki
On Fri, Jun 05, 2020 at 10:46 AM CEST, dihu wrote: > When user application calls read() with MSG_PEEK flag to read data > of bpf sockmap socket, kernel panic happens at > __tcp_bpf_recvmsg+0x12c/0x350. sk_msg is not removed from ingress_msg > queue after read out under MSG_PEEK flag is set. Because

RE: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg

2020-06-08 Thread John Fastabend
dihu wrote: > When user application calls read() with MSG_PEEK flag to read data > of bpf sockmap socket, kernel panic happens at > __tcp_bpf_recvmsg+0x12c/0x350. sk_msg is not removed from ingress_msg > queue after read out under MSG_PEEK flag is set. Because it's not > judged whether sk_msg is th

[PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg

2020-06-05 Thread dihu
When user application calls read() with MSG_PEEK flag to read data of bpf sockmap socket, kernel panic happens at __tcp_bpf_recvmsg+0x12c/0x350. sk_msg is not removed from ingress_msg queue after read out under MSG_PEEK flag is set. Because it's not judged whether sk_msg is the last msg of ingress_

Re: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg

2020-06-02 Thread Jakub Sitnicki
t;> *psock, >>> } while (i != msg_rx->sg.end); >>> >>> if (unlikely(peek)) { >>> + if (msg_rx == list_last_entry(&psock->ingress_msg, >>> + struct sk_msg, list)) >>> + break; >> >> Thanks. Change looks goo

Re: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg

2020-05-29 Thread dihu
On 2020/5/27 5:10, John Fastabend wrote: dihu wrote: From 865a45747de6b68fd02a0ff128a69a5c8feb73c3 Mon Sep 17 00:00:00 2001 From: dihu Date: Mon, 25 May 2020 17:23:16 +0800 Subject: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg When user application calls read() with MSG_PEEK

RE: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg

2020-05-26 Thread John Fastabend
dihu wrote: > From 865a45747de6b68fd02a0ff128a69a5c8feb73c3 Mon Sep 17 00:00:00 2001 > From: dihu > Date: Mon, 25 May 2020 17:23:16 +0800 > Subject: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg > > When user application calls read() with MSG_PEEK flag to read dat