dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.10 01/22] drm/radeon: Fix integer overflow in radeon_cs_parser_init
@ 2023-07-24  1:23 Sasha Levin
  2023-07-24  1:24 ` [PATCH AUTOSEL 5.10 13/22] drm/amdgpu: install stub fence into potential unused fence pointers Sasha Levin
  0 siblings, 1 reply; 16+ messages in thread
From: Sasha Levin @ 2023-07-24  1:23 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Sasha Levin, airlied, amd-gfx, dri-devel, Alex Deucher,
	hackyzh002, Christian König

From: hackyzh002 <hackyzh002@gmail.com>

[ Upstream commit f828b681d0cd566f86351c0b913e6cb6ed8c7b9c ]

The type of size is unsigned, if size is 0x40000000, there will be an
integer overflow, size will be zero after size *= sizeof(uint32_t),
will cause uninitialized memory to be referenced later

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: hackyzh002 <hackyzh002@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/radeon/radeon_cs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index a78b60b62caf2..87a57e5588a28 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -271,7 +271,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
 {
 	struct drm_radeon_cs *cs = data;
 	uint64_t *chunk_array_ptr;
-	unsigned size, i;
+	u64 size;
+	unsigned i;
 	u32 ring = RADEON_CS_RING_GFX;
 	s32 priority = 0;
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-10-09 18:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24  1:23 [PATCH AUTOSEL 5.10 01/22] drm/radeon: Fix integer overflow in radeon_cs_parser_init Sasha Levin
2023-07-24  1:24 ` [PATCH AUTOSEL 5.10 13/22] drm/amdgpu: install stub fence into potential unused fence pointers Sasha Levin
2023-08-30 18:53   ` Chia-I Wu
2023-08-31 10:27     ` Christian König
2023-08-31 10:56       ` Greg KH
2023-08-31 13:26         ` Christian König
2023-08-31 14:01           ` Greg KH
2023-08-31 18:55             ` Chia-I Wu
2023-09-01  6:02               ` Christian König
2023-09-04  0:41                 ` Eddie Chapman
2023-08-31 10:29     ` Greg KH
2023-09-10 20:43       ` Bryan Jennings
2023-09-12 11:31         ` Greg KH
2023-10-07  9:50         ` Greg KH
2023-10-09 12:46           ` Christian König
2023-10-09 18:09             ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).