6lowpan: fix off-by-one in multicast context address compression
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 5609c185f24dffca5f6a9c127106869da150be03 · < c32f30ef5e66adbfa102348e2e8a23776eb007cb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
6lowpan: fix off-by-one in multicast context address compression
The second memcpy in lowpan_iphc_mcast_ctx_addr_compress() uses &data[1] as destination and &ipaddr->s6_addr[11] as source, but both should be offset by one: &data[2] and &ipaddr->s6_addr[12] respectively.
This off-by-one has two consequences: 1. data[1] is overwritten with s6_addr[11], corrupting the RIID field in the compressed multicast address 2. data[5] is never written, so uninitialized kernel stack memory is transmitted over the network via lowpan_push_hc_data(), leaking kernel stack contents
The correct inline data layout must match what the decompression function lowpan_uncompress_multicast_ctx_daddr() expects: data[0..1] = s6_addr[1..2] (flags/scope + RIID) data[2..5] = s6_addr[12..15] (group ID)
Also zero-initialize the data array as a defensive measure against similar bugs in the future.
From the CVE record · Linux
An off-by-one error in Linux kernel 6lowpan multicast address compression leaves a byte of output uninitialized and corrupts the compressed address. When the kernel transmits an affected packet, that byte can expose kernel stack memory to someone observing the network traffic. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels that use 6lowpan should check whether their kernel is affected; no affected versions are specified.