Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2563346lqp; Mon, 25 Mar 2024 02:43:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWx/qYkZLsw3KFhnb7TYJqBd1GWLIDimQMgWjcEo+F0Z+J6uC+CjZ5Q29EL/B3vJw2O0pfOwO+47UmxHHxXdfyvT2Iw0P2LJYCsdr61YA== X-Google-Smtp-Source: AGHT+IEUVQPZb1gbD3hP3FnrAdT+buwrETsAYfZP4Qx8ZsA/amrClmpHlKTXQFhgeVusyU9vbjLn X-Received: by 2002:a17:902:6507:b0:1dd:8c28:8a97 with SMTP id b7-20020a170902650700b001dd8c288a97mr6548441plk.6.1711359811744; Mon, 25 Mar 2024 02:43:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711359811; cv=pass; d=google.com; s=arc-20160816; b=jzddRLpJQRgFwUdyUBu2IRXkUdeFFZScIYofidmM40nK4owB4eJ+k5Xiw28PyOXJFP 1LLNthHRZsQ/L/C/qJ6Xl5O9fkqKo/kCpXBNQLjTsry+dCUXG0WQlhKoR2+ohP71BuNC TOzhbm6E+yPxMvAjwYZsXWRelu1HwcFdLqExfCvZXFXhOtoRfaCnYuhkLgZD8oxo4OwJ 0tjoYBVj1Urc3poPkVmTTrOwg4PQfeNP2DeXT4Ix83HGKvwdzIe/LsK9jIDpWxZlTltv FyPMngstUdvCcoRtknYVm2QwlD/chfyAiNplzFdIH0CBYeNWed1u1KOmLLvD74db5Cn3 AJQg== 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=6/tMrK9dx0Pb+vEAJz/kNnN8m/TgvsBdkxUb5cJDdbY=; fh=wpw9CwByh2VzBg2JAmzRLhCtTGmrj18ge7jA98j6Vjg=; b=bkNWTeaspklxcXS9+42eTFT0xO5UN91TJQroqsbMAg69KxACVGMNk76P3bPE9a7EQH MgglPBToDshYZ0WteDMwNkNQzZXWIfDabuwFI/17kAIomvq41saOwz6waxMt1ajoofhh qdh6dxbwFE+2wTLwMWuIHxNdc4ZlsNbuCERhP9VDrJVKHqDPbmAJH73fLNRkSASVPFCm KtLlZJ8PrmkgTt9Q4t6Ak1CVKybBzaHFjUjKRARC6E+pN8RG57eD/oT74BuUIlGHije1 j8YDhKMOyR8VwRhAQYJeOliw0ylxPJHQhcGgknYUUpbbNDj/2RJxFVJ02Extp7g0jJiL rJEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="N8ysgDK/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115854-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q13-20020a170902dacd00b001e09c573fcfsi4503826plx.480.2024.03.25.02.43.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="N8ysgDK/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115854-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115854-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9CD4B2A2064 for ; Mon, 25 Mar 2024 09:35:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9276B37F7ED; Mon, 25 Mar 2024 03:02:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N8ysgDK/" 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 98A9212F585; Sun, 24 Mar 2024 23:14:22 +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=1711322062; cv=none; b=R5wzGqhLH61yRz8Kd/E8lqJ0t+kEGaEpFoxPFMcoboURgpfoSdWxAkLDCpCjVwiyYerAi/ZxuqIbce9rBt+vc0ZJ7Sa1yxZG+rEKYiXo+UpFPeLfysRLZDyYtJV5TwDCrzKtzDwVKgbB/eXdr7rE2vXDYSaFounGUXGARVi5cYU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322062; c=relaxed/simple; bh=Gk5ghOKl8huWxjY72DczoFbQq9DR3kSonY4D7kMEmy0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yq7nDbTFHUrP7T/mMggAX8hcTU8mJhGXBIRaNfDqPjhlVxVR8+M6RsE9mSzTiypeDM5Esw4jOKv8dl7ttqZiOdUbJepmbzyPrtjNo5tVPqEnTJ8wQVWRrQbiAF8GQxe5ptsYq6BBt4uxGgdH1iXsEHiOV4b6AWeDyw+hrqp2LGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N8ysgDK/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8CB9C433F1; Sun, 24 Mar 2024 23:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322062; bh=Gk5ghOKl8huWxjY72DczoFbQq9DR3kSonY4D7kMEmy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N8ysgDK/ooTaUryYx8rvXggfadFIr2ofzgONovKfo3uU/PpWuC6NxIAxdAXXHg9ya dIKZ2R0c4iTuSoPyiWnRKvRRfo/y4WK7ahLPGSdWSTD1zljZZIkp6u/Sb65/TLE+N2 qV4UtzysILafhJva+i0ARYykC/W2NcESKfw3Ax2XSepaApAprfV7WwU8qrQttb3dFT ccOuvzBzawVS4sGYHE+bauGcdIE3s3OdphByiiqHd0iUh3+LWbasXYdMtFhlxKcwqj W6xSsCmCD7z77faOWrWEpbq56qQTq6lEKHvQK0hj3qiHInH7rvZiHd6Hr2u2ibD+4g YDsFGdCt9A8qQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Johannes Berg , Miri Korenblit , Sasha Levin Subject: [PATCH 6.1 135/451] wifi: iwlwifi: mvm: don't set replay counters to 0xff Date: Sun, 24 Mar 2024 19:06:51 -0400 Message-ID: <20240324231207.1351418-136-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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: Johannes Berg [ Upstream commit d5bd4041cd70faf26fc9a54bd6f172537bbe77f3 ] The firmware (later) actually uses the values even for keys that are invalid as far as the host is concerned, later in rekeying, and then only sets the low 48 bits since the PNs are only 48 bits over the air. It does, however, compare the full 64 bits later, obviously causing problems. Remove the memset and use kzalloc instead to avoid any old heap data leaking to the firmware. We already init all the other fields in the struct anyway. This leaves the data set to zero for any unused fields, so the firmware can look at them safely even if they're not used right now. Fixes: 79e561f0f05a ("iwlwifi: mvm: d3: implement RSC command version 5") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://msgid.link/20240206175739.462101146fef.I10f3855b99417af4247cff04af78dcbc6cb75c9c@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index 2748459d12279..88f4f429d875c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -461,12 +461,10 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm, struct wowlan_key_rsc_v5_data data = {}; int i; - data.rsc = kmalloc(sizeof(*data.rsc), GFP_KERNEL); + data.rsc = kzalloc(sizeof(*data.rsc), GFP_KERNEL); if (!data.rsc) return -ENOMEM; - memset(data.rsc, 0xff, sizeof(*data.rsc)); - for (i = 0; i < ARRAY_SIZE(data.rsc->mcast_key_id_map); i++) data.rsc->mcast_key_id_map[i] = IWL_MCAST_KEY_MAP_INVALID; -- 2.43.0