Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2362111lqp; Sun, 24 Mar 2024 15:48:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnuAa4+lmN4KcqUiKN9EPtTyK8LiS/eUI6L9wRzQOgfkSRNNnwekifnOFYKxi3H8NY3YwVAV+E81/6QAxq2ty9K9IUWd29hFAyOWmPXA== X-Google-Smtp-Source: AGHT+IHF6iZqFGhzGb/WIAiuAa6AVTLelfriLeZGyZ2lq4A0tkgtNEVNUfzFaEcYGm9mpYbwRaUg X-Received: by 2002:a05:620a:21d8:b0:789:e71b:f2ba with SMTP id h24-20020a05620a21d800b00789e71bf2bamr5848856qka.65.1711320513956; Sun, 24 Mar 2024 15:48:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711320513; cv=pass; d=google.com; s=arc-20160816; b=s1cKJxuriESi6jWqiMsGpFEmK1+DcL5FGJYtYh5fNbv9zJhZw5pOkzgfXJixvkBW9b zh7EmwS4KQ6wjORC/kkkhg34r73cAkbc15JNTcb/Ni3dkZj7KSj4Bcktn5YBrvv4I/mK tXCU7IFAGl0/zw578NkFeayQ1r5IAJYq3pOwV8VJnjLPjflzb6H6BL5UXt/S6+p3YYoF dLgqP9tePV6ViYhinwDW/qIJhmf70VSJJa2AADaxvLPUz16VYW4J/zqu1bFcMQk6Pd/X IJDfEQ8AzgpnzlLqEruAT8ndxJoOgGGcFYPOtT1268E8anN0dm/jESt0vwzxMDFFIiWA FXNw== 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=kV1XHVPs0g+scGUCS15j8LWilRBJDniTBE2rnvMpW2c=; fh=3duCb5Yc+ikttvAw4f9Y5SHKOsBrKwPoGu+NkvjFCJQ=; b=PkOpBIo/S3LWvimxSf/7HX/0Qd8+Nz5Lfh7x1CYuPf3z+rJiAPWc4s8vWROn/kz2nH VCf+ER5y4SiayoSDlm0wRu4ifXgtFBfqjf3Yi4YDFinQvRY4YllqVYTNzmryZMYZBpOl QlvmYQ2YsQmk18DWc8ND5+i27lwA6RxGLEn+/RljbXdK5vbkUcAy7G2gClV3w9gQJQyU +jTUAViLfq1+IiZGPeEdJZ+/GIFdpagvsGYboPbjGOqZH4LpDQs+r+4asESkJr8uFsn+ fC4VsEPkE9h9XIqhttlNnnlwM/7RlGCwdqA1xFYQJw0y6Sw6k0xuL0yiYlm/84I+Sel6 XN9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hR2xXuwf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112942-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 pa35-20020a05620a832300b00789e9180877si4071681qkn.721.2024.03.24.15.48.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 15:48:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112942-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=hR2xXuwf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112942-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 9B3741C210F5 for ; Sun, 24 Mar 2024 22:48:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB7BA80C0F; Sun, 24 Mar 2024 22:35:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hR2xXuwf" 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 EBAE380612; Sun, 24 Mar 2024 22:35:54 +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=1711319755; cv=none; b=J2MVcaxSJBef/9WDkoiNDuCeGX+Q83t2hRdBIegoKc8fl2dXMTEcd4zny2aCiOuum7V99vaU7dLokBn0nv08IqrWaruEj+muStLW+j5siPAiJ4yMtZIIGzSl4hQ6d6JfBDVZ8gx0rf2XwRUG3Xgrmf9FozGdtmI3rRJ01xKeJ7w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319755; c=relaxed/simple; bh=oYYvn/6nxGWAVbko5rNqBa3zP6x2dNPOvgw8qbioNx4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gWJzbTAgq3WMOPq8p2aRYYmawAaWrzNJ0cEZpMS/1RnAc0pIrDA/6Myol/1sg890KG5dQTGZIkk92RH6xCFj/A6tEFbSA4N6fNbReV4J8X3qMAyi/TyUD1Ztin7vSdI5hhg9Tu0gv7rra35f9qtHjBph4MJuKQDaMQa1JI4G9Xc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hR2xXuwf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F2D2C433C7; Sun, 24 Mar 2024 22:35:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319754; bh=oYYvn/6nxGWAVbko5rNqBa3zP6x2dNPOvgw8qbioNx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hR2xXuwfjXPU3owqX0ayc+3+aZbqYzJb+qJ4vMjD4v9jwhqRW9j96Pm/glurdb/PC Q4K4S6Zyf6j0+BvsOLFmdUtVtIAxIW5U60+WUGpuwSrB6eO4wp0A7JBlhi2xQ0pd9j C5Tyrh6M1JXD9vViLkgxsxOvDyu0A2nIu/Y8+GVGg3TaYtqIXtuVfEQXXDwrRK2fY2 fqNXRSoJAJJpy6OMdXta/JnHWrG3RJLzmBW/M826kRdbnFHq/crjZw53GOe7I0KlCP DpGSqfu2M/zL4yuvdc0D/d48R92IoRdIHvV7s4gN/LoGia2x4dbVKjmipx89tSoWei lHM422INdSLkQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Xingyuan Mo , Jeff Johnson , Kalle Valo , Sasha Levin Subject: [PATCH 6.8 055/715] wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev() Date: Sun, 24 Mar 2024 18:23:54 -0400 Message-ID: <20240324223455.1342824-56-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: Xingyuan Mo [ Upstream commit ad25ee36f00172f7d53242dc77c69fff7ced0755 ] We should check whether the WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT tlv is present before accessing it, otherwise a null pointer deference error will occur. Fixes: dc405152bb64 ("ath10k: handle mgmt tx completion event") Signed-off-by: Xingyuan Mo Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://msgid.link/20231208043433.271449-1-hdthky0@gmail.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 6b6aa3c367448..0ce08e9a0a3d2 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -851,6 +851,10 @@ ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev(struct ath10k *ar, struct sk_buff *skb, } ev = tb[WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT]; + if (!ev) { + kfree(tb); + return -EPROTO; + } arg->desc_id = ev->desc_id; arg->status = ev->status; -- 2.43.0