Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-02-22 09:37:29 +0100
committerMichal Kubecek <mkubecek@suse.cz>2019-02-22 09:37:29 +0100
commit9befaad2b49f2e982a842cc800d83c097f073b6b (patch)
tree951761970b405fb042a51d4cc3acfd1af4911ad9
parentadc218e422bec48e5cfe79c98a047e96d3438f4d (diff)
net: crypto set sk to NULL when af_alg_release (CVE-2019-8912
bsc#1125907). suse-commit: 3aed52ea4ecdcbf037d547b4e395f78430571b2e
-rw-r--r--crypto/af_alg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 17eb09d222ff..ec78a04eb136 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -122,8 +122,10 @@ static void alg_do_release(const struct af_alg_type *type, void *private)
int af_alg_release(struct socket *sock)
{
- if (sock->sk)
+ if (sock->sk) {
sock_put(sock->sk);
+ sock->sk = NULL;
+ }
return 0;
}
EXPORT_SYMBOL_GPL(af_alg_release);