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

Commit 96050bca authored by Christian König's avatar Christian König Committed by Dave Airlie
Browse files

drm/radeon: fix a bug in the SA code



Aligning offset can make it bigger than tmp->offset
leading to an overrun bug in the following subtraction.

v2: Against initial suspicions this can't happen in mainline,
    so no need to push it into stable.

Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Reviewed-by: default avatarJerome Glisse <jglisse@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 36abacae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ int radeon_sa_bo_new(struct radeon_device *rdev,
	offset = 0;
	list_for_each_entry(tmp, &sa_manager->sa_bo, list) {
		/* room before this object ? */
		if ((tmp->offset - offset) >= size) {
		if (offset < tmp->offset && (tmp->offset - offset) >= size) {
			head = tmp->list.prev;
			goto out;
		}