[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1227742092.13189.19.camel@HP1>
Date: Wed, 26 Nov 2008 15:28:12 -0800
From: "Michael Chan" <mchan@...adcom.com>
To: "Matt Carlson" <mcarlson@...adcom.com>
cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [RFC] Validate ethtool autoneg before relaying
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);
> }
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists