From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60066280CE5 for ; Sat, 11 Jul 2026 15:06:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783782414; cv=none; b=HwAp/wPRZASjdMHLpoH3QmgwqiDFJ2RMQV4kr6nJCFJbxPR5jjGRIPIbo0bVIhESD/wZhs9UOGdIlM1n4N1FWP0Rl4DQ7uPMOnKIqd5r0PqbpQXjpMFMh4rIXhqBAWwqoHcdDp62DSX73ej0szP7OwmpWHPBSeTOJ+PFlw713hY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783782414; c=relaxed/simple; bh=eXimup/rS3zaRoVPDBO/BpRgrc2vA3jesXZPxz7A1HE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=F/PG5ScDtrDGn3QpfPPKVBBEvpzncmACOoxoWW4+SOuUoHERtpaw7MA/+ErtuiNJf/RcVUWJSqx5XY6ZPDQQ2ja0omtNB5bWYpfmQG+sKVUB1uNadj7E+toE50+Ziau/aU1ati6+6aBiqHXYeb3DXCK7ufirjCiEPuCrFfwLdgg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WsfjzUZY; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WsfjzUZY" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-92e6c4a867cso105494485a.0 for ; Sat, 11 Jul 2026 08:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783782412; x=1784387212; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=pylLKBo48mUBwphkQfLVRDh8jr+L260t0Ip5RKicSNk=; b=WsfjzUZYCa4FgDfamw1gCIbpGpsUknnqziHhs4anv/fmI43rc8JpYykMoEfC0l1N13 VeE4P0PcX4JJOvNFlaku49Xzw4jtdY309mV30LBVxnOioEKoy8j+VjgWz7CRniUNoCKA HV6Op2W7i2thGkTWgzvZWjl1zOeqiKYsrygvzO554E9OKhCvXnLsm+J/k9Z7wdsx4Eyu 3TZQT7l3A4cIJMIpc6nCeoBU5M2cixoA0LEdgwPWGtFuTwHWE5J2smz9qeaLdeFbNkMO dhKRP6pznvHbvo3Pkno1oGE76Y3VUVDMsBWbZHMRJPlXRZyS5vzAO5dJ9pdPm0m+Wi0+ z6bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783782412; x=1784387212; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pylLKBo48mUBwphkQfLVRDh8jr+L260t0Ip5RKicSNk=; b=RYRQDFF+Fr5oMo88tfxOGg3DlI+u1qwPho4OZBlW/Cq8hXCHFKfEj9rzB/3cNztBOY 7kxgLbWgoesbpopMpdrbXnbu/kFQ2mP2SWUCWA1azIFfhTmROmiYnkMXRIdzQX4m39cC 07oEM4KiGSHMPwNdP3/VzllqUIH5rnr+JcOii1SxBHcUC9mX767aKS0ltQ5bA+suOJgy gubOfajKigUWYqYX8TO5GOAUwkoYroEy7U08l/5Y/+un17cCoWV6RbB/1ff5SpwHPAWe gWTLtpzT+AHpC/x2SZJ9mxWcDGiDCcXztIJmGuN23BIL8+BdJexh58GVhjZxQuqTLMv9 SHhQ== X-Forwarded-Encrypted: i=1; AHgh+RrOP8UbhDPkjv7gtF8tNnObc8bzlG2WWIUHqifMFJMPixdlmCQbXCKPYa2T1seHGmCgIUStAQ4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy94imujRYQ+xQ3zlnr5HBAr6fLp7MO+DKniCchJhzeHGOPMA8W rNbWuWUkJjvKyBNDAEf3WUkgNqiQXuoiXtgTYWMVlM5cjF9QYIWh6Mbc X-Gm-Gg: AfdE7ckGj/TmcwB2O1qj2zW1JhcX2Ko4q1mv0/+IqHOB0aUiBfbHywTlxamGIH829VJ g17U1sQ2Fhr2fAYwJBXWxlw8im2gVFdHi/KVMBRl5EDVQp6+HyaYq0Y6BKjR/g61PXLr+TtQJSW x6pIfbZ/8hvEY0u/eRfIZTLhKcUn0hm/CWfFszR8GFV7b8+/+r+AAAIzsIGenps0tX1nlBByOq8 rPIrhvpyCTBzAjQjT1qDSK5L/O6uQ9mLbtiJtXG7zNXAtWLxsu5RZKSBCvIM3zJnYSt2vpPMlVr kAX3msdp6LvnHAWsrebu/6Q5c0tgU9IsI4nffKrcICsNskt/ObwS/0BYBlX/muqGjGbIhQFYZ54 IUPPNVf9DXS3fCWmEJfeUW4CNeSIUEow50EHlmgPhCN5OgKc6XbqSMjaLx9lRhRIC58PGklvi8W 39LkSxjFw6O/Ci1n4cMb8JsgACGe1DwVkBEFjqUlHrWFUtRx2ARgFUQ99B8erSQcCoKRS+ADwMV UV1LVW4zQ== X-Received: by 2002:a05:620a:3952:b0:92e:c116:bf00 with SMTP id af79cd13be357-92ef2f8a31fmr317346685a.93.1783782412224; Sat, 11 Jul 2026 08:06:52 -0700 (PDT) Received: from server0 (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92ee5b4920asm463219685a.4.2026.07.11.08.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2026 08:06:51 -0700 (PDT) From: Michael Bommarito To: "David S . Miller" , Jakub Kicinski , Eric Dumazet , Paolo Abeni Cc: Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH net] ila: reload IPv6 header after pskb_may_pull in checksum adjust Date: Sat, 11 Jul 2026 11:06:48 -0400 Message-ID: <20260711150648.2915106-1-michael.bommarito@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ila_csum_adjust_transport() caches ip6h = ipv6_hdr(skb) before calling pskb_may_pull(). On a non-linear skb whose transport header sits in a page fragment, pskb_may_pull() can call __pskb_pull_tail() / pskb_expand_head() and free the old skb head, leaving ip6h dangling; the following get_csum_diff(ip6h, p) then reads freed memory. ila_update_ipv6_locator() has the same pattern and additionally writes the new locator through the stale destination-address pointer. Impact: a remote IPv6 packet routed through a configured ILA csum-adjust-transport route or receive-side mapping triggers a slab-use-after-free in ila_update_ipv6_locator() (KASAN). The route or mapping requires CAP_NET_ADMIN to configure, but trigger packets are unauthenticated once it exists. Reload ip6h (and the derived iaddr) after each pskb_may_pull() before use, matching the transport-header reload the code already performs. Fixes: 33f11d16142b ("ila: Create net/ipv6/ila directory") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Michael Bommarito --- net/ipv6/ila/ila_common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/ipv6/ila/ila_common.c b/net/ipv6/ila/ila_common.c index e71571455c8a0..acedc5a84e4d7 100644 --- a/net/ipv6/ila/ila_common.c +++ b/net/ipv6/ila/ila_common.c @@ -85,6 +85,7 @@ static void ila_csum_adjust_transport(struct sk_buff *skb, struct tcphdr *th = (struct tcphdr *) (skb_network_header(skb) + nhoff); + ip6h = ipv6_hdr(skb); diff = get_csum_diff(ip6h, p); inet_proto_csum_replace_by_diff(&th->check, skb, diff, true, true); @@ -96,6 +97,7 @@ static void ila_csum_adjust_transport(struct sk_buff *skb, (skb_network_header(skb) + nhoff); if (uh->check || skb->ip_summed == CHECKSUM_PARTIAL) { + ip6h = ipv6_hdr(skb); diff = get_csum_diff(ip6h, p); inet_proto_csum_replace_by_diff(&uh->check, skb, diff, true, true); @@ -110,6 +112,7 @@ static void ila_csum_adjust_transport(struct sk_buff *skb, struct icmp6hdr *ih = (struct icmp6hdr *) (skb_network_header(skb) + nhoff); + ip6h = ipv6_hdr(skb); diff = get_csum_diff(ip6h, p); inet_proto_csum_replace_by_diff(&ih->icmp6_cksum, skb, diff, true, true); @@ -151,6 +154,9 @@ void ila_update_ipv6_locator(struct sk_buff *skb, struct ila_params *p, break; } + ip6h = ipv6_hdr(skb); + iaddr = ila_a2i(&ip6h->daddr); + /* Now change destination address */ iaddr->loc = p->locator; } -- 2.53.0