From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
netdev@vger.kernel.org, njs@pobox.com
Subject: Re: Fw: [Bug 205339] New: epoll can fail to report a socket readable after enabling SO_OOBINLINE
Date: Mon, 28 Oct 2019 14:22:13 -0700 [thread overview]
Message-ID: <a863e2a4-8d31-c8d8-2f85-7fe3fa30104f@gmail.com> (raw)
In-Reply-To: <20191028081107.38b73eb1@hermes.lan>
Please Stephen CC the reporter when you forward a bugzilla bug to the list
On 10/28/19 8:11 AM, Stephen Hemminger wrote:
>
>
> Begin forwarded message:
>
> Date: Mon, 28 Oct 2019 02:55:44 +0000
> From: bugzilla-daemon@bugzilla.kernel.org
> To: stephen@networkplumber.org
> Subject: [Bug 205339] New: epoll can fail to report a socket readable after enabling SO_OOBINLINE
>
>
> https://bugzilla.kernel.org/show_bug.cgi?id=205339
>
> Bug ID: 205339
> Summary: epoll can fail to report a socket readable after
> enabling SO_OOBINLINE
> Product: Networking
> Version: 2.5
> Kernel Version: 5.0
> Hardware: All
> OS: Linux
> Tree: Mainline
> Status: NEW
> Severity: low
> Priority: P1
> Component: Other
> Assignee: stephen@networkplumber.org
> Reporter: njs@pobox.com
> Regression: No
> Created attachment 285671
> --> https://bugzilla.kernel.org/attachment.cgi?id=285671&action=edit
> reproducer
>
> Consider the following sequence of events:
>
> 1. OOB data arrives on a socket.
> 2. The socket is registered with epoll with EPOLLIN
> 3. The socket has SO_OOBINLINE toggled from False → True
>
> In this case, the socket is now readable, and select() reports that it's
> readable, but epoll does *not* report that it's readable.
>
> This is a pretty minor issue, but it seems like an unambiguous bug so I figured
> I'd report it.
>
> Weirdly, this doesn't appear to be a general problem with SO_OOBINLINE+epoll.
> For example, this very similar sequence works correctly:
>
> 1. The socket is registered with epoll with EPOLLIN
> 2. OOB data arrives on the socket.
> 3. The socket has SO_OOBINLINE toggled from False → True
>
> After step 2, epoll reports the socket as not readable, and then after step 3
> it reports it as readable, as you'd expect.
>
> In the attached reproducer script, "scenario 4" is the buggy one, and "scenario
> 3" is the very similar non-buggy one. Output on Ubuntu 19.04, kernel
> 5.0.0-32-generic, x86-64:
>
> -- Scenario 1: no data --
> select() says: sock is NOT readable
> epoll says: sock is NOT readable
> reality: NOT readable
>
> -- Scenario 2: OOB data arrives --
> select() says: sock is NOT readable
> epoll says: sock is NOT readable
> reality: NOT readable
>
> -- Scenario 3: register -> OOB data arrives -> toggle SO_OOBINLINE=True --
> select() says: sock is readable
> epoll says: sock is readable
> reality: read succeeded
>
> -- Scenario 4: OOB data arrives -> register -> toggle SO_OOBINLINE=True --
> select() says: sock is readable
> epoll says: sock is NOT readable
> reality: read succeeded
>
I really wonder how much energy we should put in maintaining this archaic thing.
We do not have a single packetdrill test at Google using URG stuff.
next prev parent reply other threads:[~2019-10-28 21:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 15:11 Fw: [Bug 205339] New: epoll can fail to report a socket readable after enabling SO_OOBINLINE Stephen Hemminger
2019-10-28 21:22 ` Eric Dumazet [this message]
2019-10-29 1:59 ` Nathaniel Smith
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=a863e2a4-8d31-c8d8-2f85-7fe3fa30104f@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=njs@pobox.com \
--cc=stephen@networkplumber.org \
/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).