Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2367271lqp; Sun, 24 Mar 2024 16:05:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPaEgaDR1xARIJeqVYpUHTGO2nFym0x2CCuEfcJ6GCSr6FP1bK64yYXzCiHsMzHKAjST/P7fYVu3hRcsoq4mdt0pypqREFn8Ango7bAw== X-Google-Smtp-Source: AGHT+IEGIbedUEgBvaAk46jJ6ONc9FA1xuuoK+5ViMt8l78oxJTOXSGlr7PXkZIUrHirwDWGxLgg X-Received: by 2002:a67:ed04:0:b0:476:8cda:8e6a with SMTP id l4-20020a67ed04000000b004768cda8e6amr3843368vsp.22.1711321515634; Sun, 24 Mar 2024 16:05:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711321515; cv=pass; d=google.com; s=arc-20160816; b=SP6JM1PMIvof10zs7XNQRcilNllj/uRZ+VNWfL5Z6k0QzCIrqxb40+dEYr7qsuOHO5 MQJG/YVfUV2gR7MM89oOKTeOM5VViY0o3WzIqHUtbeLvnxGVuOxiRjMWkerXSeLlhpx1 7RUzeYyayAlgoCFW1yNT3cqcUCqAhGS3+uhXOrtMF8HeZxXnCfU8UwbSDT3V2H8yM7sD LQsetHDjGxYl7/jEP8XBtx8gs0RNZlwueINeb/jsGKuHY6Q546gypNRdgsKQEPWNfABT iaUQf0AECl/WiVDKfSdDYfNlSVrAIm9Kyc7MG0NmqTF6yGpPkLeKLxZNl8x9o71NLEWI C/NQ== 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=inDhxgwnxAn9uyYA1UAPcxlO4JSZFAz5ezgn8PEfYz0=; fh=kjyg2rkBK2r1u7Vz5RR0Ol83qrSurJy2kO4VY0vfms4=; b=q2Lec6KcFGCs24wQPhd8vEvGkRR9iB/iidNPLv7JOuQPYuRRRl2mbkWDANVgcaLVTg 9N05sWtS5nNouFEy0RbbhsKsb1CeRl6My4htEmCxkilu5mZQIQJOLZunSM4KZc0gAJcm Oud0bxNX1CD9lLRubU2sFL6cJWzJaqbZjVvfAIVsOHCV2b3vj82iF0yACUWjCVSbmVAZ szCh79KlU0xlwFSUg0ifuEdFIsc/GYAe+F6XAHJ2SS/FS6w5bZDSeeITNJg5FGME+mN1 01h5TSeBCUSfi3n80P+9bpbA8xUL1Dzg8/r01Qb5v+rl9gILmFhlbG8SHD+tkyOvqI8c JaQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=niYNNNtR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113016-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 d18-20020a0561020d9200b00476f07da884si222865vst.207.2024.03.24.16.05.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:05:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113016-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=niYNNNtR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113016-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 5071D1C211DA for ; Sun, 24 Mar 2024 23:05:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47F95137765; Sun, 24 Mar 2024 22:37:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="niYNNNtR" 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 4D32C1369B2; Sun, 24 Mar 2024 22:37:07 +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=1711319827; cv=none; b=hRgCMUGEFQxAeV0+Mwpo4GpoM94bn554fZXgzPqjZJOt8paFeVk09YLqSr8TGk/6qt34mvCzTzBNuOQ1h/t1mlVcZPyTVRRyRBbrmCqwxRFClhj7M+087ygnEE5pp/COhiqv1thB7goub/6THS4t97QfA+3pydWHkAMDMpZd50Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319827; c=relaxed/simple; bh=hqGZ4LC/p9yLhUx80JTHDn5iP1OAqL/6mwd8bLXnsaA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I8+/0fUW2QvXxBAg1YbUdRwRY81qJuMJXVyYDB1QUhnQgL/BZKB4LXGgS+QtH/k2jY8/XFrNZ12QzwR1zVOkE2tvGyXDg45QkD1HmA47s2fpZy85CpHjobdALhJ5CtJoHVLYw/riT1kSdxNvCyox8bbq7fuMCaQWa+9E2BGKIjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=niYNNNtR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35064C43390; Sun, 24 Mar 2024 22:37:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319826; bh=hqGZ4LC/p9yLhUx80JTHDn5iP1OAqL/6mwd8bLXnsaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=niYNNNtRS2afXZrJWxOk+Mj6VD68ZiVW3dxCQJ45cVPao8bfnzOTOxEa1qqXrRNj6 7F8ogXtKUKOS4S/LdsXejb/HE8x0ywX43XG7OUbHoofYvWqHouMpmgpCiDHq+Kllhv Dcya/iwBDid/9nMMR5pKruvXttATTdv7DO29Y36CPVmV1ixUmM5dzu+WJJWNqgSsWW 3Ks3ufRoZrdGmlnHT28BFTAudXrDuxQsS3ZT64PtuIgsFTNoJyGgfCt2sKr1UuTwJL wqsSm+BOvG8mUG1QSHtc1EmQnNHEyebS16XPFKRwvEu6xpuKTlP0grUahHBJ1fxlcd rR9QKMpKVhFRg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Miri Korenblit , Gregory Greenman , Johannes Berg , Sasha Levin Subject: [PATCH 6.8 129/715] wifi: iwlwifi: fix EWRD table validity check Date: Sun, 24 Mar 2024 18:25:08 -0400 Message-ID: <20240324223455.1342824-130-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: Miri Korenblit [ Upstream commit c8d8f3911135921ace8e939ea0956b55f74bf8a0 ] EWRD ACPI table contains up to 3 additional sar profiles. According to the BIOS spec, the table contains a n_profile variable indicating how many additional profiles exist in the table. Currently we check that n_profiles is not <= 0. But according to the BIOS spec, 0 is a valid value, and it can't be < 0 anyway because we receive that from ACPI as an unsigned integer. Fixes: 39c1a9728f93 ("iwlwifi: refactor the SAR tables from mvm to acpi") Signed-off-by: Miri Korenblit Reviewed-by: Gregory Greenman Link: https://msgid.link/20240129211905.448ea2f40814.Iffd2aadf8e8693e6cb599bee0406a800a0c1e081@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index f6ee5afb3320e..e161b44539069 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -767,7 +767,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt) * from index 1, so the maximum value allowed here is * ACPI_SAR_PROFILES_NUM - 1. */ - if (n_profiles <= 0 || n_profiles >= ACPI_SAR_PROFILE_NUM) { + if (n_profiles >= ACPI_SAR_PROFILE_NUM) { ret = -EINVAL; goto out_free; } -- 2.43.0