Page MenuHomeFreeBSD

armv8crypto: add missing unlock for session (fix "sleeping thread owns a non-sleepable lock")

Authored by on Jul 21 2019, 3:07 PM.
Referenced Files
Unknown Object (File)
Fri, Jun 21, 4:59 AM
Unknown Object (File)
Fri, Jun 7, 3:32 PM
Unknown Object (File)
Fri, May 31, 3:40 PM
Unknown Object (File)
Fri, May 31, 3:14 AM
Unknown Object (File)
May 8 2024, 10:03 PM
Unknown Object (File)
May 8 2024, 1:51 AM
Unknown Object (File)
May 6 2024, 8:06 AM
Unknown Object (File)
Apr 24 2024, 10:59 AM



Attempts to use cryptodev (e.g. tests at /usr/src/tests/sys/opencrypto with armv8crypto added to the module lists) were causing a panic:

panic: sleeping thread                                                                                                                                
cpuid = 1                                                                                                                                             
time = 1563713038                                                                                                                                     
KDB: stack backtrace:                                                                                                                                 
__rw_wlock_hard() at armv8_crypto_newsession+0x80                                                                                                     
         pc = 0xffff00000040017c  lr = 0xffff000001556e14                                                                                             
         sp = 0xffff0000719c1620  fp = 0xffff0000719c1640                                                                                             
armv8_crypto_newsession() at crypto_newsession+0x498                                                                                                  
         pc = 0xffff000001556e14  lr = 0xffff0000006448b4                                                                                             
         sp = 0xffff0000719c1650  fp = 0xffff0000719c16c0                                                                                             
crypto_newsession() at cryptof_ioctl+0x1168                                                                                                           
         pc = 0xffff0000006448b4  lr = 0xffff000075b9739c                                                                                             
         sp = 0xffff0000719c16d0  fp = 0xffff0000719c1890                                                                                             
cryptof_ioctl() at kern_ioctl+0x2f4                                                                                                                   
         pc = 0xffff000075b9739c  lr = 0xffff00000046f518                                                                                             
         sp = 0xffff0000719c18a0  fp = 0xffff0000719c18f0

Looks like the lock was just never unlocked in the happy case.

Diff Detail

rS FreeBSD src repository - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline

emaste added a subscriber: emaste.
emaste added inline comments.
266 ↗(On Diff #59985)

As an aside the word is dying

This revision is now accepted and ready to land.Jul 22 2019, 1:38 AM
266 ↗(On Diff #59985)

I have noticed that, but didn't want to add typo fixes to an unrelated patch :)