diff mbox

[v2] bonding: correctly handle out of range parameters for lp_interval

Message ID 1394142791-11142-1-git-send-email-sasha.levin@oracle.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Sasha Levin March 6, 2014, 9:53 p.m. UTC
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 <nikolay@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/bonding/bond_options.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

David Miller March 6, 2014, 10:06 p.m. UTC | #1
From: Sasha Levin <sasha.levin@oracle.com>
Date: Thu,  6 Mar 2014 16:53:11 -0500

> 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 <nikolay@redhat.com>
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 23f3655..4d35cdc 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -124,6 +124,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[] = {