netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Arjun Roy <arjunroy.kdev@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>, Arjun Roy <arjunroy@google.com>,
	Soheil Hassas Yeganeh <soheil@google.com>,
	Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net-next] tcp-zerocopy: Update returned getsockopt() optlen.
Date: Mon, 24 Feb 2020 22:28:22 -0800	[thread overview]
Message-ID: <CANn89iLrOwvNSHOB2i_+gMmN29O6BpJrnd9RfNERDTayNf7qKA@mail.gmail.com> (raw)
In-Reply-To: <20200225060620.76486-1-arjunroy.kdev@gmail.com>

On Mon, Feb 24, 2020 at 10:06 PM Arjun Roy <arjunroy.kdev@gmail.com> wrote:
>
> From: Arjun Roy <arjunroy@google.com>
>
> TCP receive zerocopy currently does not update the returned optlen for
> getsockopt(). Thus, userspace cannot properly determine if all the
> fields are set in the passed-in struct. This patch sets the optlen
> before return, in keeping with the expected operation of getsockopt().
>
> Signed-off-by: Arjun Roy <arjunroy@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> Fixes: c8856c051454 ("tcp-zerocopy: Return inq along with tcp receive
> zerocopy")


OK, please note for next time :

Fixes: tag should not wrap : It should be a single line.
Preferably it should be the first tag (before your Sob)

Add v2 as in [PATCH v2 net-next]  :  so that reviewers can easily see
which version is the more recent one.


>
> +               if (!err) {
> +                       if (put_user(len, optlen))
> +                               return -EFAULT;

Sorry for not asking this before during our internal review :

Is the cost of the extra STAC / CLAC (on x86) being high enough that it is worth
trying to call put_user() only if user provided a different length ?

  reply	other threads:[~2020-02-25  6:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25  6:06 [PATCH net-next] tcp-zerocopy: Update returned getsockopt() optlen Arjun Roy
2020-02-25  6:28 ` Eric Dumazet [this message]
2020-02-25 16:48   ` Arjun Roy
2020-02-25 17:04     ` Arjun Roy
2020-02-25 17:16       ` Soheil Hassas Yeganeh
2020-02-25 20:20         ` Arjun Roy
  -- strict thread matches above, loose matches on Subject: below --
2020-02-25  5:58 Arjun Roy
2020-02-25  6:01 ` Eric Dumazet

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=CANn89iLrOwvNSHOB2i_+gMmN29O6BpJrnd9RfNERDTayNf7qKA@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=arjunroy.kdev@gmail.com \
    --cc=arjunroy@google.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=soheil@google.com \
    --cc=willemb@google.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).