* Patch "kcm: fix a null pointer dereference in kcm_sendmsg()" has been added to the 4.9-stable tree
@ 2017-02-23 20:17 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-02-23 20:17 UTC (permalink / raw)
To: xiyou.wangcong, davem, dvyukov, gregkh, tom; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
kcm: fix a null pointer dereference in kcm_sendmsg()
to the 4.9-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:
kcm-fix-a-null-pointer-dereference-in-kcm_sendmsg.patch
and it can be found in the queue-4.9 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 foo@baz Thu Feb 23 21:13:05 CET 2017
From: WANG Cong <xiyou.wangcong@gmail.com>
Date: Mon, 13 Feb 2017 11:13:16 -0800
Subject: kcm: fix a null pointer dereference in kcm_sendmsg()
From: WANG Cong <xiyou.wangcong@gmail.com>
[ Upstream commit cd27b96bc13841ee7af25837a6ae86fee87273d6 ]
In commit 98e3862ca2b1 ("kcm: fix 0-length case for kcm_sendmsg()")
I tried to avoid skb allocation for 0-length case, but missed
a check for NULL pointer in the non EOR case.
Fixes: 98e3862ca2b1 ("kcm: fix 0-length case for kcm_sendmsg()")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Tom Herbert <tom@herbertland.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/kcm/kcmsock.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1044,8 +1044,10 @@ wait_for_memory:
} else {
/* Message not complete, save state */
partial_message:
- kcm->seq_skb = head;
- kcm_tx_msg(head)->last_skb = skb;
+ if (head) {
+ kcm->seq_skb = head;
+ kcm_tx_msg(head)->last_skb = skb;
+ }
}
KCM_STATS_ADD(kcm->stats.tx_bytes, copied);
Patches currently in stable-queue which might be from xiyou.wangcong@gmail.com are
queue-4.9/kcm-fix-0-length-case-for-kcm_sendmsg.patch
queue-4.9/kcm-fix-a-null-pointer-dereference-in-kcm_sendmsg.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-02-23 20:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-23 20:17 Patch "kcm: fix a null pointer dereference in kcm_sendmsg()" has been added to the 4.9-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;
as well as URLs for NNTP newsgroup(s).