bpf: Reject exclusive maps as inner maps in map-in-map
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.18.407.1.57.2In the Linux kernel, the following vulnerability has been resolved:
bpf: Reject exclusive maps as inner maps in map-in-map
An exclusive map (created with excl_prog_hash) is bound to a single program by hash: check_map_prog_compatibility() refuses to load any program whose digest does not match map->excl_prog_sha. That check only runs for maps a program references directly, i.e. its used_maps. A map reached at runtime through a map-of-maps is never in used_maps, and bpf_map_meta_equal() does not consider excl_prog_sha, so an exclusive map can be inserted into a non-exclusive outer map and then looked up and mutated by an unrelated program, bypassing the exclusivity guarantee.
For the signed loader this defeats the metadata map exclusivity check added in the signed loader: the cached map->sha[] is validated against the signed hash while another program on a hostile host rewrites the frozen map's contents through the outer map.
From the CVE record · Linux
The Linux kernel allows an exclusive BPF map to be inserted into a non-exclusive map-of-maps without enforcing its program-hash restriction on indirect access. An unrelated program on a hostile host can then look up and mutate the map, bypassing exclusivity and potentially changing frozen metadata map contents during a signed-loader check. The input does not specify authentication requirements or user interaction.
Engineers running Linux kernels that support exclusive BPF maps and map-in-map should check their deployments; affected versions are not specified.