From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 D59A43537C4 for ; Thu, 28 May 2026 07:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779954873; cv=none; b=idyKrhFbnJ5Z4sFXq50mMJaJpYF++/gQv/+x/PNAX1sRg9gjjBBMZQJKfGq0oqTRA4ndlSL9zO/RVNc4VlvLjCTc+YKDBuvqpaVgVauICPh8q41fHJFaSjC9vFu2bis2r6YCXbSbrk5s6lvA18N93FUOIueUJMvbQXeIND8QGCQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779954873; c=relaxed/simple; bh=rdRDQkmaVFmdLTCR3dVp7XEULWMy7/tmwIju35YRIbE=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=ZiD1RSMrJOZyaBoEeNAuBYtjg0m+uDIZiPJ7+6uZgpzmq5nQqNHiFP1c63du6HBl/w7QnLWnxr0L+VeuYhYeczjRWBcVynkqE7kEx/6zg3gQNMfCSprYYv1ZhmlATYVS/AzwKdmIjbugg5VZgHZZw7gHY8kYlm+CkBqnvGlUD24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=joaK1iRt; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="joaK1iRt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08BE21F00A3A; Thu, 28 May 2026 07:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779954871; bh=xMVx8WIdapF8/gh82LUf9ZxB3qtiie4ZrgdGi2aAaxI=; h=Subject:To:Cc:From:Date; b=joaK1iRtfD/ddCh2wWw9xxHPvpFel8cDJzFyPMP44Enujdm06hdlsu2mW4R6VC976 8Tt0pg8e4bJN3FcsH1ukUFUSDWSd24ptq3JoIvBllDNcU5dmL5waawTg/SDdxyPY82 VyJdAx3nTv48YeXiJsGOj4spCVsvzzEcxBC+5jOE= Subject: FAILED: patch "[PATCH] net: hsr: defer node table free until after RCU readers" failed to apply to 6.18-stable tree To: michael.bommarito@gmail.com,kuba@kernel.org Cc: From: Date: Thu, 28 May 2026 09:53:38 +0200 Message-ID: <2026052838-cleat-rewrite-24c4@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x aaec7096f9961eb223b5b149abe9495525c205d9 # git commit -s git send-email --to '' --in-reply-to '2026052838-cleat-rewrite-24c4@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From aaec7096f9961eb223b5b149abe9495525c205d9 Mon Sep 17 00:00:00 2001 From: Michael Bommarito Date: Wed, 13 May 2026 19:38:38 -0400 Subject: [PATCH] net: hsr: defer node table free until after RCU readers HSR node-list and node-status generic-netlink operations run under rcu_read_lock(). They walk hsr->node_db through hsr_get_next_node() and hsr_get_node_data(), but RTM_DELLINK teardown removes the same node table with plain list_del() and frees each node immediately. That lets a generic-netlink reader hold a struct hsr_node pointer across hsr_dellink(). In a KASAN build, widening the reader window after hsr_get_next_node() obtains the node reproduces a slab-use-after-free when the reader copies node->macaddress_A; the freeing stack is hsr_del_nodes() from hsr_dellink(). Use list_del_rcu() and defer the free through the existing hsr_free_node_rcu() callback. This matches the lifetime rule used by the HSR prune paths, which already delete nodes with list_del_rcu() and call_rcu(). Fixes: b9a1e627405d ("hsr: implement dellink to clean up resources") Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: Michael Bommarito Link: https://patch.msgid.link/20260513233838.3064715-2-michael.bommarito@gmail.com Signed-off-by: Jakub Kicinski diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 124619920d38..b514e43766ef 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -163,8 +163,8 @@ void hsr_del_nodes(struct list_head *node_db) struct hsr_node *tmp; list_for_each_entry_safe(node, tmp, node_db, mac_list) { - list_del(&node->mac_list); - hsr_free_node(node); + list_del_rcu(&node->mac_list); + call_rcu(&node->rcu_head, hsr_free_node_rcu); } }