Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1639165iol; Fri, 10 Jun 2022 11:31:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymaxquvsCOOb6eWahu6AvQ+NDTrir4ouvx8lkWBfIU60pAFAh+NXdrclN+lwPlaXFnzrNV X-Received: by 2002:a17:906:5188:b0:712:134d:8293 with SMTP id y8-20020a170906518800b00712134d8293mr6079803ejk.419.1654885861346; Fri, 10 Jun 2022 11:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654885861; cv=none; d=google.com; s=arc-20160816; b=gGzqLICBPQXvVp/9UE6eAtC9c4Ws3wWbQEB6WfNmux3vYcSY6YzjAU7OWwZdiACo16 Kyc37G0DDXsYmglOWaRB8kgDuXwz/JjkBNq+QtZd9fNb1aZcAZs5DFo3cXNMCexBYLmc F7149Nvbp/2mtX9WVaorRalaJlQiy0VhqFHxhFZ+0Kr6qmaVSSEA0jHzgtDxyjhXZn0d 1D3zzXK5IOKaAzXjCU54sPnpQwMxQXkiQyZP+AMWi/D3RS3BFkwXKFxqQpBtGN1VnOkh RI/NY4Ag4vgZste1yvaB46hCIO+MESHo4tc96MA3rc2sdXmCgC0X6xXkNTGOa1qdber3 /tpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:from; bh=ITp0AkczndTrFUhQRgRe+Z6jL7MhUbz74O4hYBhDk9M=; b=shiam0FHPgRzvFCy9kqypkM7HLCeWi7cAghw2lNFN+GjDN+xJSEEENwjph/2suyCG9 ISVfVpp2gevA+LLANRwqP091pIgTRisNDUTc/cWgVRpCBf+hnklywbgRyMVI06DFNxBY C9RiUCm+/ViJcDlhyust29x7gjrr76cUcjELVExGC1PGxoWZ/b7If3OuOFWwOpW0gGW0 T1zloxgbJkjpylNidOJ6PdjqF5Sae8ZcyyG/mYXYP29rw88v7ed4lJE4HrVM4qR4FEyQ N/JxLr5ClkvNFdGdBiwCyRtiSbIENxN0XWw336r2ukcwSsQjigOUVf/P4t7K9LIVeFfR WdMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=bMwAKq++; 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=REJECT sp=REJECT dis=NONE) header.from=toke.dk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e22-20020a17090658d600b006fe9609be80si39052203ejs.870.2022.06.10.11.30.40; Fri, 10 Jun 2022 11:31:01 -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=@toke.dk header.s=20161023 header.b=bMwAKq++; 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=REJECT sp=REJECT dis=NONE) header.from=toke.dk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245093AbiFJSah (ORCPT + 65 others); Fri, 10 Jun 2022 14:30:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233059AbiFJSae (ORCPT ); Fri, 10 Jun 2022 14:30:34 -0400 Received: from mail.toke.dk (mail.toke.dk [IPv6:2a0c:4d80:42:2001::664]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CBA51CFD0 for ; Fri, 10 Jun 2022 11:30:29 -0700 (PDT) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1654885827; bh=JvERuzfAbyVxQoZHSsN4ADrdU4w2H8qbe+kvh+06uFQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bMwAKq++iq/EwsWthB6rsBPeJCMZV46tTHq7cFbVdd+B4yQHaHsRBaqXCYsRuwr9R 4x40rv2PMkP2Li6VTHJ1zqFj9qe26YbSJG4kTMpG5+RvwH3hmatJ0eTCIlvTtH/Ouq BR+XJLJdqTlY8VYrT0nRvl/eAZMaWfv+kH676oJTiYgizKfDMaUeulLOkOKDgMuRmt TZtkeofRTnmHQSFK3VG/GMPy3lFVIdWpcTWZZE/8ACPuPi37LMduyNoS2cx+2U8yEK jlv/sFHX58ZWC6wYxrSHt2jW/hy72+CstxW277cg+lBdD8YQymLl546xERNGz9DVDf 3+NuoNv/1UhGA== To: Pavel Skripkin , Hillf Danton Cc: linux-wireless@vger.kernel.org, syzbot+c6dde1f690b60e0b9fbe@syzkaller.appspotmail.com Subject: Re: [PATCH v5 1/2] ath9k: fix use-after-free in ath9k_hif_usb_rx_cb In-Reply-To: <2ee8f6fc-aec1-39a6-e8db-56e5e449ee8e@gmail.com> References: <20220522041542.2911-1-hdanton@sina.com> <2ee8f6fc-aec1-39a6-e8db-56e5e449ee8e@gmail.com> Date: Fri, 10 Jun 2022 20:30:27 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87pmjg2wxo.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain 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,URIBL_BLOCKED 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 [ This had the wrong mailing list in Cc, adding back linux-wireless ] Pavel Skripkin writes: > Hi Hillf, > > On 5/22/22 07:15, Hillf Danton wrote: >> >> In the call chain below >> >> ath9k_hif_usb_firmware_cb() >> ath9k_htc_hw_alloc() >> ath9k_hif_usb_dev_init() >> ret = ath9k_htc_hw_init() >> ath9k_htc_probe_device() >> htc_handle->drv_priv = priv; >> ret = ath9k_htc_wait_for_target(priv); >> if (ret) >> goto err_free; >> if (ret) >> goto err_htc_hw_init; >> >> err_free: >> ieee80211_free_hw(hw); >> >> >> err_htc_hw_init: >> ath9k_hif_usb_dev_deinit(hif_dev); >> ath9k_hif_usb_dealloc_urbs() >> err_dev_init: >> ath9k_htc_hw_free(hif_dev->htc_handle); >> err_dev_alloc: >> release_firmware(fw); >> err_fw: >> ath9k_hif_usb_firmware_fail(hif_dev); >> >> >> hw should survive deallocating urbs, and changes should be added instead to >> the rollback in ath9k_htc_probe_device() by deferring cleanup of hw to its >> callsite in addition to urbs. >> > > Don't get it, sorry. I am not changing the life time of `hw`, I am just > deferring htc_handle->drv_priv initialization. > > > > > With regards, > Pavel Skripkin