From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Ma Jun" <Jun.Ma2@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Tim Huang" <Tim.Huang@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Sasha Levin" <sashal@kernel.org>,
Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch,
shashank.sharma@amd.com, hannes@cmpxchg.org,
friedrich.vock@gmx.de, andrealmeid@igalia.com,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 5.10 11/38] drm/amdgpu: Fix out-of-bounds write warning
Date: Wed, 31 Jul 2024 20:35:17 -0400 [thread overview]
Message-ID: <20240801003643.3938534-11-sashal@kernel.org> (raw)
In-Reply-To: <20240801003643.3938534-1-sashal@kernel.org>
From: Ma Jun <Jun.Ma2@amd.com>
[ Upstream commit be1684930f5262a622d40ce7a6f1423530d87f89 ]
Check the ring type value to fix the out-of-bounds
write warning
Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 6976f61be7341..b78feb8ba01e1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -260,7 +260,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
ring->priority = DRM_SCHED_PRIORITY_NORMAL;
mutex_init(&ring->priority_mutex);
- if (!ring->no_scheduler) {
+ if (!ring->no_scheduler && ring->funcs->type < AMDGPU_HW_IP_NUM) {
hw_ip = ring->funcs->type;
num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds;
adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
--
2.43.0
next prev parent reply other threads:[~2024-08-01 0:37 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 0:35 [PATCH AUTOSEL 5.10 01/38] drm/amdgpu: fix overflowed array index read warning Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 02/38] drm/amd/pm: fix warning using uninitialized value of max_vid_step Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 03/38] drm/amd/pm: fix the Out-of-bounds read warning Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 04/38] drm/amdgpu: fix uninitialized scalar variable warning Sasha Levin
2024-08-22 11:00 ` Pavel Machek
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 05/38] drm/amd/display: Check gpio_id before used as array index Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 06/38] drm/amd/display: Stop amdgpu_dm initialize when stream nums greater than 6 Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 07/38] drm/amd/display: Add array index check for hdcp ddc access Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 08/38] drm/amd/display: Check num_valid_sets before accessing reader_wm_sets[] Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 09/38] drm/amd/display: Check msg_id before processing transcation Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 10/38] drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create Sasha Levin
2024-08-01 0:35 ` Sasha Levin [this message]
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 12/38] drm/amdgpu: Fix out-of-bounds read of df_v1_7_channel_number Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 13/38] drm/amdgpu: fix ucode out-of-bounds read warning Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 14/38] drm/amdgpu: fix mc_data " Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 15/38] drm/amdkfd: Reconcile the definition and use of oem_id in struct kfd_topology_device Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 16/38] drm/amdgpu/pm: Check input value for CUSTOM profile mode setting on legacy SOCs Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 17/38] drm/amdgpu: the warning dereferencing obj for nbio_v7_4 Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 18/38] bpf, net: Use DEV_STAT_INC() Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 19/38] PCI: al: Check IORESOURCE_BUS existence during probe Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 20/38] hwspinlock: Introduce hwspin_lock_bust() Sasha Levin
2024-08-27 12:25 ` Pavel Machek
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 21/38] gpiolib: cdev: Add INIT_KFIFO() for linereq events Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 22/38] smack: tcp: ipv4, fix incorrect labeling Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 23/38] wifi: cfg80211: make hash table duplicates more survivable Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 24/38] drm/amd/display: added NULL check at start of dc_validate_stream Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 25/38] drm/amd/display: Skip wbscl_set_scaler_filter if filter is null Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 26/38] ALSA: vmaster: Return error for invalid input values Sasha Levin
2024-08-27 12:26 ` Pavel Machek
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 27/38] ELF: fix kernel.randomize_va_space double read Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 28/38] udf: Avoid excessive partition lengths Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 29/38] riscv: mm: Take memory hotplug read-lock during kernel page table dump Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 30/38] usb: uas: set host status byte on data completion error Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 31/38] cgroup: Protect css->cgroup write under css_set_lock Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 32/38] um: line: always fill *error_out in setup_one_line() Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 33/38] devres: Initialize an uninitialized struct member Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 34/38] pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 35/38] hwmon: (lm95234) Fix underflows seen when writing limit attributes Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 36/38] hwmon: (w83627ehf) " Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 37/38] libbpf: Add NULL checks to bpf_object__{prev_map,next_map} Sasha Levin
2024-08-01 0:35 ` [PATCH AUTOSEL 5.10 38/38] 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=20240801003643.3938534-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Jun.Ma2@amd.com \
--cc=Tim.Huang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrealmeid@igalia.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=friedrich.vock@gmx.de \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shashank.sharma@amd.com \
--cc=stable@vger.kernel.org \
/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