From patchwork Wed Jun 7 12:15:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian Hui Lee X-Patchwork-Id: 1791679 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=vIWFS+7W; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QbmXl4Kzvz20X5 for ; Wed, 7 Jun 2023 22:16:22 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1q6s5A-0000ZW-49; Wed, 07 Jun 2023 12:16:08 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1q6s57-0000ZF-Vz for kernel-team@lists.ubuntu.com; Wed, 07 Jun 2023 12:16:05 +0000 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id BEA4E3F0F8 for ; Wed, 7 Jun 2023 12:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1686140165; bh=jueGhX2IXO56agT3FxSHhp6ZyFoFcAQaA+t2cLpkvlg=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vIWFS+7Wk+vR8f/1LLkMhKPt7LhGG0agfv6mz6zMiAhZi6WTYjVda1PZFRc73FBdy Y7IEpORhEDwpbuGPIsem9hIt6KYnrbbngcFRnMC/FcfwnQr2DJWIllqiZoTjsI/RJX 6uqyfNCxyHO7OpLR4OEHffbEBjlquK5kvZYtDkSXsyscBBGDb6jooEF3xfDcGp6wSl ouSvaGVC5gHxu9OikisS+xwu+lyb1681leEcloqRA1i2BktTHbq8IFeh5sr8lk6NSh 6krLs266pXQPbtYVllQpfPPrZFieyudEeAyhA+bA8VhSCsTPAv5EgprMVbaRzJkJqH nZ8VxUWAq34vA== Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-1b24e50f4dfso1725515ad.3 for ; Wed, 07 Jun 2023 05:16:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686140164; x=1688732164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jueGhX2IXO56agT3FxSHhp6ZyFoFcAQaA+t2cLpkvlg=; b=GftVUkYGM+Ff7B/ChV3flF0kxRV6FFGAN6Jis7L+8ZJcyjSWy8JUvpdPhp4EO5ZTMv lvinRztgsyCO+sR1OhaDSFk0faEEHKlS3KZFxOpa4QIOW5h4lTib82dMDU3UC8GQaDIa ZxOIRwq6fDKX6dEsoeFpoW80BKgseLeJdEyNnkWohly3GLufh9MB6DEbiFyz1yyIL5a+ SEm4tgqG3ThibniioTwEh4oomSAwGUOA0RDtAAuJeG7dOwyrn3iAKL3ZLRx1vkFM/cGI 29wE+k4cjsqvi6CiVQjCKyNDL1D1fAPpLFgDLyzXQj45lQxr+c+bZUkKHhJPDsYGr7Og OUNA== X-Gm-Message-State: AC+VfDw8usJlx9kMzM8Y5AAsfQQigo7vZBXT8vOo1n/Vony5kjZDENzN uyw3mO4zFYEg5AGvqvqdZbjH0YZT7vo+znfDqdwHTic7u9ULAnQqswO1eJ7Lxc7Yv4DP8iLb1zp y6XpfSVXgGKbNppzRc7bLte1UQBQg2+lcGTRlQDtLdx4xMQ5a3w== X-Received: by 2002:a17:903:1211:b0:1ae:2c87:f771 with SMTP id l17-20020a170903121100b001ae2c87f771mr3062987plh.20.1686140164342; Wed, 07 Jun 2023 05:16:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71shyg5rYhzlR8GMrdHu3EQIfo/YH3nMrrpL6Y8MrOeZ2fuvJBIPWbOmxu3nRveBFCwVE/qA== X-Received: by 2002:a17:903:1211:b0:1ae:2c87:f771 with SMTP id l17-20020a170903121100b001ae2c87f771mr3062966plh.20.1686140163948; Wed, 07 Jun 2023 05:16:03 -0700 (PDT) Received: from localhost.localdomain (1-163-143-178.dynamic-ip.hinet.net. [1.163.143.178]) by smtp.gmail.com with ESMTPSA id iw4-20020a170903044400b001aae64e9b36sm10323108plb.114.2023.06.07.05.16.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 05:16:03 -0700 (PDT) From: Jian Hui Lee To: kernel-team@lists.ubuntu.com Subject: [SRU][Jammy:linux-intel-iotg][PATCH 1/1] [BUGFIX] wifi: iwlwifi: avoid a NULL pointer dereference Date: Wed, 7 Jun 2023 20:15:56 +0800 Message-Id: <20230607121556.105917-2-jianhui.lee@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607121556.105917-1-jianhui.lee@canonical.com> References: <20230607121556.105917-1-jianhui.lee@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Avraham Stern BugLink: https://bugs.launchpad.net/bugs/2023176 It possible that while the rx rb is being handled, the transport has been stopped and re-started. In this case the tx queue pointer is not yet initialized, which will lead to a NULL pointer dereference. Fix it. type=bugfix ticket=jira:WIFI-301032 fixes=unknown Signed-off-by: Avraham Stern Change-Id: I0b84daae753ba9612092bf383f5c6f761446e964 Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/53643 automatic-review: iil_jenkins tested: iil_jenkins Tested-by: iil_jenkins Reviewed-by: Greenman, Gregory x-iwlwifi-stack-dev: f00afe4575bc2b7918fc22df38fdf76493c7312c (backported from commit a445467936a699cd1a8064633ad67e5f3583fbf1 https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git/) [jianhui: no version file in kernel tree like intel] Signed-off-by: Jian Hui Lee --- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c index fea89330f692..6a1d83c17b85 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c @@ -1356,7 +1356,7 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans, * if it is true then one of the handlers took the page. */ - if (reclaim) { + if (reclaim && txq) { u16 sequence = le16_to_cpu(pkt->hdr.sequence); int index = SEQ_TO_INDEX(sequence); int cmd_index = iwl_txq_get_cmd_index(txq, index);