bpf, lsm: Add check for BPF LSM return value
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.10.136.11.26.12In the Linux kernel, the following vulnerability has been resolved:
bpf, lsm: Add check for BPF LSM return value
A bpf prog returning a positive number attached to file_alloc_security hook makes kernel panic.
This happens because file system can not filter out the positive number returned by the LSM prog using IS_ERR, and misinterprets this positive number as a file pointer.
Given that hook file_alloc_security never returned positive number before the introduction of BPF LSM, and other BPF LSM hooks may encounter similar issues, this patch adds LSM return value check in verifier, to ensure no unexpected value is returned.
From the CVE record · Linux
The Linux kernel can panic when a BPF program attached to the file_alloc_security hook returns a positive number, which the file system misinterprets as a file pointer. The input does not specify whether exploiting this requires local access, authentication, or user interaction.
Engineers running Linux kernels with BPF LSM should check their versions; affected versions are not specified in the input.