From: Eric Dumazet <eric.dumazet@gmail.com>
To: Phil Oester <kernel@linuxace.com>
Cc: netdev@vger.kernel.org
Subject: Re: bpf_jit_compile issues on x86_64
Date: Wed, 18 Jan 2012 07:17:08 +0100 [thread overview]
Message-ID: <1326867428.2606.39.camel@edumazet-laptop> (raw)
In-Reply-To: <20120118022709.GA4167@linuxace.com>
Le mardi 17 janvier 2012 à 18:27 -0800, Phil Oester a écrit :
> On a 3.1.8 kernel, I've had a few snort boxes panic when using the new bpf_jit
> code. Setting bpf_jit_enable back to 0 solves the problem. Below is the
> warning, followed by the panic. I've checked the current Linus tree, but
> other than a03ffcf8 (which exists in 3.1.8) I don't see anything new in this
> area. Any ideas? Eric?
>
Hi Phil, thanks for the report !
Any chance you could send me the bpf filter that was loaded at this
time ?
Please try the following patch :
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 7b65f75..a7e6baa 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -584,6 +584,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
ilen = prog - temp;
if (image) {
if (unlikely(proglen + ilen > oldproglen)) {
+bpf_fatal_error:
pr_err("bpb_jit_compile fatal error\n");
kfree(addrs);
module_free(NULL, image);
@@ -605,7 +606,10 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
cleanup_addr -= 4; /* mov -8(%rbp),%rbx */
if (image) {
- WARN_ON(proglen != oldproglen);
+ if (proglen != oldproglen) {
+ pr_err("proglen=%u != oldproglen=%u\n", proglen, oldproglen);
+ goto bpf_fatal_error;
+ }
break;
}
if (proglen == oldproglen) {
next prev parent reply other threads:[~2012-01-18 6:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 2:27 bpf_jit_compile issues on x86_64 Phil Oester
2012-01-18 6:17 ` Eric Dumazet [this message]
2012-01-18 7:30 ` Eric Dumazet
2012-01-18 7:58 ` [PATCH] net: bpf_jit: fix divide by 0 generation Eric Dumazet
2012-01-18 15:57 ` Phil Oester
2012-01-18 16:01 ` Eric Dumazet
2012-01-18 17:21 ` [PATCH v2] " Eric Dumazet
2012-01-18 17:48 ` Phil Oester
2012-01-18 21:04 ` David Miller
2012-01-19 8:07 ` [PATCH] " Eric Dumazet
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=1326867428.2606.39.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=kernel@linuxace.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