[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1392327982.30559.1.camel@jekeller-desk1.amr.corp.intel.com>
Date: Thu, 13 Feb 2014 21:46:22 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: Ben Hutchings <ben@...adent.org.uk>
CC: "Brown, Aaron F" <aaron.f.brown@...el.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"gospo@...hat.com" <gospo@...hat.com>,
"sassmann@...hat.com" <sassmann@...hat.com>
Subject: Re: [net-next 2/5] ixgbe: implement SIOCGHWTSTAMP ioctl
On Thu, 2014-02-13 at 20:03 +0000, Ben Hutchings wrote:
> On Thu, 2014-02-13 at 00:00 -0800, Aaron Brown wrote:
> [...]
> > +int ixgbe_ptp_set_ts_config(struct ixgbe_adapter *adapter, struct ifreq *ifr)
> > {
> > struct ixgbe_hw *hw = &adapter->hw;
> > - struct hwtstamp_config config;
> > + struct hwtstamp_config *config = &adapter->tstamp_config;
> > u32 tsync_tx_ctl = IXGBE_TSYNCTXCTL_ENABLED;
> > u32 tsync_rx_ctl = IXGBE_TSYNCRXCTL_ENABLED;
> > u32 tsync_rx_mtrl = PTP_EV_PORT << 16;
> > bool is_l2 = false;
> > u32 regval;
> >
> > - if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
> > + if (copy_from_user(config, ifr->ifr_data, sizeof(*config)))
> > return -EFAULT;
> [...]
>
> This is wrong. You overwrite the current config before validating it.
>
> Ben.
>
Oops. Thanks for the catch. I'll respin this.
Regards,
Jake
Powered by blists - more mailing lists