Patch "drm/amdkfd: Fix type of reset_type parameter in hqd_destroy() callback" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/amdkfd: Fix type of reset_type parameter in hqd_destroy() callback

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-amdkfd-fix-type-of-reset_type-parameter-in-hqd_d.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4d692f73848e7cb6136a345c928c4e36ab51ae8c
Author: Nathan Chancellor <nathan@xxxxxxxxxx>
Date:   Mon Oct 17 09:28:38 2022 -0700

    drm/amdkfd: Fix type of reset_type parameter in hqd_destroy() callback
    
    [ Upstream commit e688ba3e276422aa88eae7a54186a95320836081 ]
    
    When booting a kernel compiled with CONFIG_CFI_CLANG on a machine with
    an RX 6700 XT, there is a CFI failure in kfd_destroy_mqd_cp():
    
      [   12.894543] CFI failure at kfd_destroy_mqd_cp+0x2a/0x40 [amdgpu] (target: hqd_destroy_v10_3+0x0/0x260 [amdgpu]; expected type: 0x8594d794)
    
    Clang's kernel Control Flow Integrity (kCFI) makes sure that all
    indirect call targets have a type that exactly matches the function
    pointer prototype. In this case, hqd_destroy()'s third parameter,
    reset_type, should have a type of 'uint32_t' but every implementation of
    this callback has a third parameter type of 'enum kfd_preempt_type'.
    
    Update the function pointer prototype to match reality so that there is
    no more CFI violation.
    
    Link: https://github.com/ClangBuiltLinux/linux/issues/1738
    Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
index e85364dff4e0..5cb3e8634739 100644
--- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
@@ -262,8 +262,9 @@ struct kfd2kgd_calls {
 				uint32_t queue_id);
 
 	int (*hqd_destroy)(struct amdgpu_device *adev, void *mqd,
-				uint32_t reset_type, unsigned int timeout,
-				uint32_t pipe_id, uint32_t queue_id);
+				enum kfd_preempt_type reset_type,
+				unsigned int timeout, uint32_t pipe_id,
+				uint32_t queue_id);
 
 	bool (*hqd_sdma_is_occupied)(struct amdgpu_device *adev, void *mqd);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux