netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Farbod Shahinfar <farbod.shahinfar@polimi.it>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"jakub@cloudflare.com" <jakub@cloudflare.com>
Subject: RE: Kernel panic on bpf_skb_pull_data
Date: Sat, 25 Mar 2023 12:52:12 -0700	[thread overview]
Message-ID: <641f50ecdfe64_1711f620870@john.notmuch> (raw)
In-Reply-To: <DB9P251MB038942715458FA2A2F76FD4585849@DB9P251MB0389.EURP251.PROD.OUTLOOK.COM>

Farbod Shahinfar wrote:
> Hello everyone,
> 
> I am performing some test with BPF SK_SKB and I have encountered a scenario resulting in kernel panic. I use a BPF_SK_SKB_STREAM_PARSER program to parse a request which might be spanning multiple TCP segments. If the end of request is detected in the parser program it returns skb->len, passing the request to the BPF_SK_SKB_STREAM_VERDICT program, and otherwise it returns 0, waiting for more data to be received. You can find the BPF program attached (bpf_test.c). Is there an assumption that the program violates?
> 
> To reproduce the crashing scenario, I use the python script attached (client.py) which sends data in chunks toward the bpf program. Usually, the kernel crashes on the 3rd segment.
> 
> To provide more information, I have attached some crash logs. I have tested this on kernel version 6.1.0 (slightly modified) and version 6.2.8 (unmodified, obtained from kernel.org). It seems that the panic happens when invoking the bpf_skb_pull_data.
> 
> Is this a known issue or is there any information that I can provide to help resolve it?
> 
> Sincerely,
> Farbod Shahinfar
> 
> PhD student at Politecnico di Milano
> https://fshahinfar1.github.io/
> 

I believe I have a fix here for this. I'll check Monday and resend
last set of fixes

Thanks,
John

       reply	other threads:[~2023-03-25 19:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DB9P251MB038942715458FA2A2F76FD4585849@DB9P251MB0389.EURP251.PROD.OUTLOOK.COM>
2023-03-25 19:52 ` John Fastabend [this message]
2023-03-24 16:23 Kernel panic on bpf_skb_pull_data Farbod Shahinfar
2023-03-24 19:42 ` Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=641f50ecdfe64_1711f620870@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=farbod.shahinfar@polimi.it \
    --cc=jakub@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).