From: tip-bot for Josh Poimboeuf <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jslaby@suse.cz, akpm@linux-foundation.org, palves@redhat.com,
acme@kernel.org, chris.j.arges@canonical.com,
peterz@infradead.org, torvalds@linux-foundation.org,
jpoimboe@redhat.com, mmarek@suse.cz, bp@alien8.de,
linux-kernel@vger.kernel.org, hpa@zytor.com,
bernd@petrovitsch.priv.at, luto@kernel.org, daniel@iogearbox.net,
tglx@linutronix.de, namhyung@gmail.com, mingo@kernel.org,
ast@kernel.org
Subject: [tip:core/objtool] bpf: Mark __bpf_prog_run() stack frame as non-standard
Date: Mon, 29 Feb 2016 02:59:30 -0800 [thread overview]
Message-ID: <tip-39853cc0cdcf1b11f00f7f81e2f515a4d68ed209@git.kernel.org> (raw)
In-Reply-To: <b90e6bf3fdbfb5c4cc1b164b965502e53cf48935.1456719558.git.jpoimboe@redhat.com>
Commit-ID: 39853cc0cdcf1b11f00f7f81e2f515a4d68ed209
Gitweb: http://git.kernel.org/tip/39853cc0cdcf1b11f00f7f81e2f515a4d68ed209
Author: Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Sun, 28 Feb 2016 22:22:37 -0600
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 29 Feb 2016 08:35:11 +0100
bpf: Mark __bpf_prog_run() stack frame as non-standard
objtool reports the following false positive warnings:
kernel/bpf/core.o: warning: objtool: __bpf_prog_run()+0x5c: sibling call from callable instruction with changed frame pointer
kernel/bpf/core.o: warning: objtool: __bpf_prog_run()+0x60: function has unreachable instruction
kernel/bpf/core.o: warning: objtool: __bpf_prog_run()+0x64: function has unreachable instruction
[...]
It's confused by the following dynamic jump instruction in
__bpf_prog_run()::
jmp *(%r12,%rax,8)
which corresponds to the following line in the C code:
goto *jumptable[insn->code];
There's no way for objtool to deterministically find all possible
branch targets for a dynamic jump, so it can't verify this code.
In this case the jumps all stay within the function, and there's nothing
unusual going on related to the stack, so we can whitelist the function.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Chris J Arges <chris.j.arges@canonical.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: live-patching@vger.kernel.org
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/b90e6bf3fdbfb5c4cc1b164b965502e53cf48935.1456719558.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/bpf/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 972d9a8..be0abf6 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -27,6 +27,7 @@
#include <linux/random.h>
#include <linux/moduleloader.h>
#include <linux/bpf.h>
+#include <linux/frame.h>
#include <asm/unaligned.h>
@@ -649,6 +650,7 @@ load_byte:
WARN_RATELIMIT(1, "unknown opcode %02x\n", insn->code);
return 0;
}
+STACK_FRAME_NON_STANDARD(__bpf_prog_run); /* jump table */
bool bpf_prog_array_compatible(struct bpf_array *array,
const struct bpf_prog *fp)
next prev parent reply other threads:[~2016-02-29 11:01 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 4:22 [PATCH v19 00/10] Compile-time stack metadata validation Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 01/10] objtool: Mark non-standard files and directories Josh Poimboeuf
2016-02-29 10:58 ` [tip:core/objtool] objtool: Mark non-standard object " tip-bot for Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 02/10] objtool: Add STACK_FRAME_NON_STANDARD macro Josh Poimboeuf
2016-02-29 10:58 ` [tip:core/objtool] objtool: Add STACK_FRAME_NON_STANDARD() macro tip-bot for Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 03/10] x86/xen: Mark xen_cpuid() stack frame as non-standard Josh Poimboeuf
2016-02-29 10:59 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 04/10] bpf: Mark __bpf_prog_run() " Josh Poimboeuf
2016-02-29 10:59 ` tip-bot for Josh Poimboeuf [this message]
2016-02-29 4:22 ` [PATCH v19 05/10] sched: Mark __schedule() " Josh Poimboeuf
2016-02-29 10:59 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 06/10] sched: always inline context_switch() Josh Poimboeuf
2016-02-29 11:00 ` [tip:core/objtool] sched: Always " tip-bot for Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 07/10] x86/kprobes: Mark kretprobe_trampoline() stack frame as non-standard Josh Poimboeuf
2016-02-29 11:00 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 08/10] objtool: Compile-time stack metadata validation Josh Poimboeuf
2016-02-29 11:01 ` [tip:core/objtool] objtool: Add tool to perform compile-time " tip-bot for Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 09/10] objtool: Add CONFIG_STACK_VALIDATION option Josh Poimboeuf
2016-02-29 11:01 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-03 14:12 ` Sebastian Andrzej Siewior
2016-03-03 14:56 ` Josh Poimboeuf
2016-02-29 4:22 ` [PATCH v19 10/10] objtool: Enable stack metadata validation on x86_64 Josh Poimboeuf
2016-02-29 11:01 ` [tip:core/objtool] objtool: Enable stack metadata validation on 64-bit x86 tip-bot for Josh Poimboeuf
2016-03-08 10:37 ` [PATCH v19 00/10] Compile-time stack metadata validation Ingo Molnar
2016-03-08 12:29 ` Josh Poimboeuf
2016-03-08 13:44 ` Ingo Molnar
2016-03-08 14:21 ` Josh Poimboeuf
2016-03-08 15:15 ` Ingo Molnar
2016-03-08 15:49 ` Ingo Molnar
2016-03-09 6:06 ` [PATCH 00/11] Various objtool fixes Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 01/11] objtool: Prevent infinite recursion in noreturn detection Josh Poimboeuf
2016-03-09 11:42 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 02/11] objtool: Detect infinite recursion Josh Poimboeuf
2016-03-09 11:43 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 03/11] objtool: Compile with debugging symbols Josh Poimboeuf
2016-03-09 11:43 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 04/11] objtool: Fix false positive warnings related to sibling calls Josh Poimboeuf
2016-03-09 11:43 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 05/11] objtool: Add helper macros for traversing instructions Josh Poimboeuf
2016-03-09 11:44 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 06/11] objtool: Remove superflous INIT_LIST_HEAD Josh Poimboeuf
2016-03-09 11:44 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 07/11] objtool: Rename some variables and functions Josh Poimboeuf
2016-03-09 11:45 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 08/11] objtool: Fix false positive warnings for functions with multiple switch statements Josh Poimboeuf
2016-03-09 11:45 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:06 ` [PATCH 09/11] tools/objtool: Copy hashtable.h into tools directory Josh Poimboeuf
2016-03-09 9:47 ` Ingo Molnar
2016-03-09 16:09 ` Josh Poimboeuf
2016-03-09 18:39 ` Ingo Molnar
2016-03-09 11:45 ` [tip:core/objtool] tools: " tip-bot for Josh Poimboeuf
2016-03-09 6:07 ` [PATCH 10/11] objtool: Add several performance improvements Josh Poimboeuf
2016-03-09 11:46 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09 6:07 ` [PATCH 11/11] objtool: Only print one warning per function Josh Poimboeuf
2016-03-09 11:46 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
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=tip-39853cc0cdcf1b11f00f7f81e2f515a4d68ed209@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ast@kernel.org \
--cc=bernd@petrovitsch.priv.at \
--cc=bp@alien8.de \
--cc=chris.j.arges@canonical.com \
--cc=daniel@iogearbox.net \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=mmarek@suse.cz \
--cc=namhyung@gmail.com \
--cc=palves@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 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.