]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
s390/crypto: fix possible sleep during spinlock aquired
authorHarald Freudenberger <freude@linux.ibm.com>
Mon, 27 May 2019 13:24:20 +0000 (15:24 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commita2359a43dcaeb1dbc15efb33ca8326d8fd567e69
tree81e7085219d94058bc503906165269fd77dc3df8
parentf12524a9fc463626a3f34d630001c6b347f3b2c8
s390/crypto: fix possible sleep during spinlock aquired

BugLink: https://bugs.launchpad.net/bugs/1838700
commit 1c2c7029c008922d4d48902cc386250502e73d51 upstream.

This patch fixes a complain about possible sleep during
spinlock aquired
"BUG: sleeping function called from invalid context at
include/crypto/algapi.h:426"
for the ctr(aes) and ctr(des) s390 specific ciphers.

Instead of using a spinlock this patch introduces a mutex
which is save to be held in sleeping context. Please note
a deadlock is not possible as mutex_trylock() is used.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reported-by: Julian Wiedmann <jwi@linux.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/s390/crypto/aes_s390.c
arch/s390/crypto/des_s390.c