From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Hersen Wu <hersenxs.wu@amd.com>,
Harry Wentland <harry.wentland@amd.com>,
Tom Chung <chiahsuan.chung@amd.com>,
Daniel Wheeler <daniel.wheeler@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Sasha Levin <sashal@kernel.org>,
sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com,
christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
daniel@ffwll.ch, alex.hung@amd.com, hamza.mahfooz@amd.com,
roman.li@amd.com, mario.limonciello@amd.com, Wayne.Lin@amd.com,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 5.4 03/22] drm/amd/display: Stop amdgpu_dm initialize when stream nums greater than 6
Date: Wed, 31 Jul 2024 20:38:32 -0400 [thread overview]
Message-ID: <20240801003918.3939431-3-sashal@kernel.org> (raw)
In-Reply-To: <20240801003918.3939431-1-sashal@kernel.org>
From: Hersen Wu <hersenxs.wu@amd.com>
[ Upstream commit 84723eb6068c50610c5c0893980d230d7afa2105 ]
[Why]
Coverity reports OVERRUN warning. Should abort amdgpu_dm
initialize.
[How]
Return failure to amdgpu_dm_init.
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 3bfc4aa328c6f..869b38908b28d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2263,7 +2263,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
/* There is one primary plane per CRTC */
primary_planes = dm->dc->caps.max_streams;
- ASSERT(primary_planes <= AMDGPU_MAX_PLANES);
+ if (primary_planes > AMDGPU_MAX_PLANES) {
+ DRM_ERROR("DM: Plane nums out of 6 planes\n");
+ return -EINVAL;
+ }
/*
* Initialize primary planes, implicit planes for legacy IOCTLS.
--
2.43.0
next prev parent reply other threads:[~2024-08-01 0:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 0:38 [PATCH AUTOSEL 5.4 01/22] drm/amdgpu: fix overflowed array index read warning Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 02/22] drm/amd/display: Check gpio_id before used as array index Sasha Levin
2024-08-01 0:38 ` Sasha Levin [this message]
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 04/22] drm/amd/display: Check num_valid_sets before accessing reader_wm_sets[] Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 05/22] drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 06/22] drm/amdgpu: fix ucode out-of-bounds read warning Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 07/22] drm/amdgpu: fix mc_data " Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 08/22] drm/amdkfd: Reconcile the definition and use of oem_id in struct kfd_topology_device Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 09/22] smack: tcp: ipv4, fix incorrect labeling Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 10/22] wifi: cfg80211: make hash table duplicates more survivable Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 11/22] drm/amd/display: Skip wbscl_set_scaler_filter if filter is null Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 12/22] ELF: fix kernel.randomize_va_space double read Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 13/22] udf: Avoid excessive partition lengths Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 14/22] usb: uas: set host status byte on data completion error Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 15/22] cgroup: Protect css->cgroup write under css_set_lock Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 16/22] um: line: always fill *error_out in setup_one_line() Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 17/22] devres: Initialize an uninitialized struct member Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 18/22] pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 19/22] hwmon: (lm95234) Fix underflows seen when writing limit attributes Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 20/22] hwmon: (w83627ehf) " Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 21/22] libbpf: Add NULL checks to bpf_object__{prev_map,next_map} Sasha Levin
2024-08-01 0:38 ` [PATCH AUTOSEL 5.4 22/22] wifi: mwifiex: Do not return unused priv in mwifiex_get_priv_by_id() Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240801003918.3939431-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Wayne.Lin@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=chiahsuan.chung@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamza.mahfooz@amd.com \
--cc=harry.wentland@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=roman.li@amd.com \
--cc=stable@vger.kernel.org \
--cc=sunpeng.li@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox