Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp770806rdb; Fri, 2 Feb 2024 03:42:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsOEWoBTLvLnYrm5aawrdgGC9SFnu84F+610riBZIE16MhuXvJQWYauzhuHhcpQk8ALMVg X-Received: by 2002:a17:906:4bd3:b0:a31:70cc:8a0f with SMTP id x19-20020a1709064bd300b00a3170cc8a0fmr1544761ejv.12.1706874139334; Fri, 02 Feb 2024 03:42:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706874139; cv=pass; d=google.com; s=arc-20160816; b=lzM2XCJMG1USBwp/6nWlpcxRc1sKFoJVSjmgQt4utxtt60UAhXoV5PVaH1MyjH7o5x RMB+bmAjHC8O6pqspy3zoONE1re8ii18ECYRxKqALK7fF1fn5TzJkr1VjzUajcrutagX LzNJLnMf8fK9tQVdf8cmxpp6dCyWVg7xKKTj6jXwTcV9+pEgrlvY11gWvaXTWEEp8mZE DdZ62HrD8hHVZ/mVdo5FU5WK18mpT8yTVwYIv3TvXENguRYsaf3IIjM353+/RFiXrxX6 18ug2w40wN2qb/PwByNOv4FdkLDC9Fe7/8bskppyS14uiIGDA5M97ge86TDjD39WlEDN /B7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=uQkhoUeaHVSNPKj/zIJ7mbymE4LYsa8pGdtV44LYVls=; fh=dtz2Zhj3DLBY2tLkR/GTceJVEMpxxukOeQ/eSJaozFs=; b=hCGsXd7vLhZKOCYyVXFAeKRrLyTynw8t87PMiX9dRia3l/cd2y+XOhuJOxuE3pthQ6 cmgKeYlxNdUkICyZpyeRw6L4+qULzTmEckyatXpnURt+29kcHGDkzNp81Cy0D1YpyJX9 I4ODdxydNGZF+zZPrerVnhBjxsiH/NzvcnMfKnCLB+wcc3gcxbuKW5yoZxc+OSMVt7NC W1KLbw+nJzsX2LicAiZHtWMohp9zOwkTdMNzOAfWnFRAGxTDjmnxKnrB4P6Pg3BGT30G VwyjpGQi4zoOOTX/yrcv2TXIfQ3KKcaL7kSayiVcynmLmag8/+MPjNd3VVh516I+wPQQ GDbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uruEwuBz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3012-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCX5sufMh2+FOG8Cay7lAyrxUEUkV/yde27DCUAeBnbtrSRFKwzocFvg18Y3zTPhjcOggDbZyRCwkdiPjfAnxEptJtCZpETwM63jcoImOQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gy25-20020a170906f25900b00a3724c1d313si111537ejb.82.2024.02.02.03.42.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 03:42:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uruEwuBz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3012-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 10B601F2314D for ; Fri, 2 Feb 2024 11:42:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 664A01386C4; Fri, 2 Feb 2024 11:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uruEwuBz" X-Original-To: linux-wireless@vger.kernel.org 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 426D683CC7 for ; Fri, 2 Feb 2024 11:40:08 +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=1706874008; cv=none; b=kWlsHjgN3Ddm3V6XEGNyXMyxUDeHwwRvSm6sqjNG3hBKa2lAbuHWA3oifpPKYdmTr6+oll2Npbo0H6TGWWdLSmcGzvUiX//xSsItV2wO7QjJ82OrYcZwI2/KpgaRZANurbvTyPznuZukE4Qs6mCy/43weDJ/B8/+sqkEaVcpjUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706874008; c=relaxed/simple; bh=nltrT2gbTUIAfAfwQ0HWUyAFPMSVCCTAcX1rFV8pSKA=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=G1p8TGwInfCagkVsuKM1+8tSNPZqLC13N7uRQ7d/lm7uviTsN1CCt4m+xQ4ohPQQeVXukkinzwTCHvoH88bqA+WvsgOu2sXm/uitO2z7PdxpF6bGd7qg7FGvjtO34VDPZlxSu+tBSgf59L2/VWyIdfJCOajcFtFjGmqq/vlfaLs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uruEwuBz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62EEBC433C7; Fri, 2 Feb 2024 11:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706874007; bh=nltrT2gbTUIAfAfwQ0HWUyAFPMSVCCTAcX1rFV8pSKA=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=uruEwuBzr71AuA6Uv0tBEqsQ+vvAlGM4g18zpiD7l6msCeasBv+eNdajFkqJI8lNE fMpQypUt2xZE31oHpTrNMWjujR3sVa3PL6BNmTbJP0tLp/XIUq/acwd0aM9RcVzWEU XZ9+Ja0j0/sp7Adlnwh0Us2YA4x2KOQEam7B5YQZG4cK9xflvfYE7MWFWwnRRlI5Zq p4jAKMspL4HE2MTwSuBgi2f5lmyG80FaitFNUPU2VlSAHtVSSp3743leXy+VE38PK5 xKqwgLIP2YffRmGou3hfBEiUFoUhQroiMira2M8ZN/ws5laOrZUtqazgM37iDLo24x uOCZ+6FHHQewA== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] wifi: ath9k: delay all of ath9k_wmi_event_tasklet() until init is complete From: Kalle Valo In-Reply-To: <20240126140218.1033443-1-toke@toke.dk> References: <20240126140218.1033443-1-toke@toke.dk> To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Cc: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Kalle Valo , Tetsuo Handa , linux-wireless@vger.kernel.org, =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgens?= =?utf-8?q?en?= , Ubisectech Sirius User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170687400420.3200018.14639804341103572305.kvalo@kernel.org> Date: Fri, 2 Feb 2024 11:40:06 +0000 (UTC) Toke Høiland-Jørgensen wrote: > The ath9k_wmi_event_tasklet() used in ath9k_htc assumes that all the data > structures have been fully initialised by the time it runs. However, because of > the order in which things are initialised, this is not guaranteed to be the > case, because the device is exposed to the USB subsystem before the ath9k driver > initialisation is completed. > > We already committed a partial fix for this in commit: > 8b3046abc99e ("ath9k_htc: fix NULL pointer dereference at ath9k_htc_tx_get_packet()") > > However, that commit only aborted the WMI_TXSTATUS_EVENTID command in the event > tasklet, pairing it with an "initialisation complete" bit in the TX struct. It > seems syzbot managed to trigger the race for one of the other commands as well, > so let's just move the existing synchronisation bit to cover the whole > tasklet (setting it at the end of ath9k_htc_probe_device() instead of inside > ath9k_tx_init()). > > Link: https://lore.kernel.org/r/ed1d2c66-1193-4c81-9542-d514c29ba8b8.bugreport@ubisectech.com > Fixes: 8b3046abc99e ("ath9k_htc: fix NULL pointer dereference at ath9k_htc_tx_get_packet()") > Reported-by: Ubisectech Sirius > Signed-off-by: Toke Høiland-Jørgensen > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 24355fcb0d4c wifi: ath9k: delay all of ath9k_wmi_event_tasklet() until init is complete -- https://patchwork.kernel.org/project/linux-wireless/patch/20240126140218.1033443-1-toke@toke.dk/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches