]> git.baikalelectronics.ru Git - kernel.git/commit
s390/zcrypt: fix possible deadlock situation on ap queue remove
authorHarald Freudenberger <freude@linux.ibm.com>
Wed, 3 Apr 2019 11:18:22 +0000 (13:18 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 10 Apr 2019 15:46:24 +0000 (17:46 +0200)
commit922446bcc9845547e5974d5f6de21595c28b90b4
tree749688b1dfb6adb9012e241ae4893153957e0b1e
parent85bffe81acbeac0d54e5bbe1068994bd66bc874f
s390/zcrypt: fix possible deadlock situation on ap queue remove

With commit e3e8f0a9c0ac ("s390/zcrypt: revisit ap device remove
procedure") the ap queue remove is now a two stage process. However,
a del_timer_sync() call may trigger the timer function which may
try to lock the very same spinlock as is held by the function
just initiating the del_timer_sync() call. This could end up in
a deadlock situation. Very unlikely but possible as you need to
remove an ap queue at the exact sime time when a timeout of a
request occurs.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reported-by: Pierre Morel <pmorel@linux.ibm.com>
Fixes: commit e3e8f0a9c0ac ("s390/zcrypt: revisit ap device remove procedure")
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/crypto/ap_queue.c