From patchwork Tue Oct 8 22:29:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bethany Jamison X-Patchwork-Id: 1994467 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XNW1K0CLfz1xsv for ; Wed, 9 Oct 2024 09:30:12 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1syIiR-0001Hg-UZ; Tue, 08 Oct 2024 22:30:03 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1syIiQ-0001H6-4X for kernel-team@lists.ubuntu.com; Tue, 08 Oct 2024 22:30:02 +0000 Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B0F263F185 for ; Tue, 8 Oct 2024 22:30:01 +0000 (UTC) Received: by mail-il1-f200.google.com with SMTP id e9e14a558f8ab-3a359fcfb2dso6323825ab.1 for ; Tue, 08 Oct 2024 15:30:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728426600; x=1729031400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+QpZP9otBLZ+9XjFwr9OlaJgTwg7Bayuly/EDW1H9ec=; b=YFkRts2c/qpwi+o/XIYJ1oEa5tR/8xTsVzqhf9GRFfKl5NEamz4GEa6Gfgoqti4ZC/ 4oRw89vBL/FbU5QV0CGF50hg0d6xixHdkC2erJQhq02fGCk1gUoador4Gbvj8e08fnyN iNi9NhoUXg2rvWv/bFObtPjKeb4/LTIriQcOQwAy09EKFxyIsUT9MdPXI419dd5eTdwc Qzdyj5kTz6o4lGp/VbFYX+XMHVc/67H7/At7MPh3ISz0DtenPRlCtwS/DNzzgTfJPAyq S8LWhv/HHsYIXqN/crJMfrplPPyLzwy7tXDFgRJzTHKZBBPmqrzY/skBY0ZB2pkiGPTu 4JLg== X-Gm-Message-State: AOJu0YyUKoWg1xbiRcBxLzVwrQJm8zhj9zZWAdWpSVIo/57xUjKcighP OmYhNAf+EPxWCz0yh8+e7kH/9JDF+3WcHCbpWAOz5KFRk+BdG++pocDWygIS/RCy2Zf7XOQHDyN ynd+7jCqbvnXGa12A/poC3AGJa+FSmdpZKpyfG+zo2TXCMav5OPm0zxHSE1jnPlOs19nXTih8Ck K1xGzbnmJMmA== X-Received: by 2002:a6b:d910:0:b0:834:f671:4700 with SMTP id ca18e2360f4ac-8353d4859d1mr15434139f.2.1728426600209; Tue, 08 Oct 2024 15:30:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGx7pj3HF8mg0XWEG6c8dP6q94oT3jsvdRRQK4I1ckxD6IkhXyK0LXKKgsHWVedhuoDsogQiA== X-Received: by 2002:a6b:d910:0:b0:834:f671:4700 with SMTP id ca18e2360f4ac-8353d4859d1mr15433839f.2.1728426599741; Tue, 08 Oct 2024 15:29:59 -0700 (PDT) Received: from smtp.gmail.com (167-248-51-36.oa02.lnk04.ne.dynamic.allophone.net. [167.248.51.36]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83503a74c21sm194918839f.6.2024.10.08.15.29.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 15:29:59 -0700 (PDT) From: Bethany Jamison To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH 1/1] drm/amdgpu: fix mc_data out-of-bounds read warning Date: Tue, 8 Oct 2024 17:29:57 -0500 Message-Id: <20241008222957.39337-2-bethany.jamison@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241008222957.39337-1-bethany.jamison@canonical.com> References: <20241008222957.39337-1-bethany.jamison@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Tim Huang [ Upstream commit 51dfc0a4d609fe700750a62f41447f01b8c9ea50 ] Clear warning that read mc_data[i-1] may out-of-bounds. Signed-off-by: Tim Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin (cherry picked from commit 578ae965e8b90cd09edeb0252b50fa0503ea35c5 linux-6.10.y) CVE-2024-46722 Signed-off-by: Bethany Jamison --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index dce9e7d5e4ec6..a14a54a734c12 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -1476,6 +1476,8 @@ int amdgpu_atombios_init_mc_reg_table(struct amdgpu_device *adev, (u32)le32_to_cpu(*((u32 *)reg_data + j)); j++; } else if ((reg_table->mc_reg_address[i].pre_reg_data & LOW_NIBBLE_MASK) == DATA_EQU_PREV) { + if (i == 0) + continue; reg_table->mc_reg_table_entry[num_ranges].mc_data[i] = reg_table->mc_reg_table_entry[num_ranges].mc_data[i - 1]; }