From: Sasha Levin Date: Thu, 6 Mar 2014 21:53:11 +0000 (-0500) Subject: bonding: correctly handle out of range parameters for lp_interval X-Git-Tag: v3.14-rc7~10^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bd4e4c158ceb4e76ce9ed005c876d59caad8af2;p=profile%2Fivi%2Fkernel-x86-ivi.git bonding: correctly handle out of range parameters for lp_interval 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 4325b374f84 ("bonding: convert lp_interval to use the new option API"). Acked-by: Nikolay Aleksandrov Signed-off-by: Sasha Levin Signed-off-by: David S. Miller --- diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index c378784..298c265 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c @@ -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[] = {