Skip to content

Commit

Permalink
openvswitch: Validate IPv6 flow key and mask values.
Browse files Browse the repository at this point in the history
Reject flow label key and mask values with invalid bits set.
Introduced by commit 3fdbd1c ("openvswitch: add ipv6 'set'
action").

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
  • Loading branch information
Jarno Rajahalme authored and Pravin B Shelar committed Nov 14, 2014
1 parent 8ec609d commit fecaef8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/openvswitch/flow_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,13 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match, u64 attrs,
ipv6_key->ipv6_frag, OVS_FRAG_TYPE_MAX);
return -EINVAL;
}

if (ipv6_key->ipv6_label & htonl(0xFFF00000)) {
OVS_NLERR("IPv6 flow label %x is out of range (max=%x).\n",
ntohl(ipv6_key->ipv6_label), (1 << 20) - 1);
return -EINVAL;
}

SW_FLOW_KEY_PUT(match, ipv6.label,
ipv6_key->ipv6_label, is_mask);
SW_FLOW_KEY_PUT(match, ip.proto,
Expand Down

0 comments on commit fecaef8

Please sign in to comment.