diff mbox series

[ovs-dev,3/5] net: openvswitch: fix a NULL pointer dereference

Message ID 1553700739-11387-4-git-send-email-gvrose8192@gmail.com
State Accepted
Headers show
Series Linux datapath upstream fixes | expand

Commit Message

Gregory Rose March 27, 2019, 3:32 p.m. UTC
From: Kangjie Lu <kjlu@umn.edu>

Upstream commit:
    commit 6f19893b644a9454d85e593b5e90914e7a72b7dd
    Author: Kangjie Lu <kjlu@umn.edu>
    Date:   Thu Mar 14 23:20:16 2019 -0500

    net: openvswitch: fix a NULL pointer dereference

    upcall is dereferenced even when genlmsg_put fails. The fix
    goto out to avoid the NULL pointer dereference in this case.

    Signed-off-by: Kangjie Lu <kjlu@umn.edu>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Cc:  Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/datapath.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

0-day Robot March 27, 2019, 4:08 p.m. UTC | #1
Bleep bloop.  Greetings Gregory Rose, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Kangjie Lu <kjlu@umn.edu> needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Greg Rose <gvrose8192@gmail.com>
Lines checked: 43, Warnings: 1, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@bytheb.org

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 2febcb3..1340d6b 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -459,6 +459,10 @@  static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
 
 	upcall = genlmsg_put(user_skb, 0, 0, &dp_packet_genl_family,
 			     0, upcall_info->cmd);
+	if (!upcall) {
+		err = -EINVAL;
+		goto out;
+	}
 	upcall->dp_ifindex = dp_ifindex;
 
 	err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb);