<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/netatalk/ddp_pcb.c, branch release/6.0.0_cvs</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>This commit was manufactured by cvs2svn to create tag</title>
<updated>2005-11-03T00:35:26+00:00</updated>
<author>
<name>cvs2svn</name>
<email>cvs2svn@FreeBSD.org</email>
</author>
<published>2005-11-03T00:35:26+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3640cb54210edbb7edbf1b12ef0127ecfcea967d'/>
<id>3640cb54210edbb7edbf1b12ef0127ecfcea967d</id>
<content type='text'>
'RELENG_6_0_0_RELEASE'.

This commit was manufactured to restore the state of the 6.0-RELEASE image.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'RELENG_6_0_0_RELEASE'.

This commit was manufactured to restore the state of the 6.0-RELEASE image.
</pre>
</div>
</content>
</entry>
<entry>
<title>/* -&gt; /*- for license, minor formatting changes, insert COPYRIGHT into files</title>
<updated>2005-01-07T02:35:34+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2005-01-07T02:35:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ed31b82378305968d32118a6270bc239ae49b7af'/>
<id>ed31b82378305968d32118a6270bc239ae49b7af</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>If MALLOC() fails in at_pcballoc(), return ENOBUFS rather than</title>
<updated>2005-01-03T00:16:07+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2005-01-03T00:16:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=dd49efac2fa69e69598888ecf3e8a4e8dbb998ae'/>
<id>dd49efac2fa69e69598888ecf3e8a4e8dbb998ae</id>
<content type='text'>
potentially panicking.

MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
potentially panicking.

MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>Push acquisition of the accept mutex out of sofree() into the caller</title>
<updated>2004-10-18T22:19:43+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-10-18T22:19:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=81158452be7803fda8aa36feb4464d5301dce85c'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Procotol control block locking for netatalk DDP.</title>
<updated>2004-07-12T18:39:59+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-07-12T18:39:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8375a14422307f53450e31d3bf728f6146297598'/>
<id>8375a14422307f53450e31d3bf728f6146297598</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Extend coverage of SOCK_LOCK(so) to include so_count, the socket</title>
<updated>2004-06-12T20:47:32+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-06-12T20:47:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=395a08c90416e029c757cb51721b87b83fd0194b'/>
<id>395a08c90416e029c757cb51721b87b83fd0194b</id>
<content type='text'>
reference count:

- Assert SOCK_LOCK(so) macros that directly manipulate so_count:
  soref(), sorele().

- Assert SOCK_LOCK(so) in macros/functions that rely on the state of
  so_count: sofree(), sotryfree().

- Acquire SOCK_LOCK(so) before calling these functions or macros in
  various contexts in the stack, both at the socket and protocol
  layers.

- In some cases, perform soisdisconnected() before sotryfree(), as
  this could result in frobbing of a non-present socket if
  sotryfree() actually frees the socket.

- Note that sofree()/sotryfree() will release the socket lock even if
  they don't free the socket.

Submitted by:	sam
Sponsored by:	FreeBSD Foundation
Obtained from:	BSD/OS
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
reference count:

- Assert SOCK_LOCK(so) macros that directly manipulate so_count:
  soref(), sorele().

- Assert SOCK_LOCK(so) in macros/functions that rely on the state of
  so_count: sofree(), sotryfree().

- Acquire SOCK_LOCK(so) before calling these functions or macros in
  various contexts in the stack, both at the socket and protocol
  layers.

- In some cases, perform soisdisconnected() before sotryfree(), as
  this could result in frobbing of a non-present socket if
  sotryfree() actually frees the socket.

- Note that sofree()/sotryfree() will release the socket lock even if
  they don't free the socket.

Submitted by:	sam
Sponsored by:	FreeBSD Foundation
Obtained from:	BSD/OS
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename 'ddpcb' variable to 'ddpcb_list' to better distinguish it from</title>
<updated>2004-03-22T04:54:36+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-03-22T04:54:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3280e5dc69ee43e713f4ddb73fda26ce124aecaf'/>
<id>3280e5dc69ee43e713f4ddb73fda26ce124aecaf</id>
<content type='text'>
'struct ddpcb'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'struct ddpcb'.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename 'at_ifaddr' list to 'at_ifaddr_list' so that the variable is</title>
<updated>2004-03-22T04:50:36+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-03-22T04:50:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4ddd6a81e0fc35c2467efc9665ca3c06e601c8f1'/>
<id>4ddd6a81e0fc35c2467efc9665ca3c06e601c8f1</id>
<content type='text'>
more easily mechanically distinguished from 'struct at_ifaddr'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
more easily mechanically distinguished from 'struct at_ifaddr'.
</pre>
</div>
</content>
</entry>
<entry>
<title>Compare pointers with NULL rather than 0, or treating them as boolans in</title>
<updated>2004-03-22T03:57:01+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-03-22T03:57:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f2aa1787257bad51adbb1ad25ac2117dc6e1f9fe'/>
<id>f2aa1787257bad51adbb1ad25ac2117dc6e1f9fe</id>
<content type='text'>
if statements.

at_rmx gets a $FreeBSD$ out of the deal also (this code appears to be
unused).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if statements.

at_rmx gets a $FreeBSD$ out of the deal also (this code appears to be
unused).
</pre>
</div>
</content>
</entry>
<entry>
<title>Since I have my hands all over netatalk adding locking and restructuring</title>
<updated>2004-03-22T03:24:10+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-03-22T03:24:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b8e3da4a8359080d1f6ad95cb90677d6be0fe979'/>
<id>b8e3da4a8359080d1f6ad95cb90677d6be0fe979</id>
<content type='text'>
it, cinch the file's style closer to style(9) with regard to parenthesis:

  s/( /(/g
  s/ )/)/g
  s/return(/return (/g
  s/return 0/return (0)/
  s/return 1/return (1)/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
it, cinch the file's style closer to style(9) with regard to parenthesis:

  s/( /(/g
  s/ )/)/g
  s/return(/return (/g
  s/return 0/return (0)/
  s/return 1/return (1)/
</pre>
</div>
</content>
</entry>
</feed>
