Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2374307lqp; Sun, 24 Mar 2024 16:29:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVzvC7YwYdQdFtm/OqVaBUzk3WkroIT/l+MJ+Fvkc46zaG/JRd1wNCQozBY1FEoPxHCdOpIAr+Pw5nYUKlM2hsliigmTt3NAsD28oQrAA== X-Google-Smtp-Source: AGHT+IEAXtGT7dSrzt03zUZNtImJ4NqPjBfoNo34fkjWvtfibqADR/jRzI4Cs2g4eoL6b4EESIHV X-Received: by 2002:a05:620a:10a4:b0:78a:3ce0:fc12 with SMTP id h4-20020a05620a10a400b0078a3ce0fc12mr5608364qkk.33.1711322950220; Sun, 24 Mar 2024 16:29:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711322950; cv=pass; d=google.com; s=arc-20160816; b=YkcbbNmwYZk1suO0f6AdjBTNL2z4TU4B+bINmOzuLfrSPQ69eeodUP/UVJSThq5bwf poxnFqRW1O+A3w7dIoIfS3KwJpBR2DzRWAUWv8IJ9Xb2uYoNLi/j1Sl7Q3GY+fN5PCZn XKJBBrGMMX4sNe5SYTjAmDu3LlCdev+GPqrPZN8KfCc92VlCpdDbLYUlRQiA3CUQQGuk FYU0i7fgGCnEZMDBftKBffAGLLkc84k8KKnANuExO2zP6OW0+sv6+7yNTdNb3Zhjlr4N i2rbZDGnAWScwOq34ycZEJv85jtyQmrR8R8ek9WhJgxaSEpuAs9jpwEm5stemXNh1oDr u7PQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=P0oMxMx033ustTxKdrkPWQIzDdsgtKEwRYG5HV97F8I=; fh=GIUpON1q3FMki9dQNKAZD3JMGFqM/a2dRZ4HCx3HcvQ=; b=LIFMiSGY5TzHP5MUE46mjll1cx+Rmo3l+NkEnSLg4L0bHwtfxO3Qz8mxFCiSGQRr4E I99PvfGkR3G/mnYCGDENcBZq6a3j0mIbfpSkCwSxMDVJP+kQpAuzvIfyGPrz/AgnOiLJ YVqmAwLwzQhtNAgUwAYyCGTOnIVfingp6lzn1pAPxJ2YzmqroaOa7bk8GMmI/e67dC+A 3WLKe+If0sbRRM7we7zqJiEGM7q/z7lrQw8UZGYaq3EneAPDzRZqbYUB7loKhydhbKXK dye+u47Maa89xeYpgIcRzEhpBtnIyM8HKfDVw3Pv2DwvjQj/gGOa2Jvn24x//zZwD+g8 BFXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ux/1ZNf/"; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-113139-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b1-20020a05620a04e100b0078a4bb3cef9si3119996qkh.567.2024.03.24.16.29.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113139-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ux/1ZNf/"; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-113139-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113139-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E73D71C21EDD for ; Sun, 24 Mar 2024 23:29:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 744E716EBE2; Sun, 24 Mar 2024 22:39:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ux/1ZNf/" 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 840B313C3ED; Sun, 24 Mar 2024 22:39:06 +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=1711319946; cv=none; b=SwnJZ6kMIcGixawWWAEwgnJoCgVA1Rl/BsKh6qeUOOG85eqhfcOu1T1JEE4dE4WWqAeJ2WXTkrhICHudjwJ8RFEn6Gdjpk7ylJXGHA1toY1a+QBfyMmuRN1nHr28e46unCO8IGE3INHGUnB9RULvR4mxhXl+NZV4Hokfe20JN8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319946; c=relaxed/simple; bh=Q4+ByOQI6AC/hRIgafFeNoLkyAsC2er0jPK3iWRch10=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DV5JKPx4unxtOgwSBuzhRS8V3o1AkX3tjWs126rLFfsehKe0ID2HEX5erdXfgMm/WAwIxY255/4YO21wYkJVui3YZqgZyb0t54MpVofK5fmhSyO7uua/q1JkHPyVz6qoWKsXc44s053ezmIZM45DQWfEM4sl2xEtmmlgF9NmEvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=fail (0-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ux/1ZNf/ reason="key not found in DNS"; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3B1BC433B1; Sun, 24 Mar 2024 22:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319946; bh=Q4+ByOQI6AC/hRIgafFeNoLkyAsC2er0jPK3iWRch10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ux/1ZNf/bgR6ROWRWO9mviR+2OFYvVB0fJ0Bsq/YjWfnqU3r3w3Rwpk3AfDvzE+EN 0s/x2EqQOCofqQzi+50V9L6Ja+vxXu3/i+mvIIXC5e1Tv122kkOC2MoN3kKTLk87Sn qE3RcloRljtKC1Codb64t46KZevrXmYeWpPuIgXCtileP5IAuEzSFSWZ9tbYU7MsMF nhQ9dcFJt0r1fsRjISLnwHm3midh35+QOCJZadx5EizOkvryJViI8Vy2Ab32QoWZrc RRQyV2BaiRDONq9O8pKCOT8Si4sfiLBKiz4ytpWa2qtVXpF9ScwyIOxCoQedUYPVKa QI6kbdeCjPamA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Deren Wu , Felix Fietkau , Sasha Levin Subject: [PATCH 6.8 252/715] wifi: mt76: mt7925e: fix use-after-free in free_irq() Date: Sun, 24 Mar 2024 18:27:11 -0400 Message-ID: <20240324223455.1342824-253-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Deren Wu [ Upstream commit a5a5f4413d91f395cb2d89829d376d7393ad48b9 ] From commit a304e1b82808 ("[PATCH] Debug shared irqs"), there is a test to make sure the shared irq handler should be able to handle the unexpected event after deregistration. For this case, let's apply MT76_REMOVED flag to indicate the device was removed and do not run into the resource access anymore. Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c index 74cfba7675beb..07b74d492ce15 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c @@ -427,6 +427,7 @@ static void mt7925_pci_remove(struct pci_dev *pdev) struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76); mt7925e_unregister_device(dev); + set_bit(MT76_REMOVED, &mdev->phy.state); devm_free_irq(&pdev->dev, pdev->irq, dev); mt76_free_device(&dev->mt76); pci_free_irq_vectors(pdev); -- 2.43.0