* Patch "xfrm: NULL dereference on allocation failure" has been added to the 4.11-stable tree
@ 2017-07-03 11:51 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-07-03 11:51 UTC (permalink / raw)
To: dan.carpenter, gregkh, steffen.klassert; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
xfrm: NULL dereference on allocation failure
to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
xfrm-null-dereference-on-allocation-failure.patch
and it can be found in the queue-4.11 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From e747f64336fc15e1c823344942923195b800aa1e Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 14 Jun 2017 13:35:37 +0300
Subject: xfrm: NULL dereference on allocation failure
From: Dan Carpenter <dan.carpenter@oracle.com>
commit e747f64336fc15e1c823344942923195b800aa1e upstream.
The default error code in pfkey_msg2xfrm_state() is -ENOBUFS. We
added a new call to security_xfrm_state_alloc() which sets "err" to zero
so there several places where we can return ERR_PTR(0) if kmalloc()
fails. The caller is expecting error pointers so it leads to a NULL
dereference.
Fixes: df71837d5024 ("[LSM-IPSec]: Security association restriction.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/key/af_key.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1157,6 +1157,7 @@ static struct xfrm_state * pfkey_msg2xfr
goto out;
}
+ err = -ENOBUFS;
key = ext_hdrs[SADB_EXT_KEY_AUTH - 1];
if (sa->sadb_sa_auth) {
int keysize = 0;
Patches currently in stable-queue which might be from dan.carpenter@oracle.com are
queue-4.11/xfrm-oops-on-error-in-pfkey_msg2xfrm_state.patch
queue-4.11/xfrm-null-dereference-on-allocation-failure.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-03 11:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-03 11:51 Patch "xfrm: NULL dereference on allocation failure" has been added to the 4.11-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox