Skip to content

Commit 5b3e7e6

Browse files
Dan Carpenterdavem330
authored andcommitted
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. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 563d34d commit 5b3e7e6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎net/openvswitch/actions.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
325325
}
326326
}
327327

328+
if (!acts_list)
329+
return 0;
330+
328331
return do_execute_actions(dp, skb, nla_data(acts_list),
329332
nla_len(acts_list), true);
330333
}

0 commit comments

Comments
 (0)