<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test/sys/net/raw_cb.c, branch stable/7</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test/atom?h=stable%2F7</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test/atom?h=stable%2F7'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/'/>
<updated>2008-08-31T16:14:41Z</updated>
<entry>
<title>Merge r180391 from head to stable/7:</title>
<updated>2008-08-31T16:14:41Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2008-08-31T16:14:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=4c164f8a9a52cfeda49f33256c0fac3ac1a9cf02'/>
<id>urn:sha1:4c164f8a9a52cfeda49f33256c0fac3ac1a9cf02</id>
<content type='text'>
  Rather than checking for a NULL so_pcb in raw_attach(), assert that
  it's non-NULL, as all callers can and should already do the required
  checking.  Update comments a bit more to talk about rawcb allocation
  for consumers.

  Reviewed by:    bz
</content>
</entry>
<entry>
<title>Merge r180390 from head to stable/7:</title>
<updated>2008-08-31T16:02:54Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2008-08-31T16:02:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=2eb8aaabf9b2d97d63d0acf519bdbe0d3b58d5bc'/>
<id>urn:sha1:2eb8aaabf9b2d97d63d0acf519bdbe0d3b58d5bc</id>
<content type='text'>
  Add sysctl subtree net.raw for generic raw socket infrastructure;
  expose default send and receive socket buffer sizes using sysctls
  so that they can be administered centrally.

  Reviewed by:    bz
</content>
</entry>
<entry>
<title>Merge r180385 from head to stable/7:</title>
<updated>2008-08-31T15:55:59Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2008-08-31T15:55:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=6f53ede329ca1af899846bb15dc7e83f8062c70a'/>
<id>urn:sha1:6f53ede329ca1af899846bb15dc7e83f8062c70a</id>
<content type='text'>
  Remove unused support for local and foreign addresses in generic raw
  socket support.  These utility routines are used only for routing and
  pfkey sockets, neither of which have a notion of address, so were
  required to mock up fake socket addresses to avoid connection
  requirements for applications that did not specify their own fake
  addresses (most of them).

  Quite a bit of the removed code is #ifdef notdef, since raw sockets
  don't support bind() or connect() in practice.  Removing this
  simplifies the raw socket implementation, and removes two (commented
  out) uses of dtom(9).

  Fake addresses passed to sendto(2) by applications are ignored for
  compatibility reasons, but this is now done in a more consistent way
  (and with a comment).  Possibly, EINVAL could be returned here in
  the future if it is determined that no applications depend on the
  semantic inconsistency of specifying a destination address for a
  protocol without address support, but this will require some amount
  of careful surveying.

  NB: This does not affect netinet, netinet6, or other wire protocol
  raw sockets, which provide their own independent infrastructure with
  control block address support specific to the protocol.

  Reviewed by:    bz
</content>
</entry>
<entry>
<title>Merge r180305 from head to stable/7:</title>
<updated>2008-08-31T15:39:06Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2008-08-31T15:39:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=f687a9aae7e31e38b2763ad335d2c3f188cf8b8f'/>
<id>urn:sha1:f687a9aae7e31e38b2763ad335d2c3f188cf8b8f</id>
<content type='text'>
  Improve approximation of style(9) in raw socket code.
</content>
</entry>
<entry>
<title>raw_disconnect() now disconnects but does not detach the raw pcb.  As a</title>
<updated>2006-06-02T08:27:15Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2006-06-02T08:27:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=4421f50dbcd2f36b743aa399d2b97522e01adfa2'/>
<id>urn:sha1:4421f50dbcd2f36b743aa399d2b97522e01adfa2</id>
<content type='text'>
result, raw_uabort() now needs to call raw_detach() directly.  As
raw_uabort() is never called, and raw_disconnect() is probably not ever
actually called in practice, this is likely not a functional change, but
improves congruence between protocols, and avoids a NULL raw cb pointer
after disconnect, which could result in a panic.

MFC after:	1 month
</content>
</entry>
<entry>
<title>Chance protocol switch method pru_detach() so that it returns void</title>
<updated>2006-04-01T15:42:02Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2006-04-01T15:42:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=bc725eafc7f7d0cb3d3746b71b3cad9b2bc9d499'/>
<id>urn:sha1:bc725eafc7f7d0cb3d3746b71b3cad9b2bc9d499</id>
<content type='text'>
rather than an error.  Detaches do not "fail", they other occur or
the protocol flags SS_PROTOREF to take ownership of the socket.

soclose() no longer looks at so_pcb to see if it's NULL, relying
entirely on the protocol to decide whether it's time to free the
socket or not using SS_PROTOREF.  so_pcb is now entirely owned and
managed by the protocol code.  Likewise, no longer test so_pcb in
other socket functions, such as soreceive(), which have no business
digging into protocol internals.

Protocol detach routines no longer try to free the socket on detach,
this is performed in the socket code if the protocol permits it.

In rts_detach(), no longer test for rp != NULL in detach, and
likewise in other protocols that don't permit a NULL so_pcb, reduce
the incidence of testing for it during detach.

netinet and netinet6 are not fully updated to this change, which
will be in an upcoming commit.  In their current state they may leak
memory or panic.

MFC after:	3 months
</content>
</entry>
<entry>
<title>Acquire the raw_cb mutex around LIST_REMOVE() of a raw socket control</title>
<updated>2005-01-24T22:56:09Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2005-01-24T22:56:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=31c436a2a9c4080f397371f80f74e85b81293a87'/>
<id>urn:sha1:31c436a2a9c4080f397371f80f74e85b81293a87</id>
<content type='text'>
block from the global raw socket list.

Submitted by:	Roselyn Lee &lt;rosel at verniernetworks dot com&gt;
MFC after:	1 week
</content>
</entry>
<entry>
<title>/* -&gt; /*- for license, minor formatting changes</title>
<updated>2005-01-07T01:45:51Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2005-01-07T01:45:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=c398230b64aea809cb7c5cea8db580af7097920c'/>
<id>urn:sha1:c398230b64aea809cb7c5cea8db580af7097920c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Push acquisition of the accept mutex out of sofree() into the caller</title>
<updated>2004-10-18T22:19:43Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-10-18T22:19:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=81158452be7803fda8aa36feb4464d5301dce85c'/>
<id>urn:sha1:81158452be7803fda8aa36feb4464d5301dce85c</id>
<content type='text'>
(sorele()/sotryfree()):

- This permits the caller to acquire the accept mutex before the socket
  mutex, avoiding sofree() having to drop the socket mutex and re-order,
  which could lead to races permitting more than one thread to enter
  sofree() after a socket is ready to be free'd.

- This also covers clearing of the so_pcb weak socket reference from
  the protocol to the socket, preventing races in clearing and
  evaluation of the reference such that sofree() might be called more
  than once on the same socket.

This appears to close a race I was able to easily trigger by repeatedly
opening and resetting TCP connections to a host, in which the
tcp_close() code called as a result of the RST raced with the close()
of the accepted socket in the user process resulting in simultaneous
attempts to de-allocate the same socket.  The new locking increases
the overhead for operations that may potentially free the socket, so we
will want to revise the synchronization strategy here as we normalize
the reference counting model for sockets.  The use of the accept mutex
in freeing of sockets that are not listen sockets is primarily
motivated by the potential need to remove the socket from the
incomplete connection queue on its parent (listen) socket, so cleaning
up the reference model here may allow us to substantially weaken the
synchronization requirements.

RELENG_5_3 candidate.

MFC after:	3 days
Reviewed by:	dwhite
Discussed with:	gnn, dwhite, green
Reported by:	Marc UBM Bocklet &lt;ubm at u-boot-man dot de&gt;
Reported by:	Vlad &lt;marchenko at gmail dot com&gt;
</content>
</entry>
<entry>
<title>Lock down rawcb_list, a global list of control blocks for raw sockets,</title>
<updated>2004-06-15T04:13:59Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-06-15T04:13:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=730262cdf704a2a69dc63ab1e38bea664118a7f1'/>
<id>urn:sha1:730262cdf704a2a69dc63ab1e38bea664118a7f1</id>
<content type='text'>
using rawcb_mtx.  Hold this mutex while modifying or iterating over
the control list; this means that the mutex is held over calls into
socket delivery code, which no longer causes a lock order reversal as
the routing socket code uses a netisr to avoid recursing socket -&gt;
routing -&gt; socket.

Note: Locking of IPsec consumers of rawcb_list is not included in this
commit.
</content>
</entry>
</feed>
