openvswitch: potential NULL deref in sample()
Subsystems (4)
PATCH 1/1 openvswitch: potential NULL deref in sample()
If there is no OVS_SAMPLE_ATTR_ACTIONS set then "acts_list" is NULL and it leads to a NULL dereference when we call nla_len(acts_list). This is a static checker fix, not something I have seen in testing.
---
This applies to Linus's tree.
net/openvswitch/actions.c +3 -0
@@ -325,6 +325,9 @@ static int sample(struct datapath *dp, struct sk_buff *skb, } } +if (!acts_list) +return 0 ; +return do_execute_actions (dp, skb,nla_data (acts_list),nla_len (acts_list), true); }
A message that is not in the archive (sent off-list or not yet received): [email protected]
David Miller
AppliedFrom: Dan Carpenter <[email protected]>
Date: Mon, 23 Jul 2012 10:46:28 +0300
Quoted 5 lines
If there is no
OVS_SAMPLE_ATTR_ACTIONSset then "acts_list" is NULL and it leads to a NULL dereference when we callnla_len(acts_list). This is a static checker fix, not something I have seen in testing.Signed-off-by Dan Carpenter <[email protected]>
Applied, thanks Dan.
Quoted 5 lines · Dan Carpenter
If there is no
OVS_SAMPLE_ATTR_ACTIONSset then "acts_list" is NULL and it leads to a NULL dereference when we callnla_len(acts_list). This is a static checker fix, not something I have seen in testing.Signed-off-by Dan Carpenter <[email protected]>
This can never happen in practice because the action list is validated at the time that userspace installs the flow. There are plenty of things in this category that would appear to be unsafe because we'd much rather do sanity checking on a per-flow basis rather than per-packet.