Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp297434iog; Wed, 15 Jun 2022 02:27:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t0mOFaEX16mJW4F6OTL5E8HDcnHJZKau6LJOy9F2/nwEtn1jDygUE3l7yMfDFyzVOtQbQv X-Received: by 2002:a63:9345:0:b0:408:c3a3:ff7a with SMTP id w5-20020a639345000000b00408c3a3ff7amr2550406pgm.522.1655285254621; Wed, 15 Jun 2022 02:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655285254; cv=none; d=google.com; s=arc-20160816; b=wlIeNPWz38aqM9g1a4mhmHMJZHL6BPI4VxKotRGoM3MzjviQeqBLmTQETNkC2roGIP OuIv4aaUjViOF/fVJ4XZjsfDhgQJOzXOzsIMbQ74xuazz/31LZyVhD264k9++Xym0iJ/ IjwLNkkdJHttLaAPaAB8jZG/zQckhXpHpPuGB++PEA6CB4OvXQUyvrOn3BdA3TOWmcJM 3NR6I4R1/pFOrGkzvyHwXP76vxsoTyqCxmoGZC43Np+PVH2tRFFHKC0GWTpWPe0OD1ef snX1l9WDq9yYnMhSWCJ884hr7iUxRp/L4n9Brn2BPvfZv9clh5c//+FwZmTbWGerPfh+ lKqA== 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:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature:dkim-signature; bh=3ZcOSVIy2IYZ+NTQLGeK5IaHYyVe6mb21WziygQ/JdE=; b=oVAnC+ZLntEIKzlbHANC0f6bOEk1MgaDJA+xYsVX1wjAYz21hS85O+KS8MPhf8m2Yt 8zqC7TgLUtvCkBGv1JK6RKELUmcAmJS+Ml4NzBNCJL41lDfOAZ5P2s1c94dofPJdkXqR 0UMBCRsNNhopflp/BKhfUlMs7kly3aTktGc2ZExDUcFRLitCOWRlz70dlB/xd0UYWFg/ rHw5ZsHxECjIxe2bv1UDrm4DUxLVvVLwndxVorzS+RQQ2AxCauz9RZ5kVjgpoYiaDlgX ac0QD6N3IaFtIapgTTGd9wo8N6xj4NX8LQIX6q1h7jhU0OjFTPQZ2PkGpLQQweSmRsao JPmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ivXuKQOt; dkim=neutral (no key) header.i=@suse.de header.b=DAjudf6h; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l191-20020a6388c8000000b00408c58bbd93si2033678pgd.604.2022.06.15.02.27.22; Wed, 15 Jun 2022 02:27:34 -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=@suse.de header.s=susede2_rsa header.b=ivXuKQOt; dkim=neutral (no key) header.i=@suse.de header.b=DAjudf6h; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344817AbiFOJQf (ORCPT + 65 others); 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 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