TWx Linux Repository
Go to file
Josh Poimboeuf db437e9854 objtool, lkdtm: Obfuscate the do_nothing() pointer
[ Upstream commit 05026ea01e95ffdeb0e5ac8fb7fb1b551e3a8726 ]

If execute_location()'s memcpy of do_nothing() gets inlined and unrolled
by the compiler, it copies one word at a time:

    mov    0x0(%rip),%rax    R_X86_64_PC32    .text+0x1374
    mov    %rax,0x38(%rbx)
    mov    0x0(%rip),%rax    R_X86_64_PC32    .text+0x136c
    mov    %rax,0x30(%rbx)
    ...

Those .text references point to the middle of the function, causing
objtool to complain about their lack of ENDBR.

Prevent that by resolving the function pointer at runtime rather than
build time.  This fixes the following warning:

  drivers/misc/lkdtm/lkdtm.o: warning: objtool: execute_location+0x23: relocation to !ENDBR: .text+0x1378

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/30b9abffbddeb43c4f6320b1270fa9b4d74c54ed.1742852847.git.jpoimboe@kernel.org
Closes: https://lore.kernel.org/oe-kbuild-all/202503191453.uFfxQy5R-lkp@intel.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-02 07:50:56 +02:00
arch parisc: PDT: Fix missing prototype warning 2025-05-02 07:50:53 +02:00
block block: fix resource leak in blk_register_queue() error path 2025-04-25 10:45:42 +02:00
certs sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 2025-04-25 10:45:58 +02:00
crypto crypto: null - Use spin lock instead of mutex 2025-05-02 07:50:52 +02:00
Documentation sched/topology: Consolidate and clean up access to a CPU's max compute capacity 2025-05-02 07:50:41 +02:00
drivers objtool, lkdtm: Obfuscate the do_nothing() pointer 2025-05-02 07:50:56 +02:00
fs fs/ntfs3: Fix WARNING in ntfs_extend_initialized_size 2025-05-02 07:50:54 +02:00
include sched/cpufreq: Rework schedutil governor performance estimation 2025-05-02 07:50:41 +02:00
init rust: Disallow BTF generation with Rust + LTO 2025-03-22 12:50:48 -07:00
io_uring io_uring: fix 'sync' handling of io_fallback_tw() 2025-05-02 07:50:47 +02:00
ipc ipc: fix memleak if msg_init_ns failed in create_ipc_ns 2024-12-09 10:32:54 +01:00
kernel objtool, panic: Disable SMAP in __stack_chk_fail() 2025-05-02 07:50:55 +02:00
lib string: Add load_unaligned_zeropad() code path to sized_strscpy() 2025-04-25 10:45:50 +02:00
LICENSES
mm mm: fix apply_to_existing_page_range() 2025-04-25 10:45:48 +02:00
net net: selftests: initialize TCP header and skb payload with zero 2025-05-02 07:50:46 +02:00
rust rust: lockdep: Remove support for dynamically allocated LockClassKeys 2025-03-22 12:50:50 -07:00
samples tracing: Verify event formats that have "%*p.." 2025-05-02 07:50:37 +02:00
scripts sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 2025-04-25 10:45:58 +02:00
security landlock: Add the errata interface 2025-04-25 10:45:57 +02:00
sound objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler() 2025-05-02 07:50:56 +02:00
tools objtool, panic: Disable SMAP in __stack_chk_fail() 2025-05-02 07:50:55 +02:00
usr kbuild: hdrcheck: fix cross build with clang 2025-03-13 12:58:38 +01:00
virt KVM: Use dedicated mutex to protect kvm_usage_count to avoid deadlock 2024-10-04 16:29:47 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore Remove *.orig pattern from .gitignore 2024-10-04 16:29:44 +02:00
.mailmap 20 hotfixes. 12 are cc:stable and the remainder address post-6.5 issues 2023-10-24 09:52:16 -10:00
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS sign-file,extract-cert: move common SSL helper functions to a header 2025-04-25 10:45:57 +02:00
Makefile Linux 6.6.88 2025-04-25 10:45:59 +02: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.