openvswitch: Avoid OOB read when parsing flow nlattrs
[ Upstream commit 04a4af334b
]
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 <ross.lagerwall@citrix.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
04663e84f0
commit
4b9245f2cd
|
@ -409,7 +409,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 |= 1 << type;
|
||||
a[type] = nla;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue