Created attachment 3148 [details] ssh -vvv -w0:0 remotehost for 7.6p1 and 7.7p1 I have tun0 set up on the local and remote host. Here is what happens with 7.7p1: calimero@localhost ~ $ ssh -w0:0 remotehost Tunnel device open failed. Could not request tunnel forwarding. calimero@remotehost ~ $ For the verbose (-vvv) output, which didn't seem extremely helpful, see attachment. Here are strace excerpts: For 7.6p1: openat(AT_FDCWD, "/dev/net/tun", O_RDWR) = 4 ioctl(4, TUNSETIFF, 0x7fffaeea8490) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 fcntl(4, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE) fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0 fcntl(4, F_GETFL) = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE) getpid() = 4905 dup(0) = 5 dup(1) = 6 dup(2) = 7 For 7.7p1: openat(AT_FDCWD, "/dev/net/tun", O_RDWR) = 4 ioctl(4, TUNSETIFF, 0x7ffcb8813710) = 0 close(4) = 0 write(2, "Tunnel device open failed.\r\n", 28Tunnel device open failed. ) = 28 write(2, "Could not request tunnel forward"..., 38Could not request tunnel forwarding. ) = 38 dup(0) = 4 dup(1) = 5 dup(2) = 6 Reproducible at will on this box running arch linux with kernel 4.16.6 (same bug also experienced on 4.16.4). Upgrading or downgrading openssh takes seconds.
The problem disappears if I erase this block of code that was added. In function sys_tun_open() for SSH_TUN_LINUX: Location : (absent) openssh-7.6p1/openbsd-compat/port-tun.c:101 (present) openssh-7.7p1/openbsd-compat/port-net.c:188 if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) goto failed; For some reason I have "Could not request tunnel forwarding." in the console but that's spurious, everything works perfectly. I replaced the above with : printf("one, *ifname=%s, ifname=%p\n", *ifname, ifname); if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) { printf("two, *ifname=%s, ifname=%p\n", *ifname, ifname); goto failed; } I get this in the output of ssh: one, *ifname=(null), ifname=0x7ffec28c5dc0 two, *ifname=tun0, ifname=0x7ffec28c5dc0 I'm not sure what should be happening, but this cripples tunnel for me.
Already fixed in both master and the 7_7 branch: https://github.com/openssh/openssh-portable/commit/b81b2d120e9c8a83489e241620843687758925ad *** This bug has been marked as a duplicate of bug 2855 ***
Close RESOLVED bugs with the release of openssh-8.0