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 C7AB61CDFAC; Sun, 7 Sep 2025 20:07:16 +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=1757275637; cv=none; b=Jp54/mUp3WLO/aRkLtFFTgAyDmP8Q94B2dZgkSzVbDpmKtqX8oCtzYB2KbKbFpQayJtL8m5oX5AkAtvlBbIhhEm4UC8YjnzaQn9PIDRA4ZceHcyyTXF3sJPatKBzmkbCza2fH093NGhWGAZFRfu6r8KfOH9zApVMyV+5m++S9ew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757275637; c=relaxed/simple; bh=oXsGc93MW3UZ0c7B/ONssOp58ynNLfvYLuZz0aLJ8K4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TZmAWYqHumD0wgHVnrSv5LX8EWp2i3GK2f843YYSLIKaYt56z7jC8r8ttuMrYCFobEt0IXfom930sQgBw2luXs52BAuIobJNztRv1w/RMpL7KrlcF9PcdAkb9WbhKjJsjlBx0e6zBNuF/YSbCzI47/yXGfJm8U3l7VdBdUlRXRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FwZajVM4; 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="FwZajVM4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCD28C4CEF0; Sun, 7 Sep 2025 20:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757275636; bh=oXsGc93MW3UZ0c7B/ONssOp58ynNLfvYLuZz0aLJ8K4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FwZajVM4zd+UWwIX8E/k6/yEJ+OTwa8mKRIv31bRVy6VAmBE7o4dhNNXiN6tYA2xe ZTCdnkQqX7CG2LA5T2rGbdFfolxeav1yQWWMk5KiP6Z6vr9RIcArK92YrvVcf0qG9C 0VeXBX8XyGvJ8pxweSnbc6oCAtqLsCQGxlrgJoV8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bernard Pidoux , Eric Dumazet , Joerg Reuter , David Ranch , Folkert van Heusden , Dan Cross , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 17/52] ax25: properly unshare skbs in ax25_kiss_rcv() Date: Sun, 7 Sep 2025 21:57:37 +0200 Message-ID: <20250907195602.492091317@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250907195601.957051083@linuxfoundation.org> References: <20250907195601.957051083@linuxfoundation.org> User-Agent: quilt/0.68 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-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit 8156210d36a43e76372312c87eb5ea3dbb405a85 ] Bernard Pidoux reported a regression apparently caused by commit c353e8983e0d ("net: introduce per netns packet chains"). skb->dev becomes NULL and we crash in __netif_receive_skb_core(). Before above commit, different kind of bugs or corruptions could happen without a major crash. But the root cause is that ax25_kiss_rcv() can queue/mangle input skb without checking if this skb is shared or not. Many thanks to Bernard Pidoux for his help, diagnosis and tests. We had a similar issue years ago fixed with commit 7aaed57c5c28 ("phonet: properly unshare skbs in phonet_rcv()"). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Bernard Pidoux Closes: https://lore.kernel.org/netdev/1713f383-c538-4918-bc64-13b3288cd542@free.fr/ Tested-by: Bernard Pidoux Signed-off-by: Eric Dumazet Cc: Joerg Reuter Cc: David Ranch Cc: Folkert van Heusden Reviewed-by: Dan Cross Link: https://patch.msgid.link/20250902124642.212705-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ax25/ax25_in.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c index cd6afe895db99..e43f92372cba5 100644 --- a/net/ax25/ax25_in.c +++ b/net/ax25/ax25_in.c @@ -433,6 +433,10 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev, int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype, struct net_device *orig_dev) { + skb = skb_share_check(skb, GFP_ATOMIC); + if (!skb) + return NET_RX_DROP; + skb_orphan(skb); if (!net_eq(dev_net(dev), &init_net)) { -- 2.50.1