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, Mar 28, 9:59 PM
Unknown Object (File)
Fri, Mar 22, 11:45 PM
Unknown Object (File)
Fri, Mar 22, 11:45 PM
Unknown Object (File)
Fri, Mar 22, 11:45 PM
Unknown Object (File)
Mar 9 2024, 8:35 PM
Unknown Object (File)
Feb 18 2024, 8:19 AM
Unknown Object (File)
Jan 16 2024, 12:09 AM
Unknown Object (File)
Jan 9 2024, 12:08 AM
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 :)