[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1449601252.2824.101.camel@decadent.org.uk>
Date: Tue, 08 Dec 2015 19:00:52 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Shannon Nelson <shannon.nelson@...el.com>, kan.liang@...el.com
Cc: netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
bwh@...nel.org, Jesse Brandeburg <jesse.brandeburg@...el.com>,
andi@...stfloor.org, f.fainelli@...il.com,
alexander.duyck@...il.com,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
carolyn.wyborny@...el.com, donald.c.skidmore@...el.com,
mitch.a.williams@...el.com, ogerlitz@...lanox.com,
edumazet@...gle.com, jiri@...lanox.com, sfeldma@...il.com,
gospo@...ulusnetworks.com, sasha.levin@...cle.com,
dsahern@...il.com, tj@...nel.org, cascardo@...hat.com,
corbet@....net
Subject: Re: [RFC 1/2] net/ethtool: Add new coalescing parameter for queue
On Tue, 2015-12-08 at 10:02 -0800, Shannon Nelson wrote:
> On Mon, Dec 7, 2015 at 8:42 PM, <kan.liang@...el.com> wrote:
> > From: Kan Liang <kan.liang@...el.com>
> >
> > Intrdouce "queue" option for coalesce getting and setting.
[...]
> > --- a/net/core/ethtool.c
> > +++ b/net/core/ethtool.c
> > @@ -1123,10 +1123,16 @@ static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev,
> > void __user *useraddr)
> > {
> > struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE };
> > + struct ethtool_coalesce tmp = { .queue = -1 };
> >
> > if (!dev->ethtool_ops->get_coalesce)
> > return -EOPNOTSUPP;
> >
> > + if (copy_from_user(&tmp, useraddr, sizeof(coalesce)))
> > + return -EFAULT;
> > +
> > + coalesce.queue = tmp.queue;
> > +
>
> Is this going to do what you expect when you have an older ethtool
> program? It seems to me that the older ethtool program will have the
> original coalesce struct without the new queue field, so when you do
[...]
Indeed, it's not safe to extend UAPI structures like this.
Ben.
--
Ben Hutchings
Life would be so much easier if we could look at the source code.
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists