Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2666410iog; Mon, 20 Jun 2022 01:55:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sTydAaaQ3RnUU3yrTVtjFkqItRdUoy+RXHP3qtA475CElOXlr46twfzyfosUC/2dUJtf6z X-Received: by 2002:a17:906:b18f:b0:716:89ce:a724 with SMTP id w15-20020a170906b18f00b0071689cea724mr19655145ejy.390.1655715328745; Mon, 20 Jun 2022 01:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655715328; cv=none; d=google.com; s=arc-20160816; b=hQwYmlQdtSTyMRHcuNZp+9yFPULhtNJ026rD1IHugAXO6YUeB6oNsSs5RroToicsDG 4s7I5/fwRAC382bSCBkibY+JDDHxbzDHv01ZLHbbvyb2MLw6bOyn8t4eREgW+Q0kkGhl vATN4yq7tkB5/xB0nrX8ibli7w1Myh9z1Bf1Eh023Zvs2bMgpQ66fVTV+sIfpEwytBIk QG44y15xgrvRkUoQWKlnicKM0Odg8wzgh8DsOMoMKzwyiwtYIBjU//24OGcLa7dKrk9j BCla2nLGn5eH91NF6moaxBz6PjMso6Hg6AsZnnX++XZTCCogR0/Ppla0cON1iZW6ts/U hU5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=lDN7OnQm3ysfHYPPVBu9Gv6tavMKxbTuYdkBO7H9JHs=; b=z7qhFcdIg1sQqQUKrKkppn+ETY2GNDhALX/PjEJfBqgFklI/y/DQ+sUFhIN1rRWScv 9HLh7jF1r1GGe2L08BMgOn7nX36eWvdmYdkPkqmssCvamc0die3ENLWCBd1IVtj7xLbm oWf9QnN7q7nyQcThMjtE8tz8zLhErp2ZVqQra4ab5Nlb+7q9nbMkxlPX4EGn+iXaSxwH M6RMy3MOwGkV1Rltky6BrANgKH/uNOqLoG7mlMP8ElVZkU+Dl5gWkFiRUmBUY6Ttu2R0 t6OAj+dGER9geZvxQqGDiFKMROgznXTvceXiHnv4E9z/BVnT3/gA59M1R0F58MqSkh5L u+zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Op8zM9P/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs32-20020a1709072d2000b0070950fa092fsi13114492ejc.290.2022.06.20.01.55.06; Mon, 20 Jun 2022 01:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Op8zM9P/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239972AbiFTIxi (ORCPT + 65 others); Mon, 20 Jun 2022 04:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240196AbiFTIxY (ORCPT ); Mon, 20 Jun 2022 04:53:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 960C925C0; Mon, 20 Jun 2022 01:53:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E0F3C6134C; Mon, 20 Jun 2022 08:53:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24B57C3411B; Mon, 20 Jun 2022 08:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655715202; bh=Rrqd1Yeke98p15uktS2BzGKl4OkqQfza+QpFIGTBpRE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Op8zM9P/al2z9e+G1jsHtyPvmo5WIqnXNPn/l3NobkVMpcPyvbGWPDxWAWLzhyGrC Nf6dZ2TSGILkxo4B7YdgI3729UKmQr1rKJyf89Igq6uyhVENRBmUgEH3c5xMtdwpxD NgueBui4tIHcyh7v6FEEGibj/XxDcxS0a4/ar8732KL/j6tnHaSXq/Ke0scc7T8u/A lKK2bt0AhsDtOeGQ0W6fdnYqfwnnng4/4Qg3uYblABuLkNcy6CRtQs50sLQadcWoZz /jzXFfCgpPjPY31NJRSrH2nClnB3fv2TMNx5bFlaw+C6Oj+fqf766A5HZD6s+8b11F JaIkMrilWgYjg== From: Kalle Valo To: Takashi Iwai Cc: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , Pavel Skripkin , davem@davemloft.net, kuba@kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+03110230a11411024147@syzkaller.appspotmail.com, syzbot+c6dde1f690b60e0b9fbe@syzkaller.appspotmail.com Subject: Re: [PATCH v6 1/2] ath9k: fix use-after-free in ath9k_hif_usb_rx_cb References: <87o7yvzf33.fsf@toke.dk> <87k09ipfl9.fsf@kernel.org> <87tu8mxpnz.fsf@toke.dk> <87sfo64781.wl-tiwai@suse.de> Date: Mon, 20 Jun 2022 11:53:17 +0300 In-Reply-To: <87sfo64781.wl-tiwai@suse.de> (Takashi Iwai's message of "Wed, 15 Jun 2022 11:16:30 +0200") Message-ID: <87fsjzpvgi.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Takashi Iwai writes: > On Wed, 15 Jun 2022 11:05:20 +0200, > Toke H=C3=B8iland-J=C3=B8rgensen wrote: > >>=20 >> Kalle Valo writes: >>=20 >> > Toke H=C3=B8iland-J=C3=B8rgensen writes: >> > >> >> Pavel Skripkin writes: >> >> >> >>> Syzbot reported use-after-free Read in ath9k_hif_usb_rx_cb() [0]. The >> >>> problem was in incorrect htc_handle->drv_priv initialization. >> >>> >> >>> Probable call trace which can trigger use-after-free: >> >>> >> >>> ath9k_htc_probe_device() >> >>> /* htc_handle->drv_priv =3D priv; */ >> >>> ath9k_htc_wait_for_target() <--- Failed >> >>> ieee80211_free_hw() <--- priv pointer is freed >> >>> >> >>> >> >>> ... >> >>> ath9k_hif_usb_rx_cb() >> >>> ath9k_hif_usb_rx_stream() >> >>> RX_STAT_INC() <--- htc_handle->drv_priv access >> >>> >> >>> In order to not add fancy protection for drv_priv we can move >> >>> htc_handle->drv_priv initialization at the end of the >> >>> ath9k_htc_probe_device() and add helper macro to make >> >>> all *_STAT_* macros NULL safe, since syzbot has reported related NULL >> >>> deref in that macros [1] >> >>> >> >>> Link: https://syzkaller.appspot.com/bug?id=3D6ead44e37afb6866ac0c7dd= 121b4ce07cb665f60 [0] >> >>> Link: https://syzkaller.appspot.com/bug?id=3Db8101ffcec107c0567a0cd8= acbbacec91e9ee8de [1] >> >>> Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.") >> >>> Reported-and-tested-by: syzbot+03110230a11411024147@syzkaller.appspo= tmail.com >> >>> Reported-and-tested-by: syzbot+c6dde1f690b60e0b9fbe@syzkaller.appspo= tmail.com >> >>> Signed-off-by: Pavel Skripkin >> >> >> >> Alright, since we've heard no more objections and the status quo is >> >> definitely broken, let's get this merged and we can follow up with any >> >> other fixes as necessary... >> >> >> >> Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen >> > >> > I'm wondering should these go to -rc or -next? Has anyone actually >> > tested these with real hardware? (syzbot testing does not count) With >> > the past bad experience with syzbot fixes I'm leaning towards -next to >> > have more time to fix any regressions. >>=20 >> Hmm, good question. From Takashi's comment on v5, it seems like distros >> are going to backport it anyway, so in that sense it probably doesn't >> matter that much? > > Well, it does matter if it really breaks things, of course ;) > >> In any case I think it has a fairly low probability of breaking real >> users' setup (how often is that error path on setup even hit?), but I'm >> OK with it going to -next to be doubleplus-sure :) > > Queuing to for-next is fine for us. Backporting immediately or not > will be a decision by each distro, then.=20 > > OTOH, if anyone has tested it beforehand on a real hardware and > confirmed, at least, that it works for normal cases (no error path), > that should suffice for -rc inclusion, too, IMO. Ok, I'll take these to -next then. I just don't like taking untested patches, having them -next gives us more time to fix any issues (or revert the patches). --=20 https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatc= hes