Skip to content

Commit 81a0af1

Browse files
chaudronNipaLocal
authored and
NipaLocal
committed
openvswitch: Stricter validation for the userspace action
This change enhances the robustness of validate_userspace() by ensuring that all Netlink attributes are fully contained within the parent attribute. The previous use of nla_parse_nested_deprecated() could silently skip trailing or malformed attributes, as it stops parsing at the first invalid entry. By switching to nla_parse_deprecated_strict(), we make sure only fully validated attributes are copied for later use. Signed-off-by: Eelco Chaudron <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 50657c8 commit 81a0af1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/openvswitch/flow_netlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3049,7 +3049,8 @@ static int validate_userspace(const struct nlattr *attr)
30493049
struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1];
30503050
int error;
30513051

3052-
error = nla_parse_nested_deprecated(a, OVS_USERSPACE_ATTR_MAX, attr,
3052+
error = nla_parse_deprecated_strict(a, OVS_USERSPACE_ATTR_MAX,
3053+
nla_data(attr), nla_len(attr),
30533054
userspace_policy, NULL);
30543055
if (error)
30553056
return error;

0 commit comments

Comments
 (0)