netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@redhat.com>
To: Sasha Levin <sasha.levin@oracle.com>,
	fubar@us.ibm.com, vfalico@redhat.com, andy@greyhouse.net
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bonding: correctly handle out of range parameters for lp_interval
Date: Thu, 06 Mar 2014 20:15:45 +0100	[thread overview]
Message-ID: <5318C961.4000606@redhat.com> (raw)
In-Reply-To: <1394129030-9947-1-git-send-email-sasha.levin@oracle.com>

On 03/06/2014 07:03 PM, Sasha Levin wrote:
> 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 "bonding: add infrastructure for an option API".
> 
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
>  drivers/net/bonding/bond_options.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> 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[] = {
> 
Thanks!

One note though, the commit that introduces the problem is not that one.
It's 4325b374f84e59226851636df946f2500d0bfeba ("bonding: convert
lp_interval to use the new option API"), after that's corrected you
can add my:

Acked-by: Nikolay Aleksandrov <nikolay@redhat.com>

      reply	other threads:[~2014-03-06 19:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 18:03 [PATCH] bonding: correctly handle out of range parameters for lp_interval Sasha Levin
2014-03-06 19:15 ` Nikolay Aleksandrov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5318C961.4000606@redhat.com \
    --to=nikolay@redhat.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    --cc=vfalico@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).