From: Ben Hutchings <ben@decadent.org.uk>
To: Aaron Brown <aaron.f.brown@intel.com>
Cc: davem@davemloft.net, Jacob Keller <jacob.e.keller@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com
Subject: Re: [net-next 2/5] ixgbe: implement SIOCGHWTSTAMP ioctl
Date: Thu, 13 Feb 2014 20:03:09 +0000 [thread overview]
Message-ID: <1392321789.15615.49.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1392278450-27062-3-git-send-email-aaron.f.brown@intel.com>
[-- Attachment #1: Type: text/plain, Size: 792 bytes --]
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.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next prev parent reply other threads:[~2014-02-13 20:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 8:00 [net-next 0/5] Intel Wired LAN Driver Updates Aaron Brown
2014-02-13 8:00 ` [net-next 1/5] ixgbe: modify behavior on receiving a HW ECC error Aaron Brown
2014-02-13 8:00 ` [net-next 2/5] ixgbe: implement SIOCGHWTSTAMP ioctl Aaron Brown
2014-02-13 20:03 ` Ben Hutchings [this message]
2014-02-13 21:46 ` Keller, Jacob E
2014-02-13 8:00 ` [net-next 3/5] ixgbe: don't use magic size number to assign ptp_caps.name Aaron Brown
2014-02-13 8:00 ` [net-next 4/5] ixgbe: Add WoL support for a new device Aaron Brown
2014-02-13 8:00 ` [net-next 5/5] ixgbe: fixup warning regarding max_vfs parameter Aaron Brown
2014-02-13 20:01 ` Ben Hutchings
2014-02-13 20:20 ` David Miller
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=1392321789.15615.49.camel@deadeye.wl.decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=aaron.f.brown@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=jacob.e.keller@intel.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.com \
/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