Patch "tipc: check return value of nlmsg_new" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tipc: check return value of nlmsg_new

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:
     tipc-check-return-value-of-nlmsg_new.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@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Thu Mar 22 14:40:23 CET 2018
From: Pan Bian <bianpan2016@xxxxxxx>
Date: Sun, 23 Apr 2017 15:09:19 +0800
Subject: tipc: check return value of nlmsg_new

From: Pan Bian <bianpan2016@xxxxxxx>


[ Upstream commit 78302fd405769c9a9379e9adda119d533dce2eed ]

Function nlmsg_new() will return a NULL pointer if there is no enough
memory, and its return value should be checked before it is used.
However, in function tipc_nl_node_get_monitor(), the validation of the
return value of function nlmsg_new() is missed. This patch fixes the
bug.

Signed-off-by: Pan Bian <bianpan2016@xxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 net/tipc/node.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -2094,6 +2094,8 @@ int tipc_nl_node_get_monitor(struct sk_b
 	int err;
 
 	msg.skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
+	if (!msg.skb)
+		return -ENOMEM;
 	msg.portid = info->snd_portid;
 	msg.seq = info->snd_seq;
 


Patches currently in stable-queue which might be from bianpan2016@xxxxxxx are

queue-4.9/tipc-check-return-value-of-nlmsg_new.patch
queue-4.9/mt7601u-check-return-value-of-alloc_skb.patch
queue-4.9/rndis_wlan-add-return-value-validation.patch
queue-4.9/libertas-check-return-value-of-alloc_workqueue.patch
queue-4.9/staging-wilc1000-fix-unchecked-return-value.patch
queue-4.9/qlcnic-fix-unchecked-return-value.patch
queue-4.9/wan-pc300too-abort-path-on-failure.patch
queue-4.9/power-supply-isp1704-fix-unchecked-return-value-of-devm_kzalloc.patch



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]