arm64: ptrace: Keep 'orig_x0' in-sync with x0 on syscall entry
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a5cd110cb8369d6b37ef5ccfe56b3fa1338c9615 · < 88b839ce497ccb1ff92f7ae742c78dd2937ba572| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
arm64: ptrace: Keep 'orig_x0' in-sync with x0 on syscall entry
Commit e057b9477232 ("arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates") attempted to resolve a long-standing issue with syscall entry tracing, where a tracer is able to manipulate the first syscall argument without being subjected to seccomp or audit checking.
Unfortunately, that fix was incomplete [1], as it failed to update 'orig_x0' between a tracer updating x0 during a seccomp ptrace exit (SECCOMP_RET_TRACE) and the seccomp filter being re-evaluated.
Rather than add hooks to the core seccomp code, instead move the synchronisation code into the ptrace GPR and syscall setting code so that 'orig_x0' is kept up to date with x0 whenever we're stopped on the syscall entry path.
From the CVE record · Linux
On arm64, the Linux kernel can fail to keep a saved syscall argument in sync when a tracer changes it during a seccomp ptrace stop. A local tracer able to modify the first syscall argument at that stop can cause the changed value to be re-evaluated without the intended seccomp or audit checking. The input does not specify authentication or user-interaction requirements.
Engineers running the Linux kernel on arm64 should check their installations; affected versions are not specified.