From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 4B4B1419FC1 for ; Mon, 20 Jul 2026 12:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784551711; cv=none; b=jPyqjBhxIoQjAwW3dc1FE3szGmq41/0pu/shkLyQXf40auuiDCfVeIh0vcnSxfUtfus07SAPhOfbQcwb7wqnThp2WjlKNfi1/PdcZFQf1VxUo3QZRlqv3yzT4ruPmQc72gUMz3JYV1/SSuwVjPR0s+dr4mxQk0BzRvPUeaoATlA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784551711; c=relaxed/simple; bh=N+9ZTE+CayXuFy5Id8G4dwE2VT+tccB0IvDa7S0SoEM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SHw8Q+NWE78EAmzCz0EWMoRvcQSmzWxOX0eCRFh9X1ja7zKh4Htfx5U4EhJe5XTP/QujOmK731zJ78JFG3+Cp8e8RKOJD4aM9ZYde0MMaDmKeMCK1P7DONH5zcSlO/PC61obRcvWscV2kXS9oTiVaHUzY7WbV8YcbMxARdA8CSc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b=eUYr3WeE; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b="eUYr3WeE" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2ccdb73f0e1so59794485ad.3 for ; Mon, 20 Jul 2026 05:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20251104.gappssmtp.com; s=20251104; t=1784551710; x=1785156510; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ddopxXSq+Kxxg3/7llv7uobPDFFxIZ93j3ihboSU6WM=; b=eUYr3WeEmcBBtngiiLo6kxI9d88a9hzbgIRU/Dwble8XPL1pHmh0bPUxk7kZNSYkvr 1MZ4YOcqW5QGClg5bfTabbbiR0uWVRdRiOxXQFFBOuvuYFAvmo9TVbdqi4A3T8rAVu2P 2Cd5NkRM4R6aDOM3CbdgjA1JYrjI7Hg6FUry2+gGPsaGJdDm1Isxq8IgvetaYUXu+RbO 3QjIQ1++/RcJgJDfIWV/4fPXHTkG/scKI5upWraeAQwOfGeZK3pOGzDuRxV1G3wfCWSk oIVSJbqUCFt2dXId/HwQTSarmZVWctcW8qGCVRj7w4HjkgHhBu25JaYndmuFqPGP/iXe 8BqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784551710; x=1785156510; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ddopxXSq+Kxxg3/7llv7uobPDFFxIZ93j3ihboSU6WM=; b=VEkpi6PeuCRU38R6IobRTh9c9v1E9cByP9MMqqC9QDQtIOCJHxXwMkDULPSnzL8Y1/ /G8vAG2e//lHKsQmGogu9MdFW41Egp55SM7uVjwYQnFqzRDz//i1UAnJpy2bsabeRvwQ 4pV5XA1hn/zCgweutxVe2GalKL9DmNvzMSPWSUpInMIlJI/sXHCydSfnFIlA0+q2NZuD QrCsHLtfXNRflJONiBfEbPq1u4LXhTO7VuH4uZe8xPzds0zWllqkmbwuOCh0d9XpTqo3 ciEF78E7wbbJ5cY4qOIY0TknRyieXVuJrYzBlsuGhJam6uz0eexRmUn3OF80vUPCiAsw 5Xaw== X-Forwarded-Encrypted: i=1; AHgh+RpYmr0isZ1FsE5GeZeXDQZuEZOCpm/rRfZdEDlFBxb52CDM+A167/8x8DDwwb0tg78KSop1nhhwtf0pbqc=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3woBUC1EiYlPrqjqdRfC6Rrw8jp+ribaad9bgq0Mt7EDDZh/Y v7gr+IimdnbmZfEEIPEpVlLXLa/kt2esNKDWKXhYuEgoaG0DWbQ2yuSba/6ZeYoTBwE= X-Gm-Gg: AR+sD13MaPgH2NEcMkRBk/+iMxONouC2zirN23o79p91kvlgo58L8/wN4gXBJFPkM1z yZU7mDJSVeUmlz/xqh91fSCP4xXmLdUyd9lJGZXvacsl/KWlBdBSLPVmix8f0lJIKtGrfYYkHDf ee/1gRYIvGmE6+g4wpWfJO69rdyD7sklGsIljFKRSdlS43HLxwPG8Aj/A8pwCo/1u5W6oe2N+d9 g4YffpvQO+65+VHD/XHy/Vz6vQsAxHJHflj/g1IScHCFvRbS/5P5P+ChCm3lO5oAS/qAEuOM/LA suXCKRrAjDoTssKayxNUFm4IzVDXPU5yZ6E3BBSH51ezf9BX+t9CvLYTTlE5xChQx1s4jM4n2x9 HAjDOeiSOlBBsj2DBqPQBC4CSq+kn2Rrxu1dr4azVrBE6U8AOn/kA+Ace7mLAvP6ktjiF X-Received: by 2002:a17:903:291:b0:2c9:d8c6:1db8 with SMTP id d9443c01a7336-2cf3496c0c1mr141277275ad.28.1784551709723; Mon, 20 Jul 2026 05:48:29 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:3::]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf346d9f9dsm57557185ad.41.2026.07.20.05.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 05:48:29 -0700 (PDT) Date: Mon, 20 Jul 2026 05:48:28 -0700 From: Joe Damato To: lirongqing Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Kuniyuki Iwashima , Willem de Bruijn , Kees Cook , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: ipv6: fix dif and sdif mismatch in raw6_icmp_error Message-ID: Mail-Followup-To: Joe Damato , lirongqing , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Kuniyuki Iwashima , Willem de Bruijn , Kees Cook , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260717143230.1836-1-lirongqing@baidu.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260717143230.1836-1-lirongqing@baidu.com> On Fri, Jul 17, 2026 at 10:32:30PM +0800, lirongqing wrote: > From: Li RongQing > > In raw6_icmp_error(), raw_v6_match() is called with inet6_iif(skb) passed > to both the 'dif' and 'sdif' arguments. This is a copy-paste or typo error, > as the last argument should represent the secondary interface index (sdif). > > This mismatch breaks ICMPv6 error handling for IPv6 raw sockets in VRF > (Virtual Routing and Forwarding) environments. When a raw socket is bound > to a VRF master device, raw_v6_match() fails to find a match because it is > not given the correct sdif value, causing the socket to miss relevant > ICMPv6 error notifications. > > Fix this by properly passing inet6_sdif(skb) as the last argument to > raw_v6_match(). > > Fixes: 5108ab4bf446fa ("net: ipv6: add second dif to raw socket lookups") > Signed-off-by: Li RongQing > --- > net/ipv6/raw.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c > index 3cc5869..b88d364 100644 > --- a/net/ipv6/raw.c > +++ b/net/ipv6/raw.c > @@ -349,7 +349,7 @@ void raw6_icmp_error(struct sk_buff *skb, int nexthdr, > const struct ipv6hdr *ip6h = (const struct ipv6hdr *)skb->data; > > if (!raw_v6_match(net, sk, nexthdr, &ip6h->saddr, &ip6h->daddr, > - inet6_iif(skb), inet6_iif(skb))) > + inet6_iif(skb), inet6_sdif(skb))) Looking at the commit under fixes, this does look like a copy/paste bug to me. I wonder if a future contribution would be a test to exercise this path? Reviewed-by: Joe Damato