No description
Find a file
Peter Zijlstra b173134eb5 objtool: Add entry UNRET validation
commit a09a6e2399 upstream.

Since entry asm is tricky, add a validation pass that ensures the
retbleed mitigation has been done before the first actual RET
instruction.

Entry points are those that either have UNWIND_HINT_ENTRY, which acts
as UNWIND_HINT_EMPTY but marks the instruction as an entry point, or
those that have UWIND_HINT_IRET_REGS at +0.

This is basically a variant of validate_branch() that is
intra-function and it will simply follow all branches from marked
entry points and ensures that all paths lead to ANNOTATE_UNRET_END.

If a path hits RET or an indirection the path is a fail and will be
reported.

There are 3 ANNOTATE_UNRET_END instances:

 - UNTRAIN_RET itself
 - exception from-kernel; this path doesn't need UNTRAIN_RET
 - all early exceptions; these also don't need UNTRAIN_RET

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
[cascardo: tools/objtool/builtin-check.c no link option validation]
[cascardo: tools/objtool/check.c opts.ibt is ibt]
[cascardo: tools/objtool/include/objtool/builtin.h leave unret option as bool, no struct opts]
[cascardo: objtool is still called from scripts/link-vmlinux.sh]
[cascardo: no IBT support]
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-19 17:51:32 +08:00
arch objtool: Add entry UNRET validation 2023-04-19 17:51:32 +08:00
block block: fix rq-qos breakage from skipping rq_qos_done_bio() 2023-04-19 17:51:03 +08:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2023-04-19 17:50:34 +08:00
crypto crypto: memneq - move into lib/ 2023-04-19 17:50:35 +08:00
Documentation x86/bugs: Add retbleed=ibpb 2023-04-19 17:51:32 +08:00
drivers intel_idle: Disable IBRS during long idle 2023-04-19 17:51:32 +08:00
fs ksmbd: use SOCK_NONBLOCK type for kernel_accept() 2023-04-19 17:51:23 +08:00
include objtool: Add entry UNRET validation 2023-04-19 17:51:32 +08:00
init Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug 2023-04-19 17:50:04 +08:00
ipc ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() 2023-04-19 17:49:52 +08:00
kernel signal handling: don't use BUG_ON() for debugging 2023-04-19 17:51:27 +08:00
lib ida: don't use BUG_ON() for debugging 2023-04-19 17:51:14 +08:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm mm: split huge PUD on wp_huge_pud fallback 2023-04-19 17:51:16 +08:00
net net: tipc: fix possible refcount leak in tipc_sk_create() 2023-04-19 17:51:24 +08:00
samples samples/landlock: Format with clang-format 2023-04-19 17:50:01 +08:00
scripts objtool: Add entry UNRET validation 2023-04-19 17:51:32 +08:00
security ima: Fix potential memory leak in ima_init_crypto() 2023-04-19 17:51:22 +08:00
sound ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0) 2023-04-19 17:51:27 +08:00
tools objtool: Add entry UNRET validation 2023-04-19 17:51:32 +08:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2023-04-19 17:44:58 +08:00
virt KVM: Initialize debugfs_dentry when a VM is created to avoid NULL deref 2023-04-19 17:51:07 +08:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS Input: goodix - add a goodix.h header file 2023-04-19 17:50:59 +08:00
Makefile x86/retpoline: Use -mfunction-return 2023-04-19 17:51:30 +08:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.