All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] Revert "bpf: Fix ORC unwinding in non-JIT BPF code"
@ 2019-07-08 12:45 Arnd Bergmann
  2019-07-08 13:11 ` Josh Poimboeuf
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2019-07-08 12:45 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: Josh Poimboeuf, Arnd Bergmann, Martin KaFai Lau, netdev, bpf,
	linux-kernel

Apparently this was a bit premature, at least I still get this
warning with gcc-8.1:

kernel/bpf/core.o: warning: objtool: ___bpf_prog_run()+0x44d2: sibling call from callable instruction with modified stack frame

This reverts commit b22cf36c189f31883ad0238a69ccf82aa1f3b16b.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 kernel/bpf/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 7e98f36a14e2..16079550db6d 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1299,7 +1299,7 @@ static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn, u64 *stack)
 {
 #define BPF_INSN_2_LBL(x, y)    [BPF_##x | BPF_##y] = &&x##_##y
 #define BPF_INSN_3_LBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = &&x##_##y##_##z
-	static const void * const jumptable[256] __annotate_jump_table = {
+	static const void *jumptable[256] = {
 		[0 ... 255] = &&default_label,
 		/* Now overwrite non-defaults ... */
 		BPF_INSN_MAP(BPF_INSN_2_LBL, BPF_INSN_3_LBL),
@@ -1558,6 +1558,7 @@ static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn, u64 *stack)
 		BUG_ON(1);
 		return 0;
 }
+STACK_FRAME_NON_STANDARD(___bpf_prog_run); /* jump table */
 
 #define PROG_NAME(stack_size) __bpf_prog_run##stack_size
 #define DEFINE_BPF_PROG_RUN(stack_size) \
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [RFC] Revert "bpf: Fix ORC unwinding in non-JIT BPF code"
  2019-07-08 12:45 [PATCH] [RFC] Revert "bpf: Fix ORC unwinding in non-JIT BPF code" Arnd Bergmann
@ 2019-07-08 13:11 ` Josh Poimboeuf
  2019-07-08 13:17   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Poimboeuf @ 2019-07-08 13:11 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, netdev,
	bpf, linux-kernel

On Mon, Jul 08, 2019 at 02:45:23PM +0200, Arnd Bergmann wrote:
> Apparently this was a bit premature, at least I still get this
> warning with gcc-8.1:
> 
> kernel/bpf/core.o: warning: objtool: ___bpf_prog_run()+0x44d2: sibling call from callable instruction with modified stack frame
> 
> This reverts commit b22cf36c189f31883ad0238a69ccf82aa1f3b16b.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Yes, I have been working on a fix.

The impact is that ORC unwinding is broken in this function for
CONFIG_RETPOLINE=n.

I don't think we want to revert this patch though, because that will
broaden the impact to the CONFIG_RETPOLINE=y case.  Anyway I hope to
have fixes soon.

-- 
Josh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [RFC] Revert "bpf: Fix ORC unwinding in non-JIT BPF code"
  2019-07-08 13:11 ` Josh Poimboeuf
@ 2019-07-08 13:17   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-07-08 13:17 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau,
	Networking, bpf, Linux Kernel Mailing List

On Mon, Jul 8, 2019 at 3:11 PM Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>
> On Mon, Jul 08, 2019 at 02:45:23PM +0200, Arnd Bergmann wrote:
> > Apparently this was a bit premature, at least I still get this
> > warning with gcc-8.1:
> >
> > kernel/bpf/core.o: warning: objtool: ___bpf_prog_run()+0x44d2: sibling call from callable instruction with modified stack frame
> >
> > This reverts commit b22cf36c189f31883ad0238a69ccf82aa1f3b16b.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Yes, I have been working on a fix.
>
> The impact is that ORC unwinding is broken in this function for
> CONFIG_RETPOLINE=n.
>
> I don't think we want to revert this patch though, because that will
> broaden the impact to the CONFIG_RETPOLINE=y case.  Anyway I hope to
> have fixes soon.

Ok, sounds good. Thanks,

     Arnd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-08 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 12:45 [PATCH] [RFC] Revert "bpf: Fix ORC unwinding in non-JIT BPF code" Arnd Bergmann
2019-07-08 13:11 ` Josh Poimboeuf
2019-07-08 13:17   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.