Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c71dbd93 authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher
Browse files

drm/amd/amdgpu: ring debugfs is read in increments of 4 bytes



If a user tries to read a non-multiple of 4 bytes it would have
read until the end of the ring potentially crashing the user
task.

Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4f4824b5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf,
	int r, i;
	uint32_t value, result, early[3];

	if (*pos & 3)
	if (*pos & 3 || size & 3)
		return -EINVAL;

	result = 0;