Skip to content

Commit

Permalink
bonding: correctly handle out of range parameters for lp_interval
Browse files Browse the repository at this point in the history
We didn't correctly check cases where the value for lp_interval is not
within the legal range due to a missing table terminator.

This would let userspace trigger a kernel panic by specifying a value out
of range:

	echo -1 > /sys/devices/virtual/net/bond0/bonding/lp_interval

Introduced by commit 4325b37 ("bonding: convert lp_interval to use
the new option API").

Acked-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
sashalevin authored and davem330 committed Mar 6, 2014
1 parent d2d273f commit 5bd4e4c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/bonding/bond_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ static struct bond_opt_value bond_resend_igmp_tbl[] = {
static struct bond_opt_value bond_lp_interval_tbl[] = {
{ "minval", 1, BOND_VALFLAG_MIN | BOND_VALFLAG_DEFAULT},
{ "maxval", INT_MAX, BOND_VALFLAG_MAX},
{ NULL, -1, 0},
};

static struct bond_option bond_opts[] = {
Expand Down

0 comments on commit 5bd4e4c

Please sign in to comment.