batman-adv: mcast: avoid OOB read of num_dests header
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
batman-adv: mcast: avoid OOB read of num_dests header
Before the access to struct batadv_tvlv_mcast_tracker's num_dests, it is attempted to check whether enough space is actually in the network header. But instead of using offsetofend() to check for the whole size (2) which must be accessible, offsetof() of is called. The latter is always returning 0. The comparison with the network header length will always return that enough data is available - even when only 1 or 0 bytes are accessible.
Instead of using offsetofend(), use the more common check for the whole header.
From the CVE record · Linux
The Linux kernel's batman-adv multicast code fails to check that the full num_dests field is present in a network header. A network header with only zero or one byte accessible at that field can trigger an out-of-bounds read. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with batman-adv should check their exposure; affected versions are not specified.