Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2589261lqp; Mon, 25 Mar 2024 03:45:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/d74AuVLPqiE47/Z137itnq8tXMFCI4JD3oX9tSPatReJFR5JP1osq741vdHGjpIfic2Ph2Mtt6Azr6W12RfEZSVAnlTnLQhysWY+PQ== X-Google-Smtp-Source: AGHT+IEq1YG0fcAgMWJPdZY6/B1ggywAgUTUNLm0ziCEbG8WeFsOmKCYeBr//RQ7H1808LV/2+uM X-Received: by 2002:a05:620a:1279:b0:78a:4535:5b51 with SMTP id b25-20020a05620a127900b0078a45355b51mr6918629qkl.38.1711363522659; Mon, 25 Mar 2024 03:45:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711363522; cv=pass; d=google.com; s=arc-20160816; b=XWx88oJoWK1wjMxel0hmY0HkRS9+hYENLZRR3zIoXMa4pr+PABkDlMZDvKT9UhRqAR SnOA1UGhzRE1+p5mEj1NZ5wPTBmtlIu4it9vm78XFJGJaErJTUiJL+Xl0HUAx5HhGYvE hrVl4g3sVKGGU6BFMeS9tGTtg0rf79fag2MMfyTj9hD70lUIF2whsXplrv+wwMRgMmcb 715WFH5iTChM1+xmcUaqWQqHvPMdb48k6uzjOmQ9HyTUKk1Kw/eRzhTjHMfNOkjV8IbW Y4mHB95EmhPHVPM5yO75N4c+mAxCIFa8LC/42jcsOIayCigNMwp/iA+p+p+ul8ksldOy dUUg== 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=w4ppaA9RtqFL8Ivo0bG9PO1v9SGsC4KjPmfxS/8RwJH/BJNUhW+Ly/uq0+mbLzouSt RVBfyrlDMxo0nbgx6NS2MMUnto0HfCxcSOnrq9PYDgP8BdHzmYtnHnc3/pPR9hGXdi+G 4VFuhaUPvj+qSFJskkqAD5eGDanF6S3kdw97uxXc9eKPxB7w4LdwHwwvdfkfkSnjtiFW 28rVlk9RHA+dT0Cy9f/qIUznRRjhGR3pBM5ff0vnBMZC//0lcahghSz1NwPd8aIDtZvQ JqRh3xZ73c7vNOsW88dFkJl6p3Xjr9KBjSutQJGIC/sxfSuMcAV9WJ6VtwZgas3k2V1Y cB1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t4UYPiMp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115371-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bq11-20020a05620a468b00b00789f1f015bfsi5680967qkb.740.2024.03.25.03.45.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t4UYPiMp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115371-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115371-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 627521C34338 for ; Mon, 25 Mar 2024 10:45:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1829F1F23C0; Mon, 25 Mar 2024 02:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t4UYPiMp" 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 D88D9143899; Sun, 24 Mar 2024 22:50:30 +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=1711320630; cv=none; b=smmeKy3bQsHpklrrEp1RPsHQXw6gs2NpC6R7D9aU7qMSxY+vU3NrxRnZpLUi+Iamkt4obkfmrNXJvoSLcSqyZBpgyHhisK0cfi48IIAYjgonAcHNug8a1OApy2wDXYXB/3Y0VRmsi7mwxYJu1rkT8dWV3uS1kLB9x7loDTg2zU4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320630; c=relaxed/simple; bh=hqGZ4LC/p9yLhUx80JTHDn5iP1OAqL/6mwd8bLXnsaA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cFxMSTk6DGbxR0BSoWAUVeWllyhQn2L4NLrFGhOPjIG2FZ8ImtUT1MTHDornnttpB7z5YrYI6UxrKCIypbXJDb1tWvl3HdwpFK2I01vQnOZb8XCcpjDjbQURpUwDQiCh/cOhZOo8s4LOpZGaACJ5SSfAgMruD9R3zXrI3kk20gM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t4UYPiMp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E2A9C433F1; Sun, 24 Mar 2024 22:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320630; bh=hqGZ4LC/p9yLhUx80JTHDn5iP1OAqL/6mwd8bLXnsaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t4UYPiMpqrR+vqc+iGkUrT0PYhu9kHFkNGZmBhYAUJj7N0c8+62rD38aP1IY/0NwA LhlzNYWLq2pEEvC9kisR69m3pP3nIzmwtiPUXhCcttAZ2KbhNGCcCOxaatZ9v5xd/k X03AX31uwgxYbbEeMD8D1NSmOi68clQPa5FA98vwokeploiN1Olh9NKiPFugQ7/pZv xsE2gn4GpLqjDBScK+9VogGsaS+U8rBvUySHocKpPCRw56NtkQhgY559ZWjcBwXBTf DWtjmGxSL1wNylQVRd3PaN6h33AMUYN27sGCmwUQGAtJiUiUxW0zSPeuleltnKIhNi rfKjd1Jw05q3w== 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.7 192/713] wifi: iwlwifi: fix EWRD table validity check Date: Sun, 24 Mar 2024 18:38:38 -0400 Message-ID: <20240324224720.1345309-193-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324224720.1345309-1-sashal@kernel.org> References: <20240324224720.1345309-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