From: "Michael Chan" <mchan@broadcom.com>
To: "Matt Carlson" <mcarlson@broadcom.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC] Validate ethtool autoneg before relaying
Date: Wed, 26 Nov 2008 15:28:12 -0800 [thread overview]
Message-ID: <1227742092.13189.19.camel@HP1> (raw)
In-Reply-To: <20081126221741.GA8800@xw6200.broadcom.net>
On Wed, 2008-11-26 at 14:17 -0800, Matt Carlson wrote:
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 14ada53..6362f56 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -164,6 +164,9 @@ static int ethtool_set_settings(struct net_device *dev, void __user *useraddr)
> if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
> return -EFAULT;
>
> + if (cmd.autoneg != AUTONEG_ENABLE && cmd.autoneg != AUTONEG_DISABLE)
> + return -EFAULT;
> +
Matt, you should return -EINVAL here instead.
> return dev->ethtool_ops->set_settings(dev, &cmd);
> }
>
next prev parent reply other threads:[~2008-11-26 23:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-26 22:17 [RFC] Validate ethtool autoneg before relaying Matt Carlson
2008-11-26 23:28 ` Michael Chan [this message]
2008-11-26 23:44 ` Matt Carlson
2008-11-27 8:07 ` David Miller
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=1227742092.13189.19.camel@HP1 \
--to=mchan@broadcom.com \
--cc=mcarlson@broadcom.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.