From: David Miller <davem@davemloft.net>
To: daniel@iogearbox.net
Cc: ast@plumgrid.com, netdev@vger.kernel.org
Subject: Re: [PATCH net] ebpf, x86: fix general protection fault when tail call is invoked
Date: Wed, 29 Jul 2015 17:04:53 -0700 (PDT) [thread overview]
Message-ID: <20150729.170453.375462793871538401.davem@davemloft.net> (raw)
In-Reply-To: <23a2630be3c3d41932b9df134f06b9b44671b55e.1438088105.git.daniel@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Tue, 28 Jul 2015 15:26:36 +0200
> With eBPF JIT compiler enabled on x86_64, I was able to reliably trigger
> the following general protection fault out of an eBPF program with a simple
> tail call, f.e. tracex5 (or a stripped down version of it):
...
> Changing the emitter to always use the 4 byte displacement in the lea
> instruction fixes the panic on my side. It increases the tail call instruction
> emission by 3 more byte, but it should cover us from various combinations
> (and perhaps other future increases on related structures).
>
> After patch, disassembly:
>
> [...]
> 9e: lea 0x80(%rsi,%rdx,8),%rax <--- CONFIG_LOCKDEP/CONFIG_LOCK_STAT
> 48 8d 84 d6 80 00 00 00
> a6: mov (%rax),%rax
> 48 8b 00
> [...]
>
> [...]
> 9e: lea 0x50(%rsi,%rdx,8),%rax <--- No CONFIG_LOCKDEP
> 48 8d 84 d6 50 00 00 00
> a6: mov (%rax),%rax
> 48 8b 00
> [...]
>
> Fixes: b52f00e6a715 ("x86: bpf_jit: implement bpf_tail_call() helper")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Applied, thanks.
prev parent reply other threads:[~2015-07-30 0:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 13:26 [PATCH net] ebpf, x86: fix general protection fault when tail call is invoked Daniel Borkmann
2015-07-28 17:02 ` Alexei Starovoitov
2015-07-28 17:17 ` Daniel Borkmann
2015-07-30 0:04 ` David Miller [this message]
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=20150729.170453.375462793871538401.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ast@plumgrid.com \
--cc=daniel@iogearbox.net \
--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).