mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] x86: Prevent syscall hooking
@ 2026-02-18 14:47 Elly I. Esparza
  2026-02-18 15:18 ` Dave Hansen
  0 siblings, 1 reply; 10+ messages in thread
From: Elly I. Esparza @ 2026-02-18 14:47 UTC (permalink / raw)
  To: linux-kernel, luto, tglx, mingo, bp, dave.hansen, x86, hpa
  Cc: Elly I . Esparza

Kprobes can be used by rootkits to find the address of x64_sys_call(),
x32_sys_call() and ia32_sys_call(). This in turn allows for the rootkits
to find an specific syscall handler and hook it.

Add x64_sys_call(), x32_sys_call() and ia32_sys_call() to the kprobes
blacklist.

Signed-off-by: Elly I. Esparza <ellyesparza8@gmail.com>
---
 arch/x86/entry/syscall_32.c | 2 ++
 arch/x86/entry/syscall_64.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/arch/x86/entry/syscall_32.c b/arch/x86/entry/syscall_32.c
index 2b15ea17bb7c..75d34d2c8067 100644
--- a/arch/x86/entry/syscall_32.c
+++ b/arch/x86/entry/syscall_32.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /* 32-bit system call dispatch */
 
+#include <linux/kprobes.h>
 #include <linux/linkage.h>
 #include <linux/sys.h>
 #include <linux/cache.h>
@@ -48,6 +49,7 @@ long ia32_sys_call(const struct pt_regs *regs, unsigned int nr)
 	default: return __ia32_sys_ni_syscall(regs);
 	}
 }
+NOKPROBE_SYMBOL(ia32_sys_call)
 
 static __always_inline int syscall_32_enter(struct pt_regs *regs)
 {
diff --git a/arch/x86/entry/syscall_64.c b/arch/x86/entry/syscall_64.c
index b6e68ea98b83..1e8045a499d4 100644
--- a/arch/x86/entry/syscall_64.c
+++ b/arch/x86/entry/syscall_64.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /* 64-bit system call dispatch */
 
+#include <linux/kprobes.h>
 #include <linux/linkage.h>
 #include <linux/sys.h>
 #include <linux/cache.h>
@@ -39,6 +40,7 @@ long x64_sys_call(const struct pt_regs *regs, unsigned int nr)
 	default: return __x64_sys_ni_syscall(regs);
 	}
 }
+NOKPROBE_SYMBOL(x64_sys_call)
 
 #ifdef CONFIG_X86_X32_ABI
 long x32_sys_call(const struct pt_regs *regs, unsigned int nr)
@@ -48,6 +50,7 @@ long x32_sys_call(const struct pt_regs *regs, unsigned int nr)
 	default: return __x64_sys_ni_syscall(regs);
 	}
 }
+NOKPROBE_SYMBOL(x32_sys_call)
 #endif
 
 static __always_inline bool do_syscall_x64(struct pt_regs *regs, int nr)
-- 
2.43.0


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

end of thread, other threads:[~2026-02-20 17:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-18 14:47 [PATCH 1/2] x86: Prevent syscall hooking Elly I. Esparza
2026-02-18 15:18 ` Dave Hansen
2026-02-18 15:32   ` Peter Zijlstra
2026-02-19 21:51     ` H. Peter Anvin
2026-02-18 15:52   ` Steven Rostedt
2026-02-18 16:58     ` ellyndra
2026-02-19 18:45     ` Kees Cook
2026-02-20  2:45       ` Masami Hiramatsu
2026-02-20 17:04         ` Christoph Hellwig
2026-02-20 17:12           ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome