Skip to content

Commit 55cef78

Browse files
f0rm2l1nkuba-moo
authored andcommitted
macvlan: add forgotten nla_policy for IFLA_MACVLAN_BC_CUTOFF
The previous commit 954d1fa ("macvlan: Add netlink attribute for broadcast cutoff") added one additional attribute named IFLA_MACVLAN_BC_CUTOFF to allow broadcast cutfoff. However, it forgot to describe the nla_policy at macvlan_policy (drivers/net/macvlan.c). Hence, this suppose NLA_S32 (4 bytes) integer can be faked as empty (0 bytes) by a malicious user, which could leads to OOB in heap just like CVE-2023-3773. To fix it, this commit just completes the nla_policy description for IFLA_MACVLAN_BC_CUTOFF. This enforces the length check and avoids the potential OOB read. Fixes: 954d1fa ("macvlan: Add netlink attribute for broadcast cutoff") Signed-off-by: Lin Ma <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 284779d commit 55cef78

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/macvlan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,7 @@ static const struct nla_policy macvlan_policy[IFLA_MACVLAN_MAX + 1] = {
17461746
[IFLA_MACVLAN_MACADDR_COUNT] = { .type = NLA_U32 },
17471747
[IFLA_MACVLAN_BC_QUEUE_LEN] = { .type = NLA_U32 },
17481748
[IFLA_MACVLAN_BC_QUEUE_LEN_USED] = { .type = NLA_REJECT },
1749+
[IFLA_MACVLAN_BC_CUTOFF] = { .type = NLA_S32 },
17491750
};
17501751

17511752
int macvlan_link_register(struct rtnl_link_ops *ops)

0 commit comments

Comments
 (0)