Re: [PATCH] microblaze: implement syscall_rollback

From: Michal Simek

Date: Tue Apr 21 2026 - 04:31:42 EST


Hi,

On 4/17/26 14:03, Dongjun Kim wrote:
Added the implementation of syscall_rollback() in
arch/microblaze/include/asm/syscall.h, which was previously a TODO
stub. This implementation makes seccomp and syscall user dispatch
rollback paths report the original syscall number consistently.


The patch itself is correct but description should be improved to have more details.

Something like

The syscall entry code in entry.S saves the original syscall number
(r12) into the pt_regs r0 slot (swi r12, r1, PT_R0), which is
otherwise unused since hardware r0 is hardwired to zero.
syscall_rollback() restores r12 from this saved copy, undoing any
modification made to the syscall number after entry.

This is needed by the SECCOMP_RET_TRAP and SECCOMP_RET_KILL paths in
__seccomp_filter(), which call syscall_rollback() before delivering
SIGSYS so that the signal handler or coredump sees the original
register state.


Anyway. How did you test this?

Thanks,
Michal