]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
[PATCH] TCP: Do not autobind ports for TCP sockets
authorDavid Miller <davem@davemloft.net>
Wed, 22 Aug 2007 04:14:45 +0000 (21:14 -0700)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Oct 2007 19:30:26 +0000 (21:30 +0200)
commit0c1115931a789ae78e300e7df86ef3787cfa6d55
treec18de3ef0e768934f8697f59a2dd954822e4b292
parent09e4df64162130fd6b062350beae93988e48004b
[PATCH] TCP: Do not autobind ports for TCP sockets

[TCP]: Invoke tcp_sendmsg() directly, do not use inet_sendmsg().

As discovered by Evegniy Polyakov, if we try to sendmsg after
a connection reset, we can do incredibly stupid things.

The core issue is that inet_sendmsg() tries to autobind the
socket, but we should never do that for TCP.  Instead we should
just go straight into TCP's sendmsg() code which will do all
of the necessary state and pending socket error checks.

TCP's sendpage already directly vectors to tcp_sendpage(), so this
merely brings sendmsg() in line with that.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/net/tcp.h
net/ipv4/af_inet.c
net/ipv4/tcp.c
net/ipv4/tcp_ipv4.c
net/ipv6/af_inet6.c
net/ipv6/tcp_ipv6.c