syscall_ent...er_mode_work(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… syscall_ent...er_mode_work(9) πŸ’…

ok so this is a page from the Kernel API Manual (yes, the kernel has its own manual, we love that for it) and it's about syscall_enter_from_user_mode_work β€” the little pre-flight check that happens right before a syscall gets to actually do syscall things. buckle up bestie πŸŽ€


✨ NAME ✨

syscall_enter_from_user_mode_work β€” check and handle work before invoking a syscall πŸ¦‹


✨ SYNOPSIS ✨

bool syscall_enter_from_user_mode_work (struct pt_regs *regs , long
*syscall );

✨ ARGUMENTS ✨

  • regs β€” pointer to current's pt_regs πŸ’– (like, the register snapshot of whatever task is running right now)
  • syscall β€” the syscall number πŸ‘‘

✨ DESCRIPTION ✨

okay so picture this: you're in architecture specific syscall entry code, interrupts are enabled, and you've already invoked enter_from_user_mode, enabled interrupts, and done the extra architecture specific work β€” and the syscall return value is preset to -ENOSYS going in. that's the exact moment this function gets invoked. iconic timing honestly ⭐

here's the part you cannot miss: if the return value is false, the caller must skip the syscall and leave the syscall return value unmodified β€” like, do NOT touch it, because one of the entry work functions might have already set it. hands off πŸ™ˆ

it handles these work items, in order:

  1. syscall_work flag dependent invocations of ptrace_report_syscall_permit_entry, __seccomp_permit_syscall, trace_sys_enter πŸ”₯
  2. invocation of audit_syscall_entry πŸ‘‘

✨ RETURN ✨

True if the syscall should be invoked, False otherwise πŸ’€ (and remember, False means skip it and don't mess with the return value, k?)


✨ SEE ALSO ✨

kernel file ./include/linux/entry-common.h 🌸


lowkey the whole entry/exit family is a vibe, go read the exit ones next, bestie 🫢

and that's the whole page!! source lives at ./include/linux and the version stamp says October 2026 β€” so yeah, print it, frame it, put it on your wall, periodt πŸ’œπŸ§šβœ¨

πŸ“¦ where this page comes from