In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: fix deadlock while reading mqd from debugfs
An errant disk backup on my desktop got into debugfs and triggered the following deadlock scenario in the amdgpu debugfs files. The machine also hard-resets immediately after those lines are printed (although I wasn't able to reproduce that part when reading by hand):
[ 1318.016074][ T1082] ====================================================== [ 1318.016607][ T1082] WARNING: possible circular locking dependency detected [ 1318.017107][ T1082] 6.8.0-rc7-00015-ge0c8221b72c0 #17 Not tainted [ 1318.017598][ T1082] ------------------------------------------------------ [ 1318.018096][ T1082] tar/1082 is trying to acquire lock: [ 1318.018585][ T1082] ffff98c44175d6a0 (&mm->mmaplock){++++}-{3:3}, at: _mightfault+0x40/0x80 [ 1318.019084][ T1082] [ 1318.019084][ T1082] but task is already holding lock: [ 1318.020052][ T1082] ffff98c4c13f55f8 (reservationwwclassmutex){+.+.}-{3:3}, at: amdgpudebugfsmqdread+0x6a/0x250 [amdgpu] [ 1318.020607][ T1082] [ 1318.020607][ T1082] which lock already depends on the new lock. [ 1318.020607][ T1082] [ 1318.022081][ T1082] [ 1318.022081][ T1082] the existing dependency chain (in reverse order) is: [ 1318.023083][ T1082] [ 1318.023083][ T1082] -> #2 (reservationwwclassmutex){+.+.}-{3:3}: [ 1318.024114][ T1082] _wwmutexlock.constprop.0+0xe0/0x12f0 [ 1318.024639][ T1082] wwmutexlock+0x32/0x90 [ 1318.025161][ T1082] dmaresvlockdep+0x18a/0x330 [ 1318.025683][ T1082] dooneinitcall+0x6a/0x350 [ 1318.026210][ T1082] kernelinitfreeable+0x1a3/0x310 [ 1318.026728][ T1082] kernelinit+0x15/0x1a0 [ 1318.027242][ T1082] retfromfork+0x2c/0x40 [ 1318.027759][ T1082] retfromforkasm+0x11/0x20 [ 1318.028281][ T1082] [ 1318.028281][ T1082] -> #1 (reservationwwclassacquire){+.+.}-{0:0}: [ 1318.029297][ T1082] dmaresvlockdep+0x16c/0x330 [ 1318.029790][ T1082] dooneinitcall+0x6a/0x350 [ 1318.030263][ T1082] kernelinitfreeable+0x1a3/0x310 [ 1318.030722][ T1082] kernelinit+0x15/0x1a0 [ 1318.031168][ T1082] retfromfork+0x2c/0x40 [ 1318.031598][ T1082] retfromforkasm+0x11/0x20 [ 1318.032011][ T1082] [ 1318.032011][ T1082] -> #0 (&mm->mmaplock){++++}-{3:3}: [ 1318.032778][ T1082] _lockacquire+0x14bf/0x2680 [ 1318.033141][ T1082] lockacquire+0xcd/0x2c0 [ 1318.033487][ T1082] _mightfault+0x58/0x80 [ 1318.033814][ T1082] amdgpudebugfsmqdread+0x103/0x250 [amdgpu] [ 1318.034181][ T1082] fullproxyread+0x55/0x80 [ 1318.034487][ T1082] vfsread+0xa7/0x360 [ 1318.034788][ T1082] ksysread+0x70/0xf0 [ 1318.035085][ T1082] dosyscall64+0x94/0x180 [ 1318.035375][ T1082] entrySYSCALL64afterhwframe+0x46/0x4e [ 1318.035664][ T1082] [ 1318.035664][ T1082] other info that might help us debug this: [ 1318.035664][ T1082] [ 1318.036487][ T1082] Chain exists of: [ 1318.036487][ T1082] &mm->mmaplock --> reservationwwclassacquire --> reservationwwclassmutex [ 1318.036487][ T1082] [ 1318.037310][ T1082] Possible unsafe locking scenario: [ 1318.037310][ T1082] [ 1318.037838][ T1082] CPU0 CPU1 [ 1318.038101][ T1082] ---- ---- [ 1318.038350][ T1082] lock(reservationwwclassmutex); [ 1318.038590][ T1082] lock(reservationwwclassacquire); [ 1318.038839][ T1082] lock(reservationwwclassmutex); [ 1318.039083][ T1082] rlock(&mm->mmaplock); [ 1318.039328][ T1082] [ 1318.039328][ T1082] * DEADLOCK * [ 1318.039328][ T1082] [ 1318.040029][ T1082] 1 lock held by tar/1082: [ 1318.040259][ T1082] #0: ffff98c4c13f55f8 (reservationwwclassmutex){+.+.}-{3:3}, at: amdgpudebugfsmqdread+0x6a/0x250 [amdgpu] [ 1318.040560][ T1082] [ 1318.040560][ T1082] stack backtrace: [ ---truncated---
[
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"145721147458125715800497377500144582193",
"286907998892922863685168567491004897170",
"162551889987318711258030453047537078811",
"143473717480909101241065511882041577151",
"212542470618880761989253445887418976392",
"188623117175629271865418477924288723853",
"136594791049552043326895470228205302546",
"316764134935636653581520740918327087373",
"266913946516582848198946386244058519800",
"264710150108171676656119745493422339472",
"132720230608542502499462408184660254302",
"8876943962047218429446997647996943780",
"176146358856659816500811734444707437613",
"70584960633912635266996152250933861302",
"60340557225674897286544669271157260996",
"100054897525603249946556340978248094361",
"110510851213399989389248842380655351504",
"257628091856892654090738868479724821033",
"318423955586603313931236379795292598437",
"318140353855235961899830892845384080261",
"220488906413895836728586773456634384214",
"18237540891499389553989051309382499742",
"258037584005481781392561609077721174410",
"237140740494104680315743509346000196851",
"310153520753821139900796866839427364312",
"79622887266649688817426356939197433727",
"319508789466672789798161476545058419711",
"259116898405334759764895738103624851067",
"19001395690807986001434477152271046904",
"254186706681926384940448889664100148277",
"315187116173227106872523605823680478123",
"213248354395864900244886917360295582282",
"186850757081200767458653722527950200674",
"210972767885406126306290250648096374745",
"53968300360849497147528035787055355247"
]
},
"target": {
"file": "drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c"
},
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@197f6d6987c55860f6eea1c93e4f800c59078874",
"id": "CVE-2024-35795-4020648f"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"145721147458125715800497377500144582193",
"286907998892922863685168567491004897170",
"162551889987318711258030453047537078811",
"143473717480909101241065511882041577151",
"212542470618880761989253445887418976392",
"188623117175629271865418477924288723853",
"136594791049552043326895470228205302546",
"316764134935636653581520740918327087373",
"266913946516582848198946386244058519800",
"264710150108171676656119745493422339472",
"132720230608542502499462408184660254302",
"8876943962047218429446997647996943780",
"176146358856659816500811734444707437613",
"70584960633912635266996152250933861302",
"60340557225674897286544669271157260996",
"100054897525603249946556340978248094361",
"110510851213399989389248842380655351504",
"257628091856892654090738868479724821033",
"318423955586603313931236379795292598437",
"318140353855235961899830892845384080261",
"220488906413895836728586773456634384214",
"18237540891499389553989051309382499742",
"258037584005481781392561609077721174410",
"237140740494104680315743509346000196851",
"310153520753821139900796866839427364312",
"79622887266649688817426356939197433727",
"319508789466672789798161476545058419711",
"259116898405334759764895738103624851067",
"19001395690807986001434477152271046904",
"254186706681926384940448889664100148277",
"315187116173227106872523605823680478123",
"213248354395864900244886917360295582282",
"186850757081200767458653722527950200674",
"210972767885406126306290250648096374745",
"53968300360849497147528035787055355247"
]
},
"target": {
"file": "drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c"
},
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4687e3c6ee877ee25e57b984eca00be53b9a8db5",
"id": "CVE-2024-35795-63fdef1f"
},
{
"digest": {
"length": 774.0,
"function_hash": "195113986615175121629639366678839800371"
},
"target": {
"function": "amdgpu_debugfs_mqd_read",
"file": "drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c"
},
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8678b1060ae2b75feb60b87e5b75e17374e3c1c5",
"id": "CVE-2024-35795-a076ff9b"
},
{
"digest": {
"length": 774.0,
"function_hash": "195113986615175121629639366678839800371"
},
"target": {
"function": "amdgpu_debugfs_mqd_read",
"file": "drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c"
},
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@197f6d6987c55860f6eea1c93e4f800c59078874",
"id": "CVE-2024-35795-a722d5b6"
},
{
"digest": {
"length": 774.0,
"function_hash": "195113986615175121629639366678839800371"
},
"target": {
"function": "amdgpu_debugfs_mqd_read",
"file": "drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c"
},
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8b03556da6e576c62664b6cd01809e4a09d53b5b",
"id": "CVE-2024-35795-bb343f57"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"145721147458125715800497377500144582193",
"286907998892922863685168567491004897170",
"162551889987318711258030453047537078811",
"143473717480909101241065511882041577151",
"212542470618880761989253445887418976392",
"188623117175629271865418477924288723853",
"136594791049552043326895470228205302546",
"316764134935636653581520740918327087373",
"266913946516582848198946386244058519800",
"264710150108171676656119745493422339472",
"132720230608542502499462408184660254302",
"8876943962047218429446997647996943780",
"176146358856659816500811734444707437613",
"70584960633912635266996152250933861302",
"60340557225674897286544669271157260996",
"100054897525603249946556340978248094361",
"110510851213399989389248842380655351504",
"257628091856892654090738868479724821033",
"318423955586603313931236379795292598437",
"318140353855235961899830892845384080261",
"220488906413895836728586773456634384214",
"18237540891499389553989051309382499742",
"258037584005481781392561609077721174410",
"237140740494104680315743509346000196851",
"310153520753821139900796866839427364312",
"79622887266649688817426356939197433727",
"319508789466672789798161476545058419711",
"259116898405334759764895738103624851067",
"19001395690807986001434477152271046904",
"254186706681926384940448889664100148277",
"315187116173227106872523605823680478123",
"213248354395864900244886917360295582282",
"186850757081200767458653722527950200674",
"210972767885406126306290250648096374745",
"53968300360849497147528035787055355247"
]
},
"target": {
"file": "drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c"
},
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8b03556da6e576c62664b6cd01809e4a09d53b5b",
"id": "CVE-2024-35795-e051f119"
},
{
"digest": {
"length": 774.0,
"function_hash": "195113986615175121629639366678839800371"
},
"target": {
"function": "amdgpu_debugfs_mqd_read",
"file": "drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c"
},
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4687e3c6ee877ee25e57b984eca00be53b9a8db5",
"id": "CVE-2024-35795-e662ba2f"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"145721147458125715800497377500144582193",
"286907998892922863685168567491004897170",
"162551889987318711258030453047537078811",
"143473717480909101241065511882041577151",
"212542470618880761989253445887418976392",
"188623117175629271865418477924288723853",
"136594791049552043326895470228205302546",
"316764134935636653581520740918327087373",
"266913946516582848198946386244058519800",
"264710150108171676656119745493422339472",
"132720230608542502499462408184660254302",
"8876943962047218429446997647996943780",
"176146358856659816500811734444707437613",
"70584960633912635266996152250933861302",
"60340557225674897286544669271157260996",
"100054897525603249946556340978248094361",
"110510851213399989389248842380655351504",
"257628091856892654090738868479724821033",
"318423955586603313931236379795292598437",
"318140353855235961899830892845384080261",
"220488906413895836728586773456634384214",
"18237540891499389553989051309382499742",
"258037584005481781392561609077721174410",
"237140740494104680315743509346000196851",
"310153520753821139900796866839427364312",
"79622887266649688817426356939197433727",
"319508789466672789798161476545058419711",
"259116898405334759764895738103624851067",
"19001395690807986001434477152271046904",
"254186706681926384940448889664100148277",
"315187116173227106872523605823680478123",
"213248354395864900244886917360295582282",
"186850757081200767458653722527950200674",
"210972767885406126306290250648096374745",
"53968300360849497147528035787055355247"
]
},
"target": {
"file": "drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c"
},
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8678b1060ae2b75feb60b87e5b75e17374e3c1c5",
"id": "CVE-2024-35795-e7bf2e68"
}
]