From: Frank van Maarseveen <frankvm@xs4all.nl>
To: linux-kernel@vger.kernel.org
Subject: TCP listen()/accept() bug for unbound sockets?
Date: Fri, 27 Aug 2004 11:56:40 +0200 [thread overview]
Message-ID: <20040827095640.GA27286@janus> (raw)
2.4.27,
while investigating the xv_bmpslap XV exploit posted to bugtraq I got this
strace which revealed that it seems possible to listen() and accept()
on unbound TCP sockets. The bind() failed and the process appeared to
be listening on a random port in the ip_local_port_range and connected
successfully:
24876 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
24876 bind(4, {sa_family=AF_INET, sin_port=htons(7000), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
24876 listen(4, 1) = 0
24876 accept(4, 0, NULL) = 5
24876 dup2(5, 0) = 0
24876 dup2(5, 1) = 1
24876 dup2(5, 2) = 2
24876 execve("/bin//sh", ["/bin//sh"], [/* 0 vars */]) = 0
is this defined behavior?
--
Frank
next reply other threads:[~2004-08-27 9:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-27 9:56 Frank van Maarseveen [this message]
2004-08-27 19:55 ` TCP listen()/accept() bug for unbound sockets? David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040827095640.GA27286@janus \
--to=frankvm@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.