netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Max Georgiev <glipus@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	kory.maincent@bootlin.com, netdev@vger.kernel.org,
	maxime.chevallier@bootlin.com, vadim.fedorenko@linux.dev,
	gerhard@engleder-embedded.com
Subject: Re: [RFC PATCH v3 3/5] Add ndo_hwtstamp_get/set support to vlan code path
Date: Sat, 8 Apr 2023 15:56:38 +0200	[thread overview]
Message-ID: <ZDFylh_DM8XpmZM8@localhost> (raw)
In-Reply-To: <CAP5jrPGzrzMYmBBT+B6U5Oh6v_Tcie1rj0KqsWOEZOBR7JBoXA@mail.gmail.com>

On Thu, Apr 06, 2023 at 12:21:37AM -0600, Max Georgiev wrote:

> It looks like there is a possibility that the returned hwtstamp_config structure
> will be copied twice to ifr and copied once from ifr on the return path
> in case if the underlying driver does not implement ndo_hwtstamp_get():
> - the underlying driver calls copy_to_user() inside its ndo_eth_ioctl()
>   implementation to return the data to generic_hwtstamp_get_lower();
> - then generic_hwtstamp_get_lower() calls copy_from_user() to copy it
>   back out of the ifr to kernel_hwtstamp_config structure;
> - then dev_get_hwtstamp() calls copy_to_user() again to update
>   the same ifr with the same data the ifr already contains.
> 
> Should we consider this acceptable?

This is a slow path so copying a small structure is not a concern.

Thanks,
Richard

      parent reply	other threads:[~2023-04-08 14:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05  6:33 [RFC PATCH v3 3/5] Add ndo_hwtstamp_get/set support to vlan code path Maxim Georgiev
2023-04-05 12:26 ` Vladimir Oltean
2023-04-05 16:19   ` Max Georgiev
2023-04-05 16:28     ` Vladimir Oltean
2023-04-05 16:42 ` Jakub Kicinski
2023-04-05 17:03   ` Vladimir Oltean
2023-04-05 17:13     ` Jakub Kicinski
2023-04-05 17:28       ` Vladimir Oltean
2023-04-05 17:34         ` Vladimir Oltean
2023-04-05 17:42         ` Jakub Kicinski
2023-04-05 18:01           ` Vladimir Oltean
2023-04-06  0:00             ` Jakub Kicinski
2023-04-06  6:21               ` Max Georgiev
2023-04-06 15:01                 ` Vladimir Oltean
2023-04-06 16:18                   ` Max Georgiev
2023-04-06 16:50                     ` Vladimir Oltean
2023-04-08 13:56                 ` Richard Cochran [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=ZDFylh_DM8XpmZM8@localhost \
    --to=richardcochran@gmail.com \
    --cc=gerhard@engleder-embedded.com \
    --cc=glipus@gmail.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.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;
as well as URLs for NNTP newsgroup(s).