lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 28 Oct 2019 08:11:07 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     netdev@...r.kernel.org
Subject: Fw: [Bug 205339] New: epoll can fail to report a socket readable
 after enabling SO_OOBINLINE



Begin forwarded message:

Date: Mon, 28 Oct 2019 02:55:44 +0000
From: bugzilla-daemon@...zilla.kernel.org
To: stephen@...workplumber.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@...workplumber.org
          Reporter: njs@...ox.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

-- 
You are receiving this mail because:
You are the assignee for the bug.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ