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 8F893314A90; Thu, 2 Jul 2026 16:35:27 +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=1783010128; cv=none; b=lHl3I6XNYPEHftfS5EnZEECAZUeUDQ/P2aEH8yUQbGVDW05c+rnu+lrYjpcXuRtjKlqAD4lSlgSfJbDfXx27hNCivvPQEc5VMmbg1aOG/6sMIYD0jKmlPbCV0dRS6lQtbsg3f0jLjyJKKkEGCEyzTqPehhEq5FEaUjlnguMhv8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010128; c=relaxed/simple; bh=wfeVBR07P6agI+IVkKR9LINq32ockAwHSYpJY9rrP40=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bgVmFq5l3wgfZh+r6kM4Oq86z1FTt+qMbny7XfyaQZUI8TxlSGIbj+YB50MVAprzqNOSAKd/oW58xQ5dhwDknw9Rx9MGn9B3Cap/EnbJN08+kKlqvJft7/B4pAnv0HU6HNsVbLxUa68hSQr0K/9JKNyT3wGQFLSpt2O0tMvQeq0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=u4dOecMS; 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="u4dOecMS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 015C71F000E9; Thu, 2 Jul 2026 16:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783010127; bh=Zbgpa6sOJEGvEABzRSAUNjHCfwmONOOFO7iNkVK4Fc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=u4dOecMSFV9BfN8UetvFyMyfXrDRUJ4fM/5WsPnKuXMFM7vZvcsFCjy3GYaw0oRQm TDkR0e3EzK7usu3RAUkqNFdxj5WYHNRyOpefY6wZ5DRVYK/vdaEl7zvpGawXMlZJh3 MuQ3KKTOISJYdcJTHCNTTdB9d+ugq+bs9aepk0BQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Santosh Kalluri , =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 122/129] net: phonet: free phonet_device after RCU grace period Date: Thu, 2 Jul 2026 18:20:41 +0200 Message-ID: <20260702155114.673182064@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155112.163984240@linuxfoundation.org> References: <20260702155112.163984240@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Santosh Kalluri [ Upstream commit 71de0177b28da751f407581a4515cf4d762f6296 ] phonet_device_destroy() removes a phonet_device from the per-net device list with list_del_rcu(), but frees it immediately. RCU readers walking the same list can still hold a pointer to the object after it has been removed, leading to a slab-use-after-free. Use kfree_rcu(), matching the lifetime rule already used by phonet_address_del() for the same object type. Fixes: eeb74a9d45f7 ("Phonet: convert devices list to RCU") Cc: stable@vger.kernel.org Signed-off-by: Santosh Kalluri Acked-by: Rémi Denis-Courmont Reviewed-by: Simon Horman Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/phonet/pn_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -105,7 +105,7 @@ static void phonet_device_destroy(struct for_each_set_bit(addr, pnd->addrs, 64) phonet_address_notify(net, RTM_DELADDR, ifindex, addr); - kfree(pnd); + kfree_rcu(pnd, rcu); } }