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 9B88E223DEF; Mon, 23 Jun 2025 22:08:59 +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=1750716539; cv=none; b=jgpnfZwobZTdhpmIvkGOS4v9c6OKDGYhp16th3skhYVOeGg6ezEAdruzYbtbxBWBa2wKQesvpXpuLM6vBVY6ZvcPZr5dYHXeX55TUjGHcGotUC8ZRn0qyzs2cxjYZnSnqx8qfbiTUdkh7N7Gb+YuT8ED3HgWLUz1GlYc0e99b3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750716539; c=relaxed/simple; bh=YSB6eIPT1/A+2f+BCPKHa3485BS8D7CBEb8sOWdrJ6w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bT4euv2v92ihk41QKR8D1SPDecho5FbiYjGVZK25yEfylpWx40/VzVxoTWhf7FmzeunEZsICWvbofHZyLVhKTPo2rzN+tAL9Cn1PPhQb7ePUT9Urw5fuxlLB98Xy7ont4vtOwcr/g3rh03bm1tOAHc+CLDHZq6UjkjxgndvuMzU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZFfwoeLJ; 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="ZFfwoeLJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3304FC4CEEA; Mon, 23 Jun 2025 22:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750716539; bh=YSB6eIPT1/A+2f+BCPKHa3485BS8D7CBEb8sOWdrJ6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZFfwoeLJpIrG4lbwmzlohdXtxkFb5oGV0A4T23jXX8yd68Tikwn07M58bEUn0wI7T GtaBPdpKepOPVGyXjW3OQM31mcnyzYOVLemZjE2n65FiPgkJWJe/QnQjOSaA3WBxHQ b6ahqU5YlG5laxO5Po06pQ99ETpsmACldp1EBR8M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Antipov , Christian Lamparter , Jeff Johnson , Sasha Levin Subject: [PATCH 6.15 537/592] wifi: carl9170: do not ping device which has failed to load firmware Date: Mon, 23 Jun 2025 15:08:15 +0200 Message-ID: <20250623130713.209520699@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130700.210182694@linuxfoundation.org> References: <20250623130700.210182694@linuxfoundation.org> User-Agent: quilt/0.68 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Antipov [ Upstream commit 15d25307692312cec4b57052da73387f91a2e870 ] Syzkaller reports [1, 2] crashes caused by an attempts to ping the device which has failed to load firmware. Since such a device doesn't pass 'ieee80211_register_hw()', an internal workqueue managed by 'ieee80211_queue_work()' is not yet created and an attempt to queue work on it causes null-ptr-deref. [1] https://syzkaller.appspot.com/bug?extid=9a4aec827829942045ff [2] https://syzkaller.appspot.com/bug?extid=0d8afba53e8fb2633217 Fixes: e4a668c59080 ("carl9170: fix spurious restart due to high latency") Signed-off-by: Dmitry Antipov Acked-by: Christian Lamparter Link: https://patch.msgid.link/20250616181205.38883-1-dmantipov@yandex.ru Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/carl9170/usb.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index a3e03580cd9ff..564ca6a619856 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c @@ -438,14 +438,21 @@ static void carl9170_usb_rx_complete(struct urb *urb) if (atomic_read(&ar->rx_anch_urbs) == 0) { /* - * The system is too slow to cope with - * the enormous workload. We have simply - * run out of active rx urbs and this - * unfortunately leads to an unpredictable - * device. + * At this point, either the system is too slow to + * cope with the enormous workload (so we have simply + * run out of active rx urbs and this unfortunately + * leads to an unpredictable device), or the device + * is not fully functional after an unsuccessful + * firmware loading attempts (so it doesn't pass + * ieee80211_register_hw() and there is no internal + * workqueue at all). */ - ieee80211_queue_work(ar->hw, &ar->ping_work); + if (ar->registered) + ieee80211_queue_work(ar->hw, &ar->ping_work); + else + pr_warn_once("device %s is not registered\n", + dev_name(&ar->udev->dev)); } } else { /* -- 2.39.5