syscall_rollback(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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_regs of task. ✨

πŸ’– DESCRIPTION πŸ’–

⚠️ okay so the only valid moment to call this is when task is stopped for system call exit tracing (due to SYSCALL_WORK_SYSCALL_TRACE or SYSCALL_WORK_SYSCALL_AUDIT), after ptrace_report_syscall_permit_entry returned False to 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:


mwah πŸ’‹ source/version: ./include/asm-generic β€’ date: October 2026 β€’ this page: syscall_rollback(9). stay slay, bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from