All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: Fix buffer overflow in arcturus_get_unique_id()
@ 2020-06-08 14:18 ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2020-06-08 14:18 UTC (permalink / raw)
  To: Evan Quan, Kent Russell
  Cc: David Airlie, kernel-janitors, amd-gfx, Daniel Vetter,
	Alex Deucher, Christian König

The comments say that the "sn" buffer is used to hold a 16-digit HEX
string so the buffer needs to be at least 17 characters to hold the
NUL terminator.

Fixes: 81a16241114b ("drm/amdgpu: Add unique_id and serial_number for Arcturus v3")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
index df7b408319f76..a575cb9d1574c 100644
--- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
@@ -2266,7 +2266,7 @@ static void arcturus_get_unique_id(struct smu_context *smu)
 {
 	struct amdgpu_device *adev = smu->adev;
 	uint32_t top32, bottom32, smu_version, size;
-	char sn[16];
+	char sn[20];
 	uint64_t id;
 
 	if (smu_get_smc_version(smu, NULL, &smu_version)) {
-- 
2.26.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2020-06-10 19:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-08 14:18 [PATCH] drm/amd/powerplay: Fix buffer overflow in arcturus_get_unique_id() Dan Carpenter
2020-06-08 14:18 ` Dan Carpenter
2020-06-09  3:56 ` Quan, Evan
2020-06-09  3:56   ` Quan, Evan
2020-06-10  8:56   ` [PATCH v2] drm/amdgpu: Fix a buffer overflow handling the serial number Dan Carpenter
2020-06-10  8:56     ` Dan Carpenter
2020-06-10 10:57     ` Quan, Evan
2020-06-10 10:57       ` Quan, Evan
2020-06-10 19:36       ` Alex Deucher
2020-06-10 19:36         ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.