]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
crypto: af_alg - Use bh_lock_sock in sk_destruct
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 5 Dec 2019 05:45:05 +0000 (13:45 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 6 Mar 2020 07:13:20 +0000 (02:13 -0500)
commita9af5b739757bdc5ce289172c0bf324f79760ce3
tree25f9432133e9cd1b9d836191c314a6f593922d62
parent1c3fcdb8f5888371b2ecd1bc4ac3b59200204177
crypto: af_alg - Use bh_lock_sock in sk_destruct

BugLink: https://bugs.launchpad.net/bugs/1864904
commit 37f96694cf73ba116993a9d2d99ad6a75fa7fdb0 upstream.

As af_alg_release_parent may be called from BH context (most notably
due to an async request that only completes after socket closure,
or as reported here because of an RCU-delayed sk_destruct call), we
must use bh_lock_sock instead of lock_sock.

Reported-by: syzbot+c2f1558d49e25cc36e5e@syzkaller.appspotmail.com
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Fixes: c840ac6af3f8 ("crypto: af_alg - Disallow bind/setkey/...")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
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>
crypto/af_alg.c