drm/radeon: Fix integer overflow in radeon_cs_parser_init
Subsystems (3)
PATCH v3 1/2 drm/radeon: Fix integer overflow in radeon_cs_parser_init
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
--- drivers/gpu/drm/radeon/radeon_cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_cs.c +2 -1
@@ -270,7 +270,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 ;
Signature · 1 line
2.34.1
Am 19.04.23 um 14:20 schrieb hackyzh002:
Quoted 5 lines
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 laterSigned-off-by hackyzh002 <[email protected]>
Quoted 18 lines
--- drivers/gpu/drm/radeon/radeon_cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_cs.c +2
-1@@ -270,7 +270,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 ;
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 29 lines · Christian König
Am 19.04.23 um 14:20 schrieb hackyzh002:
Quoted 5 lines
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 laterSigned-off-by hackyzh002 <[email protected]>Quoted 18 lines
--- drivers/gpu/drm/radeon/radeon_cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/radeon/radeon_cs.c +2
-1@@ -270,7 +270,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 ;
Hello,
What is the current status of this patch, has it been applied?
Quoted 38 lines · Alex Deucher <[email protected]> 于2023年4月19日周三 21:49写道:
Applied. Thanks!
Alex
Quoted 8 lines · Christian König
Am 19.04.23 um 14:20 schrieb hackyzh002:
Quoted 5 lines
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 laterSigned-off-by hackyzh002 <[email protected]>Quoted 7 lines
Review
Quoted 5 lines
--- drivers/gpu/drm/radeon/radeon_cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/radeon/radeon_cs.cQuoted 4 lines
drivers/gpu/drm/radeon/radeon_cs.c int radeon_cs_parser_init(struct radeon_cs_parser
Quoted 4 lines
index
46a27ebf4..a6700d727100644drivers/gpu/drm/radeon/radeon_cs.c +0
-0@@ -270,7 +270,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser*p, void *data)
Quoted 10 lines
Quoted 9 lines
drivers/gpu/drm/radeon/radeon_cs.c +2
-1{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 ;