#
dad14216 |
| 08-Apr-2013 |
John Baldwin <jhb@FreeBSD.org> |
Fix a potential socket leak in the NFS server. If a client closes its connection after it was accepted by the userland nfsd process but before it was handled off to svc_vc_create() in the kernel, th
Fix a potential socket leak in the NFS server. If a client closes its connection after it was accepted by the userland nfsd process but before it was handled off to svc_vc_create() in the kernel, then svc_vc_create() would see it as a new listen socket and try to listen on it leaving a dangling reference to the socket. Instead, check for disconnected sockets and treat them like a connected socket. The call to pru_getaddr() should fail and cause svc_vc_create() to fail. Note that we need to lock the socket to get a consistent snapshot of so_state since there is a window in soisdisconnected() where both flags are clear.
Reviewed by: dfr, rmacklem MFC after: 1 week
show more ...
|
#
876a84e8 |
| 18-Mar-2013 |
Martin Matuska <mm@FreeBSD.org> |
MFC @248461
|
#
bd54830b |
| 12-Mar-2013 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Use m_get(), m_gethdr() and m_getcl() instead of historic macros.
Sponsored by: Nginx, Inc.
|
#
d241a0e6 |
| 26-Feb-2013 |
Xin LI <delphij@FreeBSD.org> |
IFC @247348.
|
#
d9a44755 |
| 08-Feb-2013 |
David E. O'Brien <obrien@FreeBSD.org> |
Sync with HEAD.
|
#
46b1c55d |
| 04-Jan-2013 |
Neel Natu <neel@FreeBSD.org> |
IFC @ r244983.
|
#
e2adc47d |
| 08-Dec-2012 |
Rick Macklem <rmacklem@FreeBSD.org> |
Add support for backchannels to the kernel RPC. Backchannels are used by NFSv4.1 for callbacks. A backchannel is a connection established by the client, but used for RPCs done by the server on the cl
Add support for backchannels to the kernel RPC. Backchannels are used by NFSv4.1 for callbacks. A backchannel is a connection established by the client, but used for RPCs done by the server on the client (callbacks). As a result, this patch mixes some client side calls in the server side and vice versa. Some definitions in the .c files were extracted out into a file called krpc.h, so that they could be included in multiple .c files. This code has been in projects/nfsv4.1-client for some time. Although no one has given it a formal review, I believe kib@ has taken a look at it.
show more ...
|
#
eb1b1807 |
| 05-Dec-2012 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Mechanically substitute flags from historic mbuf allocator with malloc(9) flags within sys.
Exceptions:
- sys/contrib not touched - sys/mbuf.h edited manually
|
Revision tags: release/9.1.0, release/8.3.0_cvs, release/8.3.0, release/9.0.0 |
|
#
9b4fcf85 |
| 18-Feb-2011 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Merge svn+ssh://svn.freebsd.org/base/head@218816
|
#
1fb51a12 |
| 16-Feb-2011 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
Mfp4 CH=177274,177280,177284-177285,177297,177324-177325
VNET socket push back: try to minimize the number of places where we have to switch vnets and narrow down the time we stay switched. A
Mfp4 CH=177274,177280,177284-177285,177297,177324-177325
VNET socket push back: try to minimize the number of places where we have to switch vnets and narrow down the time we stay switched. Add assertions to the socket code to catch possibly unset vnets as seen in r204147.
While this reduces the number of vnet recursion in some places like NFS, POSIX local sockets and some netgraph, .. recursions are impossible to fix.
The current expectations are documented at the beginning of uipc_socket.c along with the other information there.
Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Reviewed by: jhb Tested by: zec
Tested by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 2 weeks
show more ...
|
Revision tags: release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0 |
|
#
2a1e0fb4 |
| 10-Jan-2011 |
Rick Macklem <rmacklem@FreeBSD.org> |
Fix a bug in the client side krpc where it was, sometimes erroneously, assumed that 4 bytes of data were in the first mbuf of a list by replacing the bcopy() with m_copydata(). Also, replace the uses
Fix a bug in the client side krpc where it was, sometimes erroneously, assumed that 4 bytes of data were in the first mbuf of a list by replacing the bcopy() with m_copydata(). Also, replace the uses of m_pullup(), which can fail for reasons other than not enough data, with m_copydata(). For the cases where it isn't known that there is enough data in the mbuf list, check first via m_len and m_length(). This is believed to fix a problem reported by dpd at dpdtech.com and george+freebsd at m5p.com.
Reviewed by: jhb MFC after: 8 days
show more ...
|
Revision tags: release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0, release/8.0.0_cvs, release/8.0.0 |
|
#
10b3b545 |
| 17-Sep-2009 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Merge from head
|
#
cbd59a4f |
| 08-Sep-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
- MFC from head@196987
|
#
83864c81 |
| 28-Aug-2009 |
Marko Zec <zec@FreeBSD.org> |
MFC r196503:
Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet context inside the RPC code.
Temporarily set td's cred to mount's cred before calling socreate() via
MFC r196503:
Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet context inside the RPC code.
Temporarily set td's cred to mount's cred before calling socreate() via __rpc_nconf2socket().
Submitted by: rmacklem (in part) Reviewed by: rmacklem, rwatson Discussed with: dfr, bz Approved by: re (rwatson), julian (mentor)
Approved by: re (rwatson)
show more ...
|
#
0348c661 |
| 24-Aug-2009 |
Marko Zec <zec@FreeBSD.org> |
Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet context inside the RPC code.
Temporarily set td's cred to mount's cred before calling socreate() via __rpc_nconf2socket().
Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet context inside the RPC code.
Temporarily set td's cred to mount's cred before calling socreate() via __rpc_nconf2socket().
Submitted by: rmacklem (in part) Reviewed by: rmacklem, rwatson Discussed with: dfr, bz Approved by: re (rwatson), julian (mentor) MFC after: 3 days
show more ...
|
#
09c817ba |
| 03-Jul-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
- MFC
|
#
6b97c9f0 |
| 18-Jun-2009 |
Rick Macklem <rmacklem@FreeBSD.org> |
Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the SVCXPTR structure returned by them, it was possible for the structure to be free'd before svc_reg() had been completed using th
Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the SVCXPTR structure returned by them, it was possible for the structure to be free'd before svc_reg() had been completed using the structure. This patch acquires a reference count on the newly created structure that is returned by svc_[dg|vc|tli|tp]_create(). It also adds the appropriate SVC_RELEASE() calls to the callers, except the experimental nfs subsystem. The latter will be committed separately.
Submitted by: dfr Tested by: pho Approved by: kib (mentor)
show more ...
|
#
7e857dd1 |
| 12-Jun-2009 |
Oleksandr Tymoshenko <gonzo@FreeBSD.org> |
- Merge from HEAD
|
#
0da4382a |
| 05-Jun-2009 |
Robert Watson <rwatson@FreeBSD.org> |
Correct MAC compile problems resulting from the new RPC code copying and pasting code from the general socket code without also bringing along required opt_mac.h includes.
|
#
d042da96 |
| 04-Jun-2009 |
Jung-uk Kim <jkim@FreeBSD.org> |
Resync with head.
|
#
a4fa5e6d |
| 04-Jun-2009 |
Rick Macklem <rmacklem@FreeBSD.org> |
Fix two races in the server side krpc w.r.t upcalls: Add a flag so that soupcall_clear() is only called once to cancel an upcall. Move the test for xprt_registered in the upcall down to after t
Fix two races in the server side krpc w.r.t upcalls: Add a flag so that soupcall_clear() is only called once to cancel an upcall. Move the test for xprt_registered in the upcall down to after the mtx_lock() of the pool mutex, to catch the case where it is unregistered while the upcall is waiting for the mutex. Also, move the mtx_destroy() of the pool mutex to after SVC_RELEASE(), so that it isn't destroyed before the upcalls are disabled.
Reviewed by: dfr, jhb Tested by: pho Approved by: kib (mentor)
show more ...
|
#
2e03f452 |
| 04-Jun-2009 |
Jung-uk Kim <jkim@FreeBSD.org> |
Resync with head.
|
#
f93bfb23 |
| 02-Jun-2009 |
Robert Watson <rwatson@FreeBSD.org> |
Add internal 'mac_policy_count' counter to the MAC Framework, which is a count of the number of registered policies.
Rather than unconditionally locking sockets before passing them into MAC, lock th
Add internal 'mac_policy_count' counter to the MAC Framework, which is a count of the number of registered policies.
Rather than unconditionally locking sockets before passing them into MAC, lock them in the MAC entry points only if mac_policy_count is non-zero.
This avoids locking overhead for a number of socket system calls when no policies are registered, eliminating measurable overhead for the MAC Framework for the socket subsystem when there are no active policies.
Possibly socket locks should be acquired by policies if they are required for socket labels, which would further avoid locking overhead when there are policies but they don't require labeling of sockets, or possibly don't even implement socket controls.
Obtained from: TrustedBSD Project
show more ...
|
#
74fb0ba7 |
| 01-Jun-2009 |
John Baldwin <jhb@FreeBSD.org> |
Rework socket upcalls to close some races with setup/teardown of upcalls. - Each socket upcall is now invoked with the appropriate socket buffer locked. It is not permissible to call soisconnected
Rework socket upcalls to close some races with setup/teardown of upcalls. - Each socket upcall is now invoked with the appropriate socket buffer locked. It is not permissible to call soisconnected() with this lock held; however, so socket upcalls now return an integer value. The two possible values are SU_OK and SU_ISCONNECTED. If an upcall returns SU_ISCONNECTED, then the soisconnected() will be invoked on the socket after the socket buffer lock is dropped. - A new API is provided for setting and clearing socket upcalls. The API consists of soupcall_set() and soupcall_clear(). - To simplify locking, each socket buffer now has a separate upcall. - When a socket upcall returns SU_ISCONNECTED, the upcall is cleared from the receive socket buffer automatically. Note that a SO_SND upcall should never return SU_ISCONNECTED. - All this means that accept filters should now return SU_ISCONNECTED instead of calling soisconnected() directly. They also no longer need to explicitly clear the upcall on the new socket. - The HTTP accept filter still uses soupcall_set() to manage its internal state machine, but other accept filters no longer have any explicit knowlege of socket upcall internals aside from their return value. - The various RPC client upcalls currently drop the socket buffer lock while invoking soreceive() as a temporary band-aid. The plan for the future is to add a new flag to allow soreceive() to be called with the socket buffer locked. - The AIO callback for socket I/O is now also invoked with the socket buffer locked. Previously sowakeup() would drop the socket buffer lock only to call aio_swake() which immediately re-acquired the socket buffer lock for the duration of the function call.
Discussed with: rwatson, rmacklem
show more ...
|
Revision tags: release/7.2.0_cvs, release/7.2.0, release/7.1.0_cvs, release/7.1.0 |
|
#
e57c2b13 |
| 04-Dec-2008 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
integrate from head@185615
|