Linux Kernel /proc/pid/syscall information disclosure vulnerability
The /proc/pid/syscall file on 32-bit ARM and i386 kernels leaks uninitialised kernel stack memory because the code copies only 24 bytes into a 48-byte buffer but prints all 48 bytes. An attacker could read kernel addresses and potentially bypass KASLR.
Originally disclosed on Cisco Talos
An information disclosure vulnerability exists in the /proc/pid/syscall functionality of Linux Kernel 5.1 Stable and 5.4.66. More specifically, this issue has been introduced in v5.1-rc4 (commit 631b7abacd02b88f4b0795c08b54ad4fc3e7c7c0) and is still present in v5.10-rc4, so it’s likely that all versions in between are…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a type mismatch: the syscall_get_arguments function writes only 24 bytes into a 48-byte array on 32-bit systems, but the printing code reads all 48 bytes, exposing uninitialised stack memory.
What the attacker needed
32-bit ARM or i386 kernel; local access to read /proc/pid/syscall
The fix
The issue was fixed by a patch merged on 2020-12-03.
How it was found
- On a 32-bit ARM or i386 system, read /proc/self/syscall.
- Observe that the output contains kernel addresses in the argument fields.
- To trigger the leak more frequently, run a loop that reads /proc/self/syscall and another loop that allocates memory.
- Compare outputs from different processes to see the same leaked bytes.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The /proc/pid/syscall file shows details about a running program's system calls. On some 32-bit systems, the kernel accidentally includes extra bytes of its own memory when printing this file. Those bytes can contain secret addresses that help attackers defeat a security feature called KASLR, which randomises where the kernel is loaded in memory.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.