]> git.proxmox.com Git - mirror_ovs.git/commit - datapath/meter.c
datapath: meter: fix NULL pointer dereference in ovs_meter_cmd_reply_start
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Wed, 7 Feb 2018 15:49:57 +0000 (07:49 -0800)
committerPravin B Shelar <pshelar@ovn.org>
Tue, 13 Feb 2018 06:39:19 +0000 (22:39 -0800)
commitb88ec467c6059f5cf3f0f27507f0515271067388
tree504fd7c68637bd9af86a0e968f655293f12da029
parentab86f680831ca239e451106a82006a9eae10394c
datapath: meter: fix NULL pointer dereference in ovs_meter_cmd_reply_start

Upstream commit:
    commit b74912a2fdae9aadd20da502644aa8848c861954
    Author: Gustavo A. R. Silva <garsilva@embeddedor.com>
    Date:   Tue Nov 14 14:26:16 2017 -0600

    openvswitch: meter: fix NULL pointer dereference in ovs_meter_cmd_reply_star

    It seems that the intention of the code is to null check the value
    returned by function genlmsg_put. But the current code is null
    checking the address of the pointer that holds the value returned
    by genlmsg_put.

    Fix this by properly null checking the value returned by function
    genlmsg_put in order to avoid a pontential null pointer dereference.

    Addresses-Coverity-ID: 1461561 ("Dereference before null check")
    Addresses-Coverity-ID: 1461562 ("Dereference null return value")
Fixes: 96fbc13d7e77 ("openvswitch: Add meter infrastructure")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
datapath/meter.c