summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorHaishuang Yan <yanhaishuang@cmss.chinamobile.com>2026-09-30 20:48:17 +0800
committerJakub Kicinski <kuba@kernel.org>2026-10-06 18:47:34 -0700
commitd065de29c919afac71e46a91a7449203ceb018ce (patch)
treece78c3d640be4a7700c456ef64bb8397fa442223 /include/linux
parentea311fea32363f331ec091e1287727ce972c7ddc (diff)
pfcp: fix metadata_dst leak in pfcp_encap_recv()
pfcp_encap_recv() allocates tun_dst with udp_tun_rx_dst() but only attaches it to the skb after iptunnel_pull_header() has succeeded. When iptunnel_pull_header() fails, the code jumps to the drop label, which frees the skb but not tun_dst, so the metadata_dst is leaked. iptunnel_pull_header() can fail for a GSO skb that is cloned, when skb_unclone() cannot allocate a new header with GFP_ATOMIC. The dst cannot simply be attached earlier, since skb_scrub_packet() in iptunnel_pull_header() drops it for cross-netns devices. Release it explicitly on the error paths instead. The !md check can never be true, but route it through the same label for consistency. Cc: stable+noautosel@kernel.org # LLM report + LLM fix, not seen in real life Fixes: 6dd514f48110 ("pfcp: always set pfcp metadata") Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com> Link: https://patch.msgid.link/20260930124818.114224-2-yanhaishuang@cmss.chinamobile.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions