net: ethernet: cortina: Carry over frag counter
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4d5ae32f5e1e13f7f36d6439ec3257993b9f5b88 · < c373b34877afea61c89e0dd2e38948c624249b9b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: ethernet: cortina: Carry over frag counter
The gmac_rx() NAPI poll function assembles packets in an SKB from a ring buffer.
If the ring buffer gets completely emptied during a poll cycle, we exit gmac_rx(), but the packet is not yet completely assembled in the SKB, yet the fragment counter frag_nr is reset to zero on the next invocation.
Solve this by making the RX fragment counter a part of the port struct, and carry it over between invocations.
Reset the fragment counter only right after calling napi_gro_frags(), on error (after calling napi_free_frags()) or if stopping the port.
Reset it in some place where not strictly necessary just to emphasize what is going on.
This was found by Sashiko during normal patch review.
From the CVE record · Linux
The Linux kernel’s Cortina Ethernet driver can lose track of a packet’s fragment count when its receive ring empties before the packet is fully assembled. The input does not specify an attacker action, whether exploitation is remote or local, or any authentication or user-interaction requirements.
Engineers running Linux kernels with the Cortina Ethernet driver should check their kernel versions; affected versions were not provided.