summaryrefslogtreecommitdiff
path: root/lib/check_signature.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2020-06-05 09:59:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-19 09:15:54 +0300
commitf2b639b2aa21c19feb8bc05a0457f731ffd934ac (patch)
tree0b86fba3b882499c7b0c7bc9f9b0107095d5d153 /lib/check_signature.c
parentc73eec04e6665f020ffb38890612811c12392afe (diff)
downloadlinux-f2b639b2aa21c19feb8bc05a0457f731ffd934ac.tar.xz
crc-t10dif: Fix potential crypto notify dead-lock
[ Upstream commit 3906f640224dbe7714b52b66d7d68c0812808e19 ] The crypto notify call occurs with a read mutex held so you must not do any substantial work directly. In particular, you cannot call crypto_alloc_* as they may trigger further notifications which may dead-lock in the presence of another writer. This patch fixes this by postponing the work into a work queue and taking the same lock in the module init function. While we're at it this patch also ensures that all RCU accesses are marked appropriately (tested with sparse). Finally this also reveals a race condition in module param show function as it may be called prior to the module init function. It's fixed by testing whether crct10dif_tfm is NULL (this is true iff the init function has not completed assuming fallback is false). Fixes: 11dcb1037f40 ("crc-t10dif: Allow current transform to be...") Fixes: b76377543b73 ("crc-t10dif: Pick better transform if one...") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/check_signature.c')
0 files changed, 0 insertions, 0 deletions