lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 7 Aug 2008 16:07:55 -0700
From:	"Adam Langley" <agl@...erialviolet.org>
To:	netdev@...r.kernel.org
Subject: Code query: tcp_request_sock deallocation

I'm hoping someone can explain part of the lifetime of a request_sock for me.

In tcp_minisocks.c:tcp_check_req (near the bottom) we have the code
path for upgrading a request_sock to a full sock in the case that we
get a valid ack:

child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb,
								 req, NULL);
if (child == NULL)
	goto listen_overflow;

// MD5 stuff omitted

inet_csk_reqsk_queue_unlink(sk, req, prev);
inet_csk_reqsk_queue_removed(sk, req);

inet_csk_reqsk_queue_add(sk, req, child);

Those last three lines appear to remove the request_sock from the
queue (fine), can then re-enqueue it at the end of the queue with ->sk
pointing to the new ESTABLISHED socket. At this point I loose track,
because I don't see where the request_sock is free'ed, except maybe
from inet_csk_reqsk_queue_prune.

Other code paths in that function (like goto embryonic_reset) end up
removing it from the queue and freeing it immediately (with
inet_csk_reqsk_queue_drop).

I wondered if it was enqueued in order to be reused, but new
request_socks seem to be alloced rather than taken from that queue.


Thanks

AGL

-- 
Adam Langley agl@...erialviolet.org http://www.imperialviolet.org
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ