lwt: Fix return values of BPF xmit ops
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3a0af8fd61f90920f6fa04e4f1e9a6a73c1b4fd2 · < 65583f9e070db7bece20710cfa2e3daeb0b831d9| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
lwt: Fix return values of BPF xmit ops
BPF encap ops can return different types of positive values, such like NET_RX_DROP, NET_XMIT_CN, NETDEV_TX_BUSY, and so on, from function skb_do_redirect and bpf_lwt_xmit_reroute. At the xmit hook, such return values would be treated implicitly as LWTUNNEL_XMIT_CONTINUE in ip(6)_finish_output2. When this happens, skbs that have been freed would continue to the neighbor subsystem, causing use-after-free bug and kernel crashes.
To fix the incorrect behavior, skb_do_redirect return values can be simply discarded, the same as tc-egress behavior. On the other hand, bpf_lwt_xmit_reroute returns useful errors to local senders, e.g. PMTU information. Thus convert its return values to avoid the conflict with LWTUNNEL_XMIT_CONTINUE.
From the CVE record · Linux
The Linux kernel can misinterpret positive return values from BPF lightweight tunnel transmit operations as an instruction to continue processing. Under that condition, a freed packet buffer can reach the neighbor subsystem, causing a use-after-free and kernel crashes. The input does not specify attacker access or authentication requirements.
Engineers running Linux kernels with BPF lightweight tunnel transmit hooks should check their versions; affected versions are not specified.