From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 138122110E; Tue, 27 May 2025 17:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748365581; cv=none; b=XF3nKnF9uc/3kVR4bEikSXhK1FRreO7yvyunCgHO2/tXhYInVA1jSkFBs8OqOsHFpew8ZX38pNy+xrWQurz5kozPCuI9nokzveQ/Se1hYJlRwGcG8W2CgCqO0aQ3n2XqpILeQvdWl/DxoS7CiwqkdLgai+aE+Z0H95wLDyyJ0Pw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748365581; c=relaxed/simple; bh=WC+ST+c5xFIwO8zf+6jgsANwDU5PRATIjrmMnFQuKSE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vx8iiaE1BwL5ELvb0Cmo0q1EnZJBfeHs+g7Xo0gMtimyGEn/6iTKf61SoCgCMn5devfKwpFH+Opqm7NHVC+RB1dA4EU6Lfv+zOJVGqCoAmwU7M/Keto0XHaM1u+LPrRDlAkfr67CG23xXfFoaEVFzDRnnMoY/9w6WVWXnotP1LU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zrGqlaQU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zrGqlaQU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74436C4CEE9; Tue, 27 May 2025 17:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748365580; bh=WC+ST+c5xFIwO8zf+6jgsANwDU5PRATIjrmMnFQuKSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zrGqlaQUb29vFmLTyMq9bMq6ugC9ka1Nj+jgkPMdqdRspZmnIiyqtLRIiCA2dVT5S mCyyg2LgLAExI64qDzzD0kU/mAqRzHjEXH/FhlBXC9DheOK0A6/WgQJKAH3JA7efcy YJSFsquJBzvsB5pxx0v/ZVvy9WAK90Ycuo7qs8BY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kuniyuki Iwashima , Eric Dumazet , Ido Schimmel , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 423/626] ip: fib_rules: Fetch net from fib_rule in fib[46]_rule_configure(). Date: Tue, 27 May 2025 18:25:16 +0200 Message-ID: <20250527162502.196494967@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kuniyuki Iwashima [ Upstream commit 5a1ccffd30a08f5a2428cd5fbb3ab03e8eb6c66d ] The following patch will not set skb->sk from VRF path. Let's fetch net from fib_rule->fr_net instead of sock_net(skb->sk) in fib[46]_rule_configure(). Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Link: https://patch.msgid.link/20250207072502.87775-5-kuniyu@amazon.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv4/fib_rules.c | 4 ++-- net/ipv6/fib6_rules.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index b07292d50ee76..4563e5303c1a8 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c @@ -245,9 +245,9 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, struct nlattr **tb, struct netlink_ext_ack *extack) { - struct net *net = sock_net(skb->sk); + struct fib4_rule *rule4 = (struct fib4_rule *)rule; + struct net *net = rule->fr_net; int err = -EINVAL; - struct fib4_rule *rule4 = (struct fib4_rule *) rule; if (!inet_validate_dscp(frh->tos)) { NL_SET_ERR_MSG(extack, diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 04a9ed5e8310f..29185c9ebd020 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c @@ -365,9 +365,9 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, struct nlattr **tb, struct netlink_ext_ack *extack) { + struct fib6_rule *rule6 = (struct fib6_rule *)rule; + struct net *net = rule->fr_net; int err = -EINVAL; - struct net *net = sock_net(skb->sk); - struct fib6_rule *rule6 = (struct fib6_rule *) rule; if (!inet_validate_dscp(frh->tos)) { NL_SET_ERR_MSG(extack, -- 2.39.5