syscall_rollback(9)
π syscall_rollback π
okay so this is syscall_rollback(9) from the Kernel API Manual β a tiny kernel helper with main-character energy, and sheβs here to undo a syscallβs whole situation after it got aborted. bestie, itβs giving βctrl+z but for registers,β and weβre gonna get into it π
β¨
πΈ NAME πΈ
syscall_rollback β roll back registers after an aborted system call.
π SYNOPSIS π
void syscall_rollback (struct task_struct *task , struct pt_regs *regs
);
π«Ά ARGUMENTS π«Ά
taskβ task of interest, must be in system call exit tracing. π«‘regsβtask_pt_regsoftask. β¨
π DESCRIPTION π
β οΈ okay so the only valid moment to call this is whentaskis stopped for system call exit tracing (due toSYSCALL_WORK_SYSCALL_TRACEorSYSCALL_WORK_SYSCALL_AUDIT), afterptrace_report_syscall_permit_entryreturnedFalseto prevent the system call from taking place. no cap, thatβs the whole entry ticket.
So what does it actually do? It rolls back the register state in regs so itβs as if the system call instruction was a no-op. The registers containing the system call number and arguments are as they were before the system call instruction. And bestie, this may not be the same as what the register state looked like at system call entry tracing β so donβt assume those two snapshots match. π
π SEE ALSO π
Kernel file ./include/asm-generic/syscall.h is the whole friend group β go say hi:
syscall_get_nr(9)syscall_set_nr(9)syscall_get_error(9)syscall_get_return_value(9)syscall_set_return_value(9)syscall_get_arguments(9)syscall_set_arguments(9)syscall_get_arch(9)
mwah π source/version: ./include/asm-generic β’ date: October 2026 β’ this page: syscall_rollback(9). stay slay, bestie π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms