From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (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 ADA983839BC for ; Wed, 8 Jul 2026 06:06:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783490802; cv=none; b=eNs3kz9iOUI8L6UHHxM02rzdVrxyGO5tzZUL5ohRMMvKUKxVdPsomxK/YlgyX5zlz1qLmyrlehEEiUCNzvVsnmO/DZ+aif5S3tPHwv8+HXj8Bo88M3EX/cg59yYSg3gzWvkLAKkrz2rFFtBZStegl0PWxOnLB9LrP5zEsBVOxHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783490802; c=relaxed/simple; bh=DrODIwvyYn9L/GKPzhvUTnULjebDwilC94nEuArScPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l+R0ZhEHuLLL756vdWve1u56LnrKWx3f7mWVu1z/96VEY4ksc0ZnQc2pNvcjGFmzGGITPz5zvHublKD6BtFVKZ3pInE/fRKPjbtEBOYycnhUrCISGOMH94Zwk58IrcKK11/AtW3MspszAQSt3B6bCTd8wjhk27TRdpF2TG410Ig= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=arP/d2S5; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="arP/d2S5" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1783490798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8fVpIZ6ugNKREnQtdLTXjerq4ghmARfupm+QFoiSfkU=; b=arP/d2S5lNGCB+VL2UegdIkjEQhuQ7TbQ31FjeBxKjhRIMBFvjS8nY4MDNLQpXssJmzMou sGFuys1Ux0NF+1PIhnvzRbw2sCUFfOTK56qqUC4nkYAIMRT0JN8FIOzz7CGI1ResH8Xcwy NcmhXqLiSq67ELxRiy/In49ZQruBR9Q= From: xuanqiang.luo@linux.dev To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Ido Schimmel Cc: Simon Horman , Kuniyuki Iwashima , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Xuanqiang Luo Subject: [PATCH net-next v3 1/2] ipv4: use rcu_assign_pointer() in rt_flush_dev() Date: Wed, 8 Jul 2026 14:05:36 +0800 Message-ID: <20260708060537.17188-2-xuanqiang.luo@linux.dev> In-Reply-To: <20260708060537.17188-1-xuanqiang.luo@linux.dev> References: <20260708060537.17188-1-xuanqiang.luo@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Xuanqiang Luo rt_flush_dev() replaces rt->dst.dev with blackhole_netdev on uncached routes. The field is also exposed as dst.dev_rcu, and existing readers use dst_dev_rcu(). Use rcu_assign_pointer() for the replacement, as dst_dev_put() already does for the same field. Signed-off-by: Xuanqiang Luo --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 3f3de5164d6e5..b668375df71e2 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1565,7 +1565,7 @@ void rt_flush_dev(struct net_device *dev) list_for_each_entry_safe(rt, safe, &ul->head, dst.rt_uncached) { if (rt->dst.dev != dev) continue; - rt->dst.dev = blackhole_netdev; + rcu_assign_pointer(rt->dst.dev_rcu, blackhole_netdev); netdev_ref_replace(dev, blackhole_netdev, &rt->dst.dev_tracker, GFP_ATOMIC); list_del_init(&rt->dst.rt_uncached); -- 2.43.0