All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xin Long <lucien.xin@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	network dev <netdev@vger.kernel.org>, davem <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net] udp: fix the len check in udp_lib_getsockopt
Date: Sun, 30 May 2021 22:02:39 -0400	[thread overview]
Message-ID: <CADvbK_fQQzH9uuHj_8mSQ=OSGETpwO4qdaZeBc-uE24AyphAWg@mail.gmail.com> (raw)
In-Reply-To: <cf628b45-c527-3390-4738-de7732268e44@gmail.com>

On Sun, May 30, 2021 at 9:31 PM David Ahern <dsahern@gmail.com> wrote:
>
> On 5/29/21 10:47 AM, Xin Long wrote:
> > On Fri, May 28, 2021 at 9:57 PM David Ahern <dsahern@gmail.com> wrote:
> >>
> >> On 5/28/21 7:47 PM, Xin Long wrote:
> >>> The partial byte(or even 0) of the value returned due to passing a wrong
> >>> optlen should be considered as an error. "On error, -1 is returned, and
> >>> errno is set appropriately.". Success returned in that case only confuses
> >>> the user.
> >>
> >> It is feasible that some app could use bool or u8 for options that have
> >> 0 or 1 values and that code has so far worked. This change would break that.
> > Got it.
> > Not sure if it's possible or necessary to also return -EINVAL if optlen == 0
> >
>
> do_tcp_getsockopt for example does not fail on optlen 0; no reason to
> make this one fail.
I was about to say do_tcp_getsockopt has the same issue. :-)

  reply	other threads:[~2021-05-31  2:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 19:12 [PATCH net] udp: fix the len check in udp_lib_getsockopt Xin Long
2021-05-27 19:13 ` Xin Long
2021-05-28 22:39   ` Jakub Kicinski
2021-05-29  1:47     ` Xin Long
2021-05-29  1:57       ` David Ahern
2021-05-29 16:47         ` Xin Long
2021-05-31  1:31           ` David Ahern
2021-05-31  2:02             ` Xin Long [this message]
2021-05-31 10:13         ` David Laight

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='CADvbK_fQQzH9uuHj_8mSQ=OSGETpwO4qdaZeBc-uE24AyphAWg@mail.gmail.com' \
    --to=lucien.xin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.