Skip to content

Commit

Permalink
bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes
Browse files Browse the repository at this point in the history
Fixes: 7f28fa1 ("bonding: add arp_ip_target netlink support")
Reported-by: John Fastabend <[email protected]>
Cc: Scott Feldman <[email protected]>
Signed-off-by: Thomas Graf <[email protected]>
Acked-by: John Fastabend <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
tgraf authored and davem330 committed Nov 30, 2014
1 parent 7a5a4f9 commit f6c6fda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/bonding/bond_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ static int bond_changelink(struct net_device *bond_dev,

bond_option_arp_ip_targets_clear(bond);
nla_for_each_nested(attr, data[IFLA_BOND_ARP_IP_TARGET], rem) {
__be32 target = nla_get_be32(attr);
__be32 target;

if (nla_len(attr) < sizeof(target))
return -EINVAL;

target = nla_get_be32(attr);

bond_opt_initval(&newval, (__force u64)target);
err = __bond_opt_set(bond, BOND_OPT_ARP_TARGETS,
Expand Down

0 comments on commit f6c6fda

Please sign in to comment.