[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1392321789.15615.49.camel@deadeye.wl.decadent.org.uk>
Date: Thu, 13 Feb 2014 20:03:09 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Aaron Brown <aaron.f.brown@...el.com>
Cc: davem@...emloft.net, Jacob Keller <jacob.e.keller@...el.com>,
netdev@...r.kernel.org, gospo@...hat.com, sassmann@...hat.com
Subject: Re: [net-next 2/5] ixgbe: implement SIOCGHWTSTAMP ioctl
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.
--
Ben Hutchings
The world is coming to an end. Please log off.
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists