CVE-2026-93167: csky: Fix a4/a5 restoration in syscall trace path
In the Linux kernel, the following vulnerability has been resolved:
csky: Fix a4/a5 restoration in syscall trace path
The syscall trace path reloads syscall arguments from ptregs before calling the syscall handler. On C-SKY ABIv2, the 5th and 6th syscall arguments are prepared as stack arguments before invoking syscallid.
The current code adjusts sp before loading LSAVEA4 and LSAVEA5. Since those offsets are relative to the original ptregs base, loading them after changing sp fetches the wrong slots. As a result, traced syscalls that use the 5th or 6th argument may receive corrupted arguments.
This is visible with mmap2(), which takes six arguments. A small PTRACESYSCALL reproducer opens a file and maps one page with:
mmap(NULL, 4096, PROTREAD | PROTEXEC, MAPPRIVATE, fd, 0)
Before the fix, the traced child fails the mmap and exits with 12. After the fix, the mapping succeeds and the child exits with 0.
Fix the trace path by loading a4/a5 from ptregs before changing sp.
Tested on: ck860f, linux-4.19.15, C-SKY abiv2
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Fix the C-SKY ABIv2 syscall trace path by restoring syscall arguments a4/a5 from pt_regs before adjusting/changing sp, so the traced syscalls reload the correct argument slots (prevents corrupted 5th/6th syscall arguments such as mmap2 six-argument handling).
Linux kernel (C-SKY ABIv2) syscall trace path a4/a5 restoration order in syscall trace path = Load a4/a5 from pt_regs before changing sp - Operational
Validate the fix by ensuring that after applying it, the ptrace syscall tracing path succeeds and the traced child exits with code 0 (previously mmap failed and child exited with 12).
Event History
Frequently Asked Questions
Which systems and workloads are affected?
The issue affects the Linux kernel syscall trace path on C-SKY ABIv2. It manifests when a traced syscall uses a fifth or sixth argument, such as the six-argument mmap2() syscall.
What conditions are needed to trigger the problem?
A syscall must be executed under syscall tracing, such as PTRACE_SYSCALL, on C-SKY ABIv2. The traced syscall must rely on its fifth or sixth argument, because those arguments can be loaded from incorrect pt_regs slots.
How can I check whether a system exhibits the issue?
Use a PTRACE_SYSCALL test that has a child open a file and call mmap(NULL, 4096, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0). The described affected behavior is a failed mapping followed by child exit code 12; with the fix, the mapping succeeds and the child exits with 0.