Kernel 6.9 disables sys_call_table hooking, but FlipSwitch restores syscall hooking
Their FlipSwitch technique can reliably hook a specific syscall in Linux kernel 6.9 by patching the dispatcher’s machine code.
Security & privacy Elastic Security Labs 30 Sep 2025 Attack Prototype evidence
Published as “FlipSwitch: a Novel Syscall Hooking Technique”
Why it matters
FlipSwitch demonstrates that kernel syscall dispatch changes do not fully prevent kernel-level hooking, highlighting a new attack surface for rootkits.
Summary
The authors describe how Linux kernel 6.9 replaced the sys_call_table dispatch with a switch-statement, breaking traditional syscall table overwrites. They introduce FlipSwitch, which locates the call instruction to the target syscall inside the new dispatcher and overwrites its offset to point to a malicious handler. The method uses a kprobe to obtain kallsyms_lookup_name, disables CR0 write-protect, patches the code, and restores protection on module unload. Their proof-of-concept successfully redirects the kill syscall on x86-64, and they provide YARA rules to detect the module.
What they found 1
- FlipSwitch can redirect the kill syscall to a custom function in kernel 6.9
“With write protection disabled, we overwrite the 4-byte offset of the call instruction with a new offset that points to our own fake_kill function.”
Caveats 2
- kallsyms_lookup_name is generally not exported by default, meaning it's not directly accessible to loadable kernel modules.
- On x86-64, the call instruction has a specific one-byte opcode: 0xe8
What’s new here 4
- Identifies that kernel 6.9’s switch-based syscall dispatch nullifies sys_call_table hooking.
- Introduces FlipSwitch, a technique that patches the dispatcher’s call instruction to hijack a syscall.
- Implements the approach in a loadable kernel module using kprobes and CR0 write-protect manipulation.
- Publishes YARA signatures to detect the FlipSwitch proof-of-concept.