* [PATCH] microblaze: implement syscall_rollback
@ 2026-04-17 12:03 Dongjun Kim
2026-04-21 8:30 ` Michal Simek
0 siblings, 1 reply; 2+ messages in thread
From: Dongjun Kim @ 2026-04-17 12:03 UTC (permalink / raw)
To: Michal Simek; +Cc: Dmitry V . Levin, Andrew Morton, linux-kernel, Dongjun Kim
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.
Signed-off-by: Dongjun Kim <aurorasphere@o.cnu.ac.kr>
---
arch/microblaze/include/asm/syscall.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/microblaze/include/asm/syscall.h b/arch/microblaze/include/asm/syscall.h
index b5b6b91fae3e..b9143b5e01f2 100644
--- a/arch/microblaze/include/asm/syscall.h
+++ b/arch/microblaze/include/asm/syscall.h
@@ -24,7 +24,7 @@ static inline void syscall_set_nr(struct task_struct *task,
static inline void syscall_rollback(struct task_struct *task,
struct pt_regs *regs)
{
- /* TODO. */
+ regs->r12 = regs->r0;
}
static inline long syscall_get_error(struct task_struct *task,
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] microblaze: implement syscall_rollback
2026-04-17 12:03 [PATCH] microblaze: implement syscall_rollback Dongjun Kim
@ 2026-04-21 8:30 ` Michal Simek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2026-04-21 8:30 UTC (permalink / raw)
To: Dongjun Kim; +Cc: Dmitry V . Levin, Andrew Morton, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-21 8:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-17 12:03 [PATCH] microblaze: implement syscall_rollback Dongjun Kim
2026-04-21 8:30 ` Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®