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 7837C2253F2; Mon, 2 Jun 2025 15:12:33 +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=1748877153; cv=none; b=a5ZMchR1v3HNNjjT1tD1d70zj1PGDNjikyMZ9rul5idU2iNBbtNMLL97mXtH7bKj3EQOZ3oC7B8jcVOwiRz2xjRbFhRUK7qmTS1hBy4rmifr55xgm60sUiwq1trMuXMPfN2RRbbhHCZJD4uMkad5l1qisZmYSiacQMJko8TpREo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748877153; c=relaxed/simple; bh=XRMj266sBHV4wmBnaFaUhOvtdugh7QrcZuvN+7zGanU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WwcR70n1/4ajayqBbthlHY6BKR9HlGT/EMmJX/SispOzY8iczBkeie5FEI7+4+R9O8XlH+4sJ/OkchzZZwO21ff5bKGF33AyMLllKLW8hR/4tkzCEAC5ndEsP2gbbRVlkXcLYK2UvYpENuaKh1qFzv7eaITmV5FLW9GyGyEmtjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ohutic85; 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="Ohutic85" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A257C4CEEB; Mon, 2 Jun 2025 15:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748877153; bh=XRMj266sBHV4wmBnaFaUhOvtdugh7QrcZuvN+7zGanU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ohutic852MoLQvxwaULXuhUvgQVvEjGAEWNp49NYKZe1J0LTKD97OOZJM7eZ58RZV jlnveZ8E4BiU7VwAklZWuk1tiJMrN4gcnkgetUC8g0vpnBqFmo/2T/BOMIGE6OLT2j VrYqEpZU9elKTKwgorutbB67oA3ojXXnaN0uQQbc= 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.1 189/325] ip: fib_rules: Fetch net from fib_rule in fib[46]_rule_configure(). Date: Mon, 2 Jun 2025 15:47:45 +0200 Message-ID: <20250602134327.488506206@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134319.723650984@linuxfoundation.org> References: <20250602134319.723650984@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.1-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 513f475c6a534..298a9944a3d1e 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c @@ -222,9 +222,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 6eeab21512ba9..e0f0c5f8cccda 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c @@ -350,9 +350,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