Page MenuHomeFreeBSD

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

Authored by val_packett.cool on Jul 21 2019, 3:07 PM.
Tags
Referenced Files
Unknown Object (File)
Thu, Nov 28, 8:57 AM
Unknown Object (File)
Tue, Nov 19, 5:41 PM
Unknown Object (File)
Tue, Nov 19, 5:30 PM
Unknown Object (File)
Tue, Nov 19, 3:20 PM
Unknown Object (File)
Mon, Nov 11, 4:37 PM
Unknown Object (File)
Fri, Nov 1, 10:59 AM
Unknown Object (File)
Fri, Nov 1, 8:54 AM
Unknown Object (File)
Thu, Oct 31, 2:28 PM
Subscribers

Details

Summary

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

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

Event Timeline

emaste added a subscriber: emaste.
emaste added inline comments.
sys/crypto/armv8/armv8_crypto.c
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
sys/crypto/armv8/armv8_crypto.c
266 ↗(On Diff #59985)

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