From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46669C43334 for ; Wed, 15 Jun 2022 09:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344817AbiFOJQf (ORCPT ); Wed, 15 Jun 2022 05:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231807AbiFOJQd (ORCPT ); Wed, 15 Jun 2022 05:16:33 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 891433DA4C; Wed, 15 Jun 2022 02:16:32 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 47C3821A3F; Wed, 15 Jun 2022 09:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655284591; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ZcOSVIy2IYZ+NTQLGeK5IaHYyVe6mb21WziygQ/JdE=; b=ivXuKQOt2ASufQ9N8yZ+d9uNioSs4pxBfVMAt+xq3bEhbPpNQJqppx74oP8SRJAVubTgfE TkjWKrGPOTD5tvvqIJFSPvKDF26FzJn+VIuVfMVXOoTRCRJ5uHwC4HJ4Yeuez9vizOLcy2 DHno+cvMgYDK3fneOYH0/7zG6APFjsY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655284591; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ZcOSVIy2IYZ+NTQLGeK5IaHYyVe6mb21WziygQ/JdE=; b=DAjudf6hgatktErTsk86WJzIEr3j+bLvVJj9IjQS0X7yZWO6aIIbh+gTHsU/NFXIalfjmx P6Hw3XECxL4IgFDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1A22E139F3; Wed, 15 Jun 2022 09:16:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LdDeBG+jqWI1OQAAMHmgww (envelope-from ); Wed, 15 Jun 2022 09:16:31 +0000 Date: Wed, 15 Jun 2022 11:16:30 +0200 Message-ID: <87sfo64781.wl-tiwai@suse.de> From: Takashi Iwai To: Toke =?ISO-8859-1?Q?H=F8iland-J=F8rgensen?= Cc: Kalle Valo , 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 In-Reply-To: <87tu8mxpnz.fsf@toke.dk> References: <87o7yvzf33.fsf@toke.dk> <87k09ipfl9.fsf@kernel.org> <87tu8mxpnz.fsf@toke.dk> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 15 Jun 2022 11:05:20 +0200, Toke Høiland-Jørgensen wrote: > > Kalle Valo writes: > > > Toke Høiland-Jørgensen 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 = 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=6ead44e37afb6866ac0c7dd121b4ce07cb665f60 [0] > >>> Link: https://syzkaller.appspot.com/bug?id=b8101ffcec107c0567a0cd8acbbacec91e9ee8de [1] > >>> Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.") > >>> Reported-and-tested-by: syzbot+03110230a11411024147@syzkaller.appspotmail.com > >>> Reported-and-tested-by: syzbot+c6dde1f690b60e0b9fbe@syzkaller.appspotmail.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øiland-Jørgensen > > > > 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. > > 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. 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. thanks, Takashi