]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: xt_socket: fix transparent match for IPv6 request sockets
authorKOVACS Krisztian <hidden@balabit.com>
Fri, 23 Sep 2016 09:27:42 +0000 (11:27 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 25 Sep 2016 21:16:11 +0000 (23:16 +0200)
commit3c3e42cd2850cb43c25ea5733c6db32f6395d033
treeb6cfa1d00df267b3ffadbfd7d513a5695c619ce4
parent77724c6dc047bf4361ca331468931564b2a6a557
netfilter: xt_socket: fix transparent match for IPv6 request sockets

The introduction of TCP_NEW_SYN_RECV state, and the addition of request
sockets to the ehash table seems to have broken the --transparent option
of the socket match for IPv6 (around commit 4cd592d9).

Now that the socket lookup finds the TCP_NEW_SYN_RECV socket instead of the
listener, the --transparent option tries to match on the no_srccheck flag
of the request socket.

Unfortunately, that flag was only set for IPv4 sockets in tcp_v4_init_req()
by copying the transparent flag of the listener socket. This effectively
causes '-m socket --transparent' not match on the ACK packet sent by the
client in a TCP handshake.

Based on the suggestion from Eric Dumazet, this change moves the code
initializing no_srccheck to tcp_conn_request(), rendering the above
scenario working again.

Fixes: 4cd592d94d ("netfilter: xt_socket: prepare for TCP_NEW_SYN_RECV support")
Signed-off-by: Alex Badics <alex.badics@balabit.com>
Signed-off-by: KOVACS Krisztian <hidden@balabit.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c