lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Sep 2021 17:39:28 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     alexander.deucher@....com, christian.koenig@....com,
        Xinhui.Pan@....com, airlied@...ux.ie, daniel@...ll.ch,
        Hawking.Zhang@....com, Felix.Kuehling@....com, ray.huang@....com,
        lee.jones@...aro.org
Cc:     amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: [BUG] gpu: drm: amd: amdgpu: possible ABBA deadlock in
 amdgpu_set_power_dpm_force_performance_level() and
 amdgpu_debugfs_process_reg_op()

Hello,

My static analysis tool reports a possible ABBA deadlock in the amdgpu 
driver in Linux 5.10:

amdgpu_debugfs_process_reg_op()
   mutex_lock(&adev->grbm_idx_mutex); --> Line 250 (Lock A)
   mutex_lock(&adev->pm.mutex); --> Line 259 (Lock B)

amdgpu_set_power_dpm_force_performance_level()
   mutex_lock(&adev->pm.mutex); --> Line 381 (Lock B)
     pp_dpm_force_performance_level() --> function pointer via 
"amdgpu_dpm_force_performance_level()"
       pp_dpm_en_umd_pstate()
         amdgpu_device_ip_set_clockgating_state()
           gfx_v7_0_set_clockgating_state() --> function pointer via 
"funcs->set_clockgating_state()"
             gfx_v7_0_enable_mgcg()
               mutex_lock(&adev->grbm_idx_mutex); --> Line 3646 (Lock A)
               mutex_lock(&adev->grbm_idx_mutex); --> Line 3697 (Lock A)

When amdgpu_debugfs_process_reg_op() and 
amdgpu_set_power_dpm_force_performance_level() are concurrently 
executed, the deadlock can occur.

I am not quite sure whether this possible deadlock is real and how to 
fix it if it is real.
Any feedback would be appreciated, thanks :)

Reported-by: TOTE Robot <oslab@...nghua.edu.cn>


Best wishes,
Jia-Ju Bai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ