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>] [day] [month] [year] [list]
Message-ID: <20150410131059.304d579c@urahara>
Date:	Fri, 10 Apr 2015 13:10:59 -0700
From:	Stephen Hemminger <stephen@...workplumber.org>
To:	netdev@...r.kernel.org
Subject: Fw: [Bug 96381] New: TUN/TAP user API regression in 3.19,
 non-bloking read returns 0 when no data is available rather than EAGAIN



Begin forwarded message:

Date: Thu, 9 Apr 2015 09:25:41 +0000
From: "bugzilla-daemon@...zilla.kernel.org" <bugzilla-daemon@...zilla.kernel.org>
To: "shemminger@...ux-foundation.org" <shemminger@...ux-foundation.org>
Subject: [Bug 96381] New: TUN/TAP user API regression in 3.19, non-bloking read returns 0 when no data is available rather than EAGAIN


https://bugzilla.kernel.org/show_bug.cgi?id=96381

            Bug ID: 96381
           Summary: TUN/TAP user API regression in 3.19, non-bloking read
                    returns 0 when no data is available rather than EAGAIN
           Product: Networking
           Version: 2.5
    Kernel Version: 3.19.3
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: Other
          Assignee: shemminger@...ux-foundation.org
          Reporter: ambrop7@...il.com
        Regression: No

With kernel 3.19, a read() from a TUN/TAP file descriptor in non-blocking mode
will return 0 when no data is available, rather than fail with EAGAIN. This
breaks certain applications which will interpret the 0 return value as a
zero-length packet and happily go on reading more packets.

Here's relevant parts of my application showing the change of behavior and how
the application locks up with kernel 3.19.

-- strace with 3.18 --
open("/dev/net/tun", O_RDWR)            = 5
ioctl(5, TUNSETIFF, 0x7ffe24f1e620)     = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 6
ioctl(6, SIOCGIFMTU, {ifr_name="tun4", ifr_mtu=1500}) = 0
close(6)                                = 0
fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
epoll_ctl(3, EPOLL_CTL_ADD, 5, {0, {u32=6509592, u64=6509592}}) = 0
read(5, 0xac8010, 1500)                 = -1 EAGAIN (Resource temporarily
unavailable)
epoll_ctl(3, EPOLL_CTL_MOD, 5, {EPOLLIN, {u32=6509592, u64=6509592}}) = 0

-- strace with 3.19 --
open("/dev/net/tun", O_RDWR)            = 5
ioctl(5, TUNSETIFF, 0x7ffea2f4d970)     = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 6
ioctl(6, SIOCGIFMTU, {ifr_name="tun4", ifr_mtu=1500}) = 0
close(6)                                = 0
fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
epoll_ctl(3, EPOLL_CTL_ADD, 5, {0, {u32=6509592, u64=6509592}}) = 0
read(5, "", 1500)                       = 0
read(5, "", 1500)                       = 0
read(5, "", 1500)                       = 0
read(5, "", 1500)                       = 0
read(5, "", 1500)                       = 0
...

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ