Skip to content

sshuttle does not work in kernel 4.9.84 or kernel 4.14.22 #208

@lbratch

Description

@lbratch

Hello

sshuttle does not work in at least kernel 4.9.84 or kernel 4.14.22 (and I suspect the other latest stable kernels). It was broken by the following patch:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.9.y&id=4ec264d8128958e66d048f45fd1c4c28cfedb119

commit 4ec264d8128958e66d048f45fd1c4c28cfedb119
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Tue Jan 30 19:01:40 2018 +0100

    netfilter: on sockopt() acquire sock lock only in the required scope
    
    commit 3f34cfae1238848fd53f25e5c8fd59da57901f4b upstream.

sshuttle appears to connect, but does not forward any traffic. In addition, it does not close cleanly (not even with a kill -9):

# sshuttle -v -r remote-host 10.0.0.0/8
Starting sshuttle proxy.
firewall manager: Starting firewall with Python version 3.5.4
firewall manager: ready method name nat.
IPv6 enabled: False
UDP enabled: False
DNS enabled: False
TCP redirector listening on ('127.0.0.1', 12300).
Starting client with Python version 3.5.4
c : connecting to server...
Password:
Starting server with Python version 3.5.4
 s: latency control setting = True
c : Connected.
 s: available routes:
 s:   2/10.0.0.0/8
firewall manager: setting up.
>> iptables -t nat -N sshuttle-12300
>> iptables -t nat -F sshuttle-12300
>> iptables -t nat -I OUTPUT 1 -j sshuttle-12300
>> iptables -t nat -I PREROUTING 1 -j sshuttle-12300
>> iptables -t nat -A sshuttle-12300 -j RETURN --dest 127.0.0.1/32 -p tcp
>> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest 10.0.0.0/8 -p tcp --to-ports 12300 -m ttl ! --ttl 42
^CKilled by signal 2.
^C^C^C
^C

Reverting the kernel patch fixes the issue.

I realise this may be a kernel bug (not sure if this counts as breaking userspace...) and if so I'm happy to file a bug there instead.

Thanks
Luke

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions