ipv4: account for fraggap on the paged allocation path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8eb77cc73977d88787b37c92831b1c242e035396 · < eca856950f7cb1a221e02b99d758409f2c5cec42| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ipv4: account for fraggap on the paged allocation path
In __ip_append_data(), when the paged-allocation branch is taken, alloclen and pagedlen are computed as
alloclen = fragheaderlen + transhdrlen; pagedlen = datalen - transhdrlen;
datalen already includes fraggap, but the fraggap bytes carried over from the previous skb are copied into the new skb's linear area at offset transhdrlen by the subsequent skb_copy_and_csum_bits(). The linear area is therefore undersized by fraggap bytes while pagedlen is overstated by the same amount.
The non-paged branch sets alloclen to fraglen, which already accounts for fraggap because datalen does. Bring the paged branch in line by adding fraggap to alloclen and subtracting it from pagedlen.
After this adjustment, copy no longer collapses to -fraggap on the paged path, so remove the stale comment describing that old arithmetic.
From the CVE record · Linux
The Linux kernel’s IPv4 packet assembly code can allocate too little linear buffer space when the paged-allocation path carries fragment-gap bytes from a previous packet buffer. The input does not establish what an attacker can do or whether exploitation requires network access, authentication, or user interaction.
Anyone running the Linux kernel should check whether their version contains the affected IPv4 code; affected versions were not provided.