bpf, arm64: Fix address emission with tag-based KASAN enabled
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf, arm64: Fix address emission with tag-based KASAN enabled
When BPF_TRAMP_F_CALL_ORIG is enabled, the address of a bpf_tramp_image struct on the stack is passed during the size calculation pass and an address on the heap is passed during code generation. This may cause a heap buffer overflow if the heap address is tagged because emit_a64_mov_i64() will emit longer code than it did during the size calculation pass. The same problem could occur without tag-based KASAN if one of the 16-bit words of the stack address happened to be all-ones during the size calculation pass. Fix the problem by assuming the worst case (4 instructions) when calculating the size of the bpf_tramp_image address emission.
From the CVE record · Linux
The arm64 BPF trampoline can calculate too little space for address-emission code when BPF_TRAMP_F_CALL_ORIG is enabled, potentially causing a heap buffer overflow. This can occur with a tagged heap address or, even without tag-based KASAN, with a particular stack-address pattern. The input does not specify an attacker access path, authentication requirement, or user interaction.
Engineers running the Linux kernel on arm64 should check their deployments; affected versions are not specified.