Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2597408lqp; Mon, 25 Mar 2024 04:04:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9N2czY7JGlBpdMYWSkD03HsoRauM0w+jMRLLVDK1omrmXmhT6IQvtnWFaD0mwY2CFzVz0frcNXURI4yL6ubyYaHaewNAkRrMxz/2LDA== X-Google-Smtp-Source: AGHT+IEiZ/7OMJTpomY+jRtIhfaQdfrjDleWml1WzQ54u2cV1sTrODnvfZJb+ttZIS6pHsxa9JFW X-Received: by 2002:a05:6a20:3c86:b0:1a3:4d98:3be0 with SMTP id b6-20020a056a203c8600b001a34d983be0mr5582318pzj.13.1711364655400; Mon, 25 Mar 2024 04:04:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711364655; cv=pass; d=google.com; s=arc-20160816; b=UpaDz1xKVsRVYWQ0KXNrAIEmQDY0wXXc1r7o10nEw6DUVzfk0yqIiQIdqbrk4W4JJH bjccoyhcsO71fe/zNinqFq36ssmlFtFGh0dHJQyr+CCdcXSHhf4g7j4DojsWGbe4Kh0e ncBkrnSvMinx242D9IyOHGJZxstg3Oa+w/XCdVzDH8Np4WwfpiE1A+4MNGJHfNaHtpAT xa1RuSgXj6+Q1fNr4TidwQrndCE0XbnXPBnWIpjTzH5aklRm7U1MVpue7drpfg9zisJD 71FIxKgkWECJ/Xwqo2EQconwC6yM+vEkJeLdmbZL1+Hs9CtVjV8GaiU/zKPVO1ERNo8S ie8g== 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=VSCgPi2k6hejaDoJM3I9ZCIji1bXT/D10VB7wA8Adu0=; fh=kjyg2rkBK2r1u7Vz5RR0Ol83qrSurJy2kO4VY0vfms4=; b=DIKFymCM1GMruG+0tZgpKg8pqwdLvDkt160KjKVRP8QGE3flC/kVwbf1BdicV/2dOb fqBveG+5m6grnLYoEzQCq8a+RyldvU+RyNYZCBS3NP3cT4zEpo1rSwApueF2hXa9qOUH tKAaFa3AKu6h4M4+1YCBJZA0f/7aEkcSpc4PPkrJaYFnraqs31HPzVxSzF+e+Vz9anNj 4PjS0KfgwjXW841viAnvR77AfuuLCoyNlCerZc/WXLiuGgIydyVvT7Bsh6XXqx6BF4zt Hsc9Y86iC3TCz2u67mp3hfZPsjLmESohch5ninTz1n4LseidBoC9E0208o+ARQyuGWcl 1pAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=utFVvUp9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115870-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j32-20020a63fc20000000b005cfb2c44526si7341693pgi.862.2024.03.25.04.04.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 04:04:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=utFVvUp9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115870-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 83097B3CA79 for ; Mon, 25 Mar 2024 09:37:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4ED5F1591F4; Mon, 25 Mar 2024 03:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="utFVvUp9" 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 28131535B6; Sun, 24 Mar 2024 23:14: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=1711322046; cv=none; b=TQGCaKw8qoKC3xC2cr5MR4WlFnrbtJGAlqRMHJiPh2H5sN3lNmE3zxAic9IVv4wNs4oPa9GwHi7bMTBaUWTj9jJxitXpYLxWRpLkE9kU2w1/yIjYAxvgvf56nN+nrC84pko8ehWb5dYKFooCcSDQWnXwpTjyZs8AjdqLaHNICfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322046; c=relaxed/simple; bh=5U0eUZZUNHAgCzjs8VzSGTtjfKcCAcG5sjFRe2C/4hQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WusP5FUsLJ9s+BYEs9blsJWZ5oUZFqi0sHwaUWsGy76GDIv3WOAX+PLcqBPSLqO1ve9WyR4nwvZJJ+JQaJ7MORF8flr4XjlETRPjVE/AHl0iOa9KWdHVDzgfEfsM5ys+S2vFQNpdxpcZyYMWUrldfdTXRX0FH0uRRu/dDKD3/7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=utFVvUp9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5063DC433C7; Sun, 24 Mar 2024 23:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322046; bh=5U0eUZZUNHAgCzjs8VzSGTtjfKcCAcG5sjFRe2C/4hQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=utFVvUp9IxH4j4wYOECCLsbZeb1HcVzlHzXQ+N2SHG26wRmr4LcMj89cjsJ8Ca5P7 zOa8XcIRJJfWJk+4D7mn0IyRyFV2xz6RuEEUK5RE/I+UOkEBuHutcCH/h8fYjMXIln dNmshgRVeuYF9i8Z8RP97/m7i6wNPLj7DDDrTYvbKUGkuXHogLJjxWJ53Z0vPJi9qM T+nYA+mYUTQd15prqWqEQ6XLwyinlHHxLsg61tbEFOutaqowN/HnTX6ZZuMW2MRLYN Jg4pc38C/BcE20f5XwjrL4Dp/jhw0h1M0JfUZDUXyR9z9G/gjCjV0HiSy4HWotwMet ImDEyjop9rG3w== 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.1 118/451] wifi: iwlwifi: fix EWRD table validity check Date: Sun, 24 Mar 2024 19:06:34 -0400 Message-ID: <20240324231207.1351418-119-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: 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 f5fcc547de391..235963e1d7a9a 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -725,7 +725,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