FAILED: patch "[PATCH] drm/amdgpu: Use unsigned ring indices in amdgpu_queue_mgr_map" failed to apply to 4.14-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
fa7c7939b4bf112cd06ba166b739244077898990Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <[email protected]>
Date: Wed, 22 Nov 2017 15:55:21 +0100
Subject: [PATCH] drm/amdgpu: Use unsigned ring indices in amdgpu_queue_mgr_map
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This matches the corresponding UAPI fields. Treating the ring index as signed could result in accessing random unrelated memory if the MSB was set.
ids v6")
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
@@ -717,7 +717,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev, struct amdgpu_queue_mgr *mgr);int amdgpu_queue_mgr_map (struct amdgpu_device *adev,struct amdgpu_queue_mgr *mgr, -int hw_ip,int instance,int ring, +u32 hw_ip,u32 instance,u32 ring,struct amdgpu_ring **out_ring);/*
drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c +3 -3
@@ -63,7 +63,7 @@ static int amdgpu_update_cached_map(struct amdgpu_queue_mapper *mapper,static int amdgpu_identity_map (struct amdgpu_device *adev,struct amdgpu_queue_mapper *mapper, -int ring, +u32 ring,struct amdgpu_ring **out_ring) {switch (mapper->hw_ip) {
@@ -121,7 +121,7 @@ static enum amdgpu_ring_type amdgpu_hw_ip_to_ring_type(int hw_ip)static int amdgpu_lru_map (struct amdgpu_device *adev,struct amdgpu_queue_mapper *mapper, -int user_ring,bool lru_pipe_order, +u32 user_ring,bool lru_pipe_order,struct amdgpu_ring **out_ring) {int r, i, j;
@@ -208,7 +208,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev,*/ int amdgpu_queue_mgr_map (struct amdgpu_device *adev,struct amdgpu_queue_mgr *mgr, -int hw_ip,int instance,int ring, +u32 hw_ip,u32 instance,u32 ring,struct amdgpu_ring **out_ring) {int r, ip_num_rings;
Hi Greg,
attached is a backport of this fix to 4.14.
Quoted 77 lines · On 2017-12-04 12:55 PM, [email protected] wrote:
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
Quoted 1 line
From
fa7c7939b4bf112cd06ba166b739244077898990Mon Sep 17 00:00:00 2001From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <[email protected]>
Date: Wed, 22 Nov 2017 15:55:21 +0100
Subject: [PATCH] drm/amdgpu: Use unsigned ring indices inamdgpu_queue_mgr_map
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bitThis matches the corresponding UAPI fields. Treating the ring index as signed could result in accessing random unrelated memory if the MSB was set.
Fixes effd924d2f3b ("drm/amdgpu: untie user ring ids from kernel ringids v6")Reviewed-by Alex Deucher <[email protected]>Reviewed-by Christian König <[email protected]>Signed-off-by Michel Dänzer <[email protected]>Signed-off-by Alex Deucher <[email protected]>drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-1@@ -717,7 +717,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev, struct amdgpu_queue_mgr *mgr);int amdgpu_queue_mgr_map (struct amdgpu_device *adev,struct amdgpu_queue_mgr *mgr, -int hw_ip,int instance,int ring, +u32 hw_ip,u32 instance,u32 ring,struct amdgpu_ring **out_ring);/* drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c +3
-3@@ -63,7 +63,7 @@ static int amdgpu_update_cached_map(struct amdgpu_queue_mapper *mapper,static int amdgpu_identity_map (struct amdgpu_device *adev,struct amdgpu_queue_mapper *mapper, -int ring, +u32 ring,struct amdgpu_ring **out_ring) {switch (mapper->hw_ip) {@@ -121,7 +121,7 @@ static enum amdgpu_ring_type amdgpu_hw_ip_to_ring_type(int hw_ip)static int amdgpu_lru_map (struct amdgpu_device *adev,struct amdgpu_queue_mapper *mapper, -int user_ring,bool lru_pipe_order, +u32 user_ring,bool lru_pipe_order,struct amdgpu_ring **out_ring) {int r, i, j;@@ -208,7 +208,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev,*/ int amdgpu_queue_mgr_map (struct amdgpu_device *adev,struct amdgpu_queue_mgr *mgr, -int hw_ip,int instance,int ring, +u32 hw_ip,u32 instance,u32 ring,struct amdgpu_ring **out_ring) {int r, ip_num_rings;
Signature · 2 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer
From 8ef715dfa2e1b71faf7a12da35a645a72bca9d44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <[email protected]>
Date: Mon, 4 Dec 2017 18:41:49 +0100
Subject: [PATCH] drm/amdgpu: Use unsigned ring indices in amdgpu_queue_mgr_map
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This matches the corresponding UAPI fields. Treating the ring index as signed could result in accessing random unrelated memory if the MSB was set.
ids v6")
(Cherry picked from commit fa7c7939b4bf112cd06ba166b739244077898990)
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
@@ -697,7 +697,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev, struct amdgpu_queue_mgr *mgr);int amdgpu_queue_mgr_map (struct amdgpu_device *adev,struct amdgpu_queue_mgr *mgr, -int hw_ip,int instance,int ring, +u32 hw_ip,u32 instance,u32 ring,struct amdgpu_ring **out_ring);/*
drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c +3 -3
@@ -63,7 +63,7 @@ static int amdgpu_update_cached_map(struct amdgpu_queue_mapper *mapper,static int amdgpu_identity_map (struct amdgpu_device *adev,struct amdgpu_queue_mapper *mapper, -int ring, +u32 ring,struct amdgpu_ring **out_ring) {switch (mapper->hw_ip) {
@@ -121,7 +121,7 @@ static enum amdgpu_ring_type amdgpu_hw_ip_to_ring_type(int hw_ip)static int amdgpu_lru_map (struct amdgpu_device *adev,struct amdgpu_queue_mapper *mapper, -int user_ring, +u32 user_ring,struct amdgpu_ring **out_ring) {int r, i, j;
@@ -208,7 +208,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev,*/ int amdgpu_queue_mgr_map (struct amdgpu_device *adev,struct amdgpu_queue_mgr *mgr, -int hw_ip,int instance,int ring, +u32 hw_ip,u32 instance,u32 ring,struct amdgpu_ring **out_ring) {int r, ip_num_rings;
Signature · 1 line
2.15.0
Greg KH
maintainerQuoted 5 lines · Michel D�nzer
Hi Greg,
attached is a backport of this fix to 4.14.
Now applied, thanks.
greg k-h