From: Ross Lagerwall <[email protected]>
Upstream commit:
commit 04a4af334b971814eedf4e4a413343ad3287d9a9
Author: Ross Lagerwall <[email protected]>
Date: Mon Jan 14 09:16:56 2019 +0000
openvswitch: Avoid OOB read when parsing flow nlattrs
For nested and variable attributes, the expected length of an attribute
is not known and marked by a negative number. This results in an OOB
read when the expected length is later used to check if the attribute is
all zeros. Fix this by using the actual length of the attribute rather
than the expected length.
Signed-off-by: Ross Lagerwall <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Cc: Ross Lagerwall <[email protected]>
Signed-off-by: Greg Rose <[email protected]>
---
datapath/flow_netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c
index 07a6026..e5e469a 100644
--- a/datapath/flow_netlink.c
+++ b/datapath/flow_netlink.c
@@ -502,7 +502,7 @@ static int __parse_flow_nlattrs(const struct nlattr *attr,
return -EINVAL;
}
- if (!nz || !is_all_zero(nla_data(nla), expected_len)) {
+ if (!nz || !is_all_zero(nla_data(nla), nla_len(nla))) {
attrs |= 1ULL << type;
a[type] = nla;
}
--
1.8.3.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev