Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-02-22 09:41:18 +0100
committerMichal Kubecek <mkubecek@suse.cz>2019-02-22 09:41:18 +0100
commitbf41149371a6a61401570926ff29d3f7fddac9c6 (patch)
tree5c68c571d8df7f10f85ce2e4fce5592bfab992f0
parentfa37dba0c12b1469b21a80bf66f5a5a007774e9f (diff)
net: crypto set sk to NULL when af_alg_release (CVE-2019-8912
bsc#1125907). suse-commit: e1b5b1f52066b7ddd05af024a8e42ea03af4d267
-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);