summaryrefslogtreecommitdiff
path: root/include/linux/livepatch.h
diff options
context:
space:
mode:
authorKyle Zeng <kylebot@openai.com>2026-11-04 12:35:30 +0100
committerJakub Kicinski <kuba@kernel.org>2026-11-09 18:03:05 -0800
commita45dbf182137275f44ad7c8bc8acd23f7af6b2cf (patch)
treeb9d93ddcf75192557f7b7ac1af631c8a9a47a8db /include/linux/livepatch.h
parentc78b47704934e44442f4e48bfdcc99039e3b85a5 (diff)
ipvlan: make outbound skb headers writable
In L3 and L3S modes, ipvlan_process_v4_outbound() and ipvlan_process_v6_outbound() hand the skb to ip_local_out() and ip6_local_out(). The IP output path assumes it owns the network header: __ip_local_out() rewrites tot_len and the header checksum, and transport-mode XFRM can memmove the network header into the headroom when xfrm_skb_check_space() finds enough room, without copying. The skb reaching ipvlan can have its header shared with another skb, for example after an AF_PACKET tap on the ipvlan device or a tc mirred mirror action. pskb_network_may_pull() only makes the header linear; it does not unshare an already linear head. The writes above then modify the other skb. If that skb is on the receive path and its IPv4 header was already validated, IPv4 option processing can use the modified header, write past the linear data, and corrupt skb_shared_info. Use skb_cow_head() before taking header pointers and entering the local IP output path, like ip_forward() does with skb_cow() before it touches the header. Only checking skb_header_cloned() is enough here: skbs that TCP transmits are clones of the write-queue skb, whose header area has been released with __skb_header_release(). Their headers are private, so they are not copied, which avoids a reallocation for every TCP segment sent through an ipvlan slave. If the allocation fails, the existing error accounting and drop paths are used. L2 mode is unaffected. [edumazet: use skb_cow_head() instead of skb_unclone() to avoid copying every TCP segment, reword changelog] Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.") Signed-off-by: Kyle Zeng <kylebot@openai.com> Signed-off-by: Eric Dumazet <edumazet@kernel.org> Link: https://patch.msgid.link/20261104113530.986664-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/livepatch.h')
0 files changed, 0 insertions, 0 deletions