<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/sys/kern/sys_socket.c, branch releng/6.3</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=releng%2F6.3</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=releng%2F6.3'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2005-04-16T18:46:29Z</updated>
<entry>
<title>Introduce three additional MAC Framework and MAC Policy entry points to</title>
<updated>2005-04-16T18:46:29Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2005-04-16T18:46:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=7f53207b920ab74fb4fb9de4964071bbb13bbbec'/>
<id>urn:sha1:7f53207b920ab74fb4fb9de4964071bbb13bbbec</id>
<content type='text'>
control socket poll() (select()), fstat(), and accept() operations,
required for some policies:

        poll()          mac_check_socket_poll()
        fstat()         mac_check_socket_stat()
        accept()        mac_check_socket_accept()

Update mac_stub and mac_test policies to be aware of these entry points.
While here, add missing entry point implementations for:

        mac_stub.c      stub_check_socket_receive()
        mac_stub.c      stub_check_socket_send()
        mac_test.c      mac_test_check_socket_send()
        mac_test.c      mac_test_check_socket_visible()

Obtained from:	TrustedBSD Project
Sponsored by:	SPAWAR, SPARTA
</content>
</entry>
<entry>
<title>The SO_NOSIGPIPE socket option allows a user process to mark a socket</title>
<updated>2005-03-11T15:06:16Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2005-03-11T15:06:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=35a196154f3aee3cffea9c2f1d2d1ba170be37e2'/>
<id>urn:sha1:35a196154f3aee3cffea9c2f1d2d1ba170be37e2</id>
<content type='text'>
so that the socket does not generate SIGPIPE, only EPIPE, when a write
is attempted after socket shutdown.  When the option was introduced in
2002, this required the logic for determining whether SIGPIPE was
generated to be pushed down from dofilewrite() to the socket layer so
that the socket options could be considered.  However, the change in
2002 omitted modification to soo_write() required to add that logic,
resulting in SIGPIPE not being generated even without SO_NOSIGPIPE when
the socket was written to using write() or related generic system calls.

This change adds the EPIPE logic to soo_write(), generating a SIGPIPE
signal to the process associated with the passed uio in the event that
the SO_NOSIGPIPE option is not set.

Notes:

- The are upsides and downsides to placing this logic in the socket
  layer as opposed to the file descriptor layer.  This is really fd
  layer logic, but because we need so_options, we have a choice of
  layering violations and pick this one.

- SIGPIPE possibly should be delivered to the thread performing the
  write, not the process performing the write.

- uio-&gt;uio_td and the td argument to soo_write() might potentially
  differ; we use the thread in the uio argument.

- The "sigpipe" regression test in src/tools/regression/sockets/sigpipe
  tests for the bug.

Submitted by:		Mikko Tyolajarvi &lt;mbsd at pacbell dot net&gt;
Talked with:		glebius, alfred
PR:			78478
MFC after:		1 week
</content>
</entry>
<entry>
<title>/* -&gt; /*- for copyright notices, minor format tweaks as necessary</title>
<updated>2005-01-06T23:35:40Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2005-01-06T23:35:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=9454b2d864463f856c6aaf147851104b25cf4037'/>
<id>urn:sha1:9454b2d864463f856c6aaf147851104b25cf4037</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Push Giant down through ioctl.</title>
<updated>2004-11-17T09:09:55Z</updated>
<author>
<name>Poul-Henning Kamp</name>
<email>phk@FreeBSD.org</email>
</author>
<published>2004-11-17T09:09:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=a0fbccc9e7e76341ed2e8313175195d0a17a3d86'/>
<id>urn:sha1:a0fbccc9e7e76341ed2e8313175195d0a17a3d86</id>
<content type='text'>
Don't grab Giant in the upper syscall/wrapper code

NET_LOCK_GIANT in the socket code (sockets/fifos).

mtx_lock(&amp;Giant) in the vnode code.

mtx_lock(&amp;Giant) in the opencrypto code.  (This may actually not be
needed, but better safe than sorry).

Devfs grabs Giant if the driver is marked as needing Giant.
</content>
</entry>
<entry>
<title>Push Giant down through select and poll.</title>
<updated>2004-11-17T08:01:10Z</updated>
<author>
<name>Poul-Henning Kamp</name>
<email>phk@FreeBSD.org</email>
</author>
<published>2004-11-17T08:01:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=db446e30cc9be65ecfd58882ca931983785ec5f4'/>
<id>urn:sha1:db446e30cc9be65ecfd58882ca931983785ec5f4</id>
<content type='text'>
Don't grab Giant in the upper syscall/wrapper code

NET_LOCK_GIANT in the socket code (sockets/fifos).

mtx_lock(&amp;Giant) in the vnode code.

Devfs grabs Giant if the driver is marked as needing Giant.
</content>
</entry>
<entry>
<title>Polish two functions a bit so that it is easier to wrap them in</title>
<updated>2004-11-13T17:21:26Z</updated>
<author>
<name>Poul-Henning Kamp</name>
<email>phk@FreeBSD.org</email>
</author>
<published>2004-11-13T17:21:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=e364b591970a03cfcc3ed00434a69abd7fcc8620'/>
<id>urn:sha1:e364b591970a03cfcc3ed00434a69abd7fcc8620</id>
<content type='text'>
locks if/when we need that.
</content>
</entry>
<entry>
<title>Push Giant acquisition down into fo_stat() from most callers.  Acquire</title>
<updated>2004-07-22T20:40:23Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-07-22T20:40:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=a6719c82b1c3be242512d7d331ab8b356265e468'/>
<id>urn:sha1:a6719c82b1c3be242512d7d331ab8b356265e468</id>
<content type='text'>
Giant conditional on debug.mpsafenet in the socket soo_stat() routine,
unconditionally in vn_statfile() for VFS, and otherwise don't acquire
Giant.  Accept an unlocked read in kqueue_stat(), and cryptof_stat() is
a no-op.  Don't acquire Giant in fstat() system call.

Note: in fdescfs, fo_stat() is called while holding Giant due to the VFS
stack sitting on top, and therefore there will still be Giant recursion
in this case.
</content>
</entry>
<entry>
<title>Push acquisition of Giant from fdrop_closed() into fo_close() so that</title>
<updated>2004-07-22T18:35:43Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-07-22T18:35:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=1c1ce9253fb52a3befc1c6179e57c8ce2dfd5187'/>
<id>urn:sha1:1c1ce9253fb52a3befc1c6179e57c8ce2dfd5187</id>
<content type='text'>
individual file object implementations can optionally acquire Giant if
they require it:

- soo_close(): depends on debug.mpsafenet
- pipe_close(): Giant not acquired
- kqueue_close(): Giant required
- vn_close(): Giant required
- cryptof_close(): Giant required (conservative)

Notes:

  Giant is still acquired in close() even when closing MPSAFE objects
  due to kqueue requiring Giant in the calling closef() code.
  Microbenchmarks indicate that this removal of Giant cuts 3%-3% off
  of pipe create/destroy pairs from user space with SMP compiled into
  the kernel.

  The cryptodev and opencrypto code appears MPSAFE, but I'm unable to
  test it extensively and so have left Giant over fo_close().  It can
  probably be removed given some testing and review.
</content>
</entry>
<entry>
<title>Annotate two intentionally unlocked reads with comments.</title>
<updated>2004-06-20T17:35:50Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-06-20T17:35:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=d43c1f67ccb03038614bdf9fc0e7ba735203246e'/>
<id>urn:sha1:d43c1f67ccb03038614bdf9fc0e7ba735203246e</id>
<content type='text'>
Annotate a potentially inconsistent result returned to user space when
performing fstaT() on a socket due to not using socket buffer locking.
</content>
</entry>
<entry>
<title>Merge additional socket buffer locking from rwatson_netperf:</title>
<updated>2004-06-17T22:48:11Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2004-06-17T22:48:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=9535efc00de36129762534223a2f5782cc5fe472'/>
<id>urn:sha1:9535efc00de36129762534223a2f5782cc5fe472</id>
<content type='text'>
- Lock down low hanging fruit use of sb_flags with socket buffer
  lock.

- Lock down low hanging fruit use of so_state with socket lock.

- Lock down low hanging fruit use of so_options.

- Lock down low-hanging fruit use of sb_lowwat and sb_hiwat with
  socket buffer lock.

- Annotate situations in which we unlock the socket lock and then
  grab the receive socket buffer lock, which are currently actually
  the same lock.  Depending on how we want to play our cards, we
  may want to coallesce these lock uses to reduce overhead.

- Convert a if()-&gt;panic() into a KASSERT relating to so_state in
  soaccept().

- Remove a number of splnet()/splx() references.

More complex merging of socket and socket buffer locking to
follow.
</content>
</entry>
</feed>
