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 AE022362138; Tue, 16 Dec 2025 12:22:28 +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=1765887748; cv=none; b=bV7PHIPuQ7mS8UIkM83E1yD8fCUEg1q1S+cHKEx8CmwiftlE0U6zbgtmB6jhYFDkBw5b3X2ZsFmw6Z6OGJwdHfQ7g+KYMvDv3ermjzAR0515vNaGETrukUbyqdv4YczNz/0CFc4OAtd6dJN4BpJ4nSvAB9+7d7ELNDz13z/JZic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765887748; c=relaxed/simple; bh=c6iG8sWIoX43O3+xsVVbIW+6oi6p2pV0iMC0YV0+JlI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rO9oJf2MNF0ov1XUzhCNq9D44KBy3mmakR6EyP5wPvJN2aq3VHRp5bJCT6VApykjF8nkGvIZpw6/Wv+dS9glSicH5BpPA6Oaxg/jY7Y4ufky41YUhYZ2yxGYVLeKLFBynI7SAUAndvphCf4lcn0T10vrIsSX2Np8K1+JZczMfu8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=e7HMfPO+; 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="e7HMfPO+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF649C4CEF1; Tue, 16 Dec 2025 12:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765887748; bh=c6iG8sWIoX43O3+xsVVbIW+6oi6p2pV0iMC0YV0+JlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e7HMfPO+1QxFLxxX+YYlsgEOzZm0KuhLR30qO1GKP6YyXOE2bbG20OypR3wbftJVG zfgtMFjWy/2g9+5yDHshiDPrePbBe8vgmxzoAqs2VQZugXjpR1QOe+R0UB55oHD0Go R+L+FRMXoQb2AUF2JT/qmNrVtNu1AX/r/zpGdU/E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Garri Djavadyan , Fernando Fernandez Mancera , David Ahern , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 326/614] ipv6: clear RA flags when adding a static route Date: Tue, 16 Dec 2025 12:11:33 +0100 Message-ID: <20251216111413.177837444@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251216111401.280873349@linuxfoundation.org> References: <20251216111401.280873349@linuxfoundation.org> User-Agent: quilt/0.69 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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fernando Fernandez Mancera [ Upstream commit f72514b3c5698e4b900b25345e09f9ed33123de6 ] When an IPv6 Router Advertisement (RA) is received for a prefix, the kernel creates the corresponding on-link route with flags RTF_ADDRCONF and RTF_PREFIX_RT configured and RTF_EXPIRES if lifetime is set. If later a user configures a static IPv6 address on the same prefix the kernel clears the RTF_EXPIRES flag but it doesn't clear the RTF_ADDRCONF and RTF_PREFIX_RT. When the next RA for that prefix is received, the kernel sees the route as RA-learned and wrongly configures back the lifetime. This is problematic because if the route expires, the static address won't have the corresponding on-link route. This fix clears the RTF_ADDRCONF and RTF_PREFIX_RT flags preventing that the lifetime is configured when the next RA arrives. If the static address is deleted, the route becomes RA-learned again. Fixes: 14ef37b6d00e ("ipv6: fix route lookup in addrconf_prefix_rcv()") Reported-by: Garri Djavadyan Closes: https://lore.kernel.org/netdev/ba807d39aca5b4dcf395cc11dca61a130a52cfd3.camel@gmail.com/ Signed-off-by: Fernando Fernandez Mancera Reviewed-by: David Ahern Link: https://patch.msgid.link/20251115095939.6967-1-fmancera@suse.de Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv6/ip6_fib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 02c16909f6182..2111af022d946 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -1138,6 +1138,10 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt, fib6_set_expires(iter, rt->expires); fib6_add_gc_list(iter); } + if (!(rt->fib6_flags & (RTF_ADDRCONF | RTF_PREFIX_RT))) { + iter->fib6_flags &= ~RTF_ADDRCONF; + iter->fib6_flags &= ~RTF_PREFIX_RT; + } if (rt->fib6_pmtu) fib6_metric_set(iter, RTAX_MTU, -- 2.51.0