From: David Miller <davem@davemloft.net>
To: mcarlson@broadcom.com
Cc: mchan@broadcom.com, netdev@vger.kernel.org
Subject: Re: [RFC] Validate ethtool autoneg before relaying
Date: Thu, 27 Nov 2008 00:07:48 -0800 (PST) [thread overview]
Message-ID: <20081127.000748.248098977.davem@davemloft.net> (raw)
In-Reply-To: <20081126234406.GA8970@xw6200.broadcom.net>
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Wed, 26 Nov 2008 15:44:06 -0800
> On Wed, Nov 26, 2008 at 03:28:12PM -0800, Michael Chan wrote:
> >
> > 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.
>
> Yes. You are right. I'll fix this in a revised patch if everyone
> decides this is an effort worth pursuing.
I think this is a great idea, checking the validity in one spot.
So please, submit a final version of these changes when you get
a chance.
prev parent reply other threads:[~2008-11-27 8:07 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
2008-11-26 23:44 ` Matt Carlson
2008-11-27 8:07 ` David Miller [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=20081127.000748.248098977.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=mcarlson@broadcom.com \
--cc=mchan@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 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).