|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0 |
|
| #
575a909a |
| 19-Jan-2024 |
Konstantin Belousov <[email protected]> |
kcmp(2): implement for generic file types
(cherry picked from commit f28526e9466cd60ed33053e922238ba1c9040341)
|
|
Revision tags: release/14.0.0 |
|
| #
685dc743 |
| 16-Aug-2023 |
Warner Losh <[email protected]> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
|
Revision tags: release/13.2.0 |
|
| #
ac4e3a27 |
| 14-Dec-2022 |
Andrew Gallatin <[email protected]> |
Unbreak the build when MAC is not defined
7a2c93b86ef7 removed the use of "error" when MAC was not defined, resulting in an unused variable error.
Sponsored by: Netflix Reviewed by: jhb
|
| #
7a2c93b8 |
| 14-Dec-2022 |
Gleb Smirnoff <[email protected]> |
sockets: provide sousrsend() that does socket specific error handling
Sockets have special handling for EPIPE on a write, that was spread out into several places. Treating transient errors is also
sockets: provide sousrsend() that does socket specific error handling
Sockets have special handling for EPIPE on a write, that was spread out into several places. Treating transient errors is also special - if protocol is atomic, than we should ignore any changes to uio_resid, a transient error means the write had completely failed (see d2b3a0ed31e).
- Provide sousrsend() that expects a valid uio, and leave sosend() for kernel consumers only. Do all special error handling right here. - In dofilewrite() don't do special handling of error for DTYPE_SOCKET. - For send(2), write(2) and aio_write(2) call into sousrsend() and remove error handling for kern_sendit(), soo_write() and soaio_process_job().
PR: 265087 Reported by: rz-rpi03 at h-ka.de Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35863
show more ...
|
|
Revision tags: release/12.4.0 |
|
| #
e3885a78 |
| 26-Aug-2022 |
John Baldwin <[email protected]> |
soo_stat: Ensure error is always initialized.
In kernels without MAC, error is not set for sockets whose protocol layer does not implement the pr_sense hook.
Reported by: Jenkins (powerpc kernel bu
soo_stat: Ensure error is always initialized.
In kernels without MAC, error is not set for sockets whose protocol layer does not implement the pr_sense hook.
Reported by: Jenkins (powerpc kernel builds) Fixes: 7c04ca1fad67 sockets: for stat(2) on a socket don't report hiwat as block size
show more ...
|
| #
7c04ca1f |
| 26-Aug-2022 |
Gleb Smirnoff <[email protected]> |
sockets: for stat(2) on a socket don't report hiwat as block size
The code appeared in d8392c6c39eb with not good explanation. It is very unlikely any software in the world needs that.
Differentia
sockets: for stat(2) on a socket don't report hiwat as block size
The code appeared in d8392c6c39eb with not good explanation. It is very unlikely any software in the world needs that.
Differential revision: https://reviews.freebsd.org/D36283
show more ...
|
| #
e7d02be1 |
| 17-Aug-2022 |
Gleb Smirnoff <[email protected]> |
protosw: refactor protosw and domain static declaration and load
o Assert that every protosw has pr_attach. Now this structure is only for socket protocols declarations and nothing else. o Merge
protosw: refactor protosw and domain static declaration and load
o Assert that every protosw has pr_attach. Now this structure is only for socket protocols declarations and nothing else. o Merge struct pr_usrreqs into struct protosw. This was suggested in 1996 by wollman@ (see 7b187005d18ef), and later reiterated in 2006 by rwatson@ (see 6fbb9cf860dcd). o Make struct domain hold a variable sized array of protosw pointers. For most protocols these pointers are initialized statically. Those domains that may have loadable protocols have spacers. IPv4 and IPv6 have 8 spacers each (andre@ dff3237ee54ea). o For inetsw and inet6sw leave a comment noting that many protosw entries very likely are dead code. o Refactor pf_proto_[un]register() into protosw_[un]register(). o Isolate pr_*_notsupp() methods into uipc_domain.c
Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D36232
show more ...
|
| #
8c309d48 |
| 17-Jun-2022 |
Damjan Jovanovic <[email protected]> |
struct kinfo_file changes needed for lsof to work using only usermode APIs`
Add kf_pipe_buffer_[in/out/size] fields to kf_pipe, and populate them.
Add a kf_kqueue struct to the kf_un union, to allo
struct kinfo_file changes needed for lsof to work using only usermode APIs`
Add kf_pipe_buffer_[in/out/size] fields to kf_pipe, and populate them.
Add a kf_kqueue struct to the kf_un union, to allow querying kqueue state, and populate it.
Populate the kf_sock_rcv_sb_state and kf_sock_snd_sb_state fields in kf_sock for INET/INET6 sockets, and populate all other fields for all transport layer protocols, not just TCP.
Bump __FreeBSD_version.
Differential revision: https://reviews.freebsd.org/D34184 Reviewed by: jhb, kib, se MFC after: 1 week
show more ...
|
| #
a8e286bb |
| 03-Jun-2022 |
Gleb Smirnoff <[email protected]> |
sockets: use socket buffer mutexes in struct socket directly
Convert more generic socket code to not use sockbuf compat pointer. Continuation of 4328318445a.
|
| #
f0837393 |
| 31-May-2022 |
Gleb Smirnoff <[email protected]> |
soo_aio_*: use socket buffer mutexes in struct socket directly
A miss from commit 4328318445a.
|
| #
43283184 |
| 12-May-2022 |
Gleb Smirnoff <[email protected]> |
sockets: use socket buffer mutexes in struct socket directly
Since c67f3b8b78e the sockbuf mutexes belong to the containing socket, and socket buffers just point to it. In 74a68313b50 macros that a
sockets: use socket buffer mutexes in struct socket directly
Since c67f3b8b78e the sockbuf mutexes belong to the containing socket, and socket buffers just point to it. In 74a68313b50 macros that access this mutex directly were added. Go over the core socket code and eliminate code that reaches the mutex by dereferencing the sockbuf compatibility pointer.
This change requires a KPI change, as some functions were given the sockbuf pointer only without any hint if it is a receive or send buffer.
This change doesn't cover the whole kernel, many protocols still use compatibility pointers internally. However, it allows operation of a protocol that doesn't use them.
Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35152
show more ...
|
|
Revision tags: release/13.1.0 |
|
| #
36fb3722 |
| 13-Apr-2022 |
John Baldwin <[email protected]> |
kern: Move variables only used for MAC under #ifdef MAC.
|
| #
af40f9bf |
| 14-Dec-2021 |
Mateusz Guzik <[email protected]> |
socket: plug set-but-not-used vars
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
|
Revision tags: release/12.3.0 |
|
| #
e3ba94d4 |
| 09-Nov-2021 |
John Baldwin <[email protected]> |
Don't require the socket lock for sorele().
Previously, sorele() always required the socket lock and dropped the lock if the released reference was not the last reference. Many callers locked the s
Don't require the socket lock for sorele().
Previously, sorele() always required the socket lock and dropped the lock if the released reference was not the last reference. Many callers locked the socket lock just before calling sorele() resulting in a wasted lock/unlock when not dropping the last reference.
Move the previous implementation of sorele() into a new sorele_locked() function and use it instead of sorele() for various places in uipc_socket.c that called sorele() while already holding the socket lock.
The sorele() macro now uses refcount_release_if_not_last() try to drop the socket reference without locking the socket. If that shortcut fails, it locks the socket and calls sorele_locked().
Reviewed by: kib, markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32741
show more ...
|
| #
d1b6fef0 |
| 12-Oct-2021 |
John Baldwin <[email protected]> |
Stop creating socket aio kprocs during boot.
Create the initial pool of kprocs on demand when the first socket AIO request is submitted instead. The pool of kprocs used for other AIO requests is si
Stop creating socket aio kprocs during boot.
Create the initial pool of kprocs on demand when the first socket AIO request is submitted instead. The pool of kprocs used for other AIO requests is similarly created on first use.
Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32468
show more ...
|
| #
2b68eb8e |
| 01-Oct-2021 |
Mateusz Guzik <[email protected]> |
vfs: remove thread argument from VOP_STAT
and fo_stat.
|
| #
b864b67a |
| 12-Sep-2021 |
Mark Johnston <[email protected]> |
socket: Do not include control messages in FIONREAD return value
Some system software expects to be able to read at least the number of bytes returned by FIONREAD. When control messages are counted
socket: Do not include control messages in FIONREAD return value
Some system software expects to be able to read at least the number of bytes returned by FIONREAD. When control messages are counted in this return value, this assumption is violated. Follow Linux and OpenBSD here (as well as our own kevent(EVFILT_READ)) and only return the number of data bytes available.
Reported by: avg MFC after: 2 weeks
show more ...
|
| #
141fe2dc |
| 10-Sep-2021 |
Mark Johnston <[email protected]> |
aio: Interlock with listen(2)
soo_aio_queue() did not handle the possibility that the provided socket is a listening socket. Up until recently, to fix this one would have to acquire the socket lock
aio: Interlock with listen(2)
soo_aio_queue() did not handle the possibility that the provided socket is a listening socket. Up until recently, to fix this one would have to acquire the socket lock first and check, since the socket buffer locks were destroyed by listen(2).
Now that the socket buffer locks belong to the socket, simply check SOLISTENING(so) after acquiring them, and make listen(2) return an error if any AIO jobs are enqueued on the socket.
Add a couple of simple regression test cases.
Note that this fixes things only for the default AIO implementation; cxgbe(4)'s TCP offload has a separate pru_aio_queue implementation which requires its own solution.
Reported by: [email protected] Reported by: [email protected] Reported by: [email protected] Reported by: [email protected] Reviewed by: tuexen, gallatin, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31901
show more ...
|
| #
8e8f1cc9 |
| 23-Apr-2021 |
Mark Johnston <[email protected]> |
Re-enable network ioctls in capability mode
This reverts a portion of 274579831b61 ("capsicum: Limit socket operations in capability mode") as at least rtsol and dhcpcd rely on being able to configu
Re-enable network ioctls in capability mode
This reverts a portion of 274579831b61 ("capsicum: Limit socket operations in capability mode") as at least rtsol and dhcpcd rely on being able to configure network interfaces while in capability mode.
Reported by: bapt, Greg V Sponsored by: The FreeBSD Foundation
show more ...
|
|
Revision tags: release/13.0.0 |
|
| #
27457983 |
| 07-Apr-2021 |
Mark Johnston <[email protected]> |
capsicum: Limit socket operations in capability mode
Capsicum did not prevent certain privileged networking operations, specifically creation of raw sockets and network configuration ioctls. However
capsicum: Limit socket operations in capability mode
Capsicum did not prevent certain privileged networking operations, specifically creation of raw sockets and network configuration ioctls. However, these facilities can be used to circumvent some of the restrictions that capability mode is supposed to enforce.
Add capability mode checks to disallow network configuration ioctls and creation of sockets other than PF_LOCAL and SOCK_DGRAM/STREAM/SEQPACKET internet sockets.
Reviewed by: oshogbo Discussed with: emaste Reported by: manu Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29423
show more ...
|
| #
2247f489 |
| 03-Jan-2021 |
Alan Somers <[email protected]> |
aio: micro-optimize the lio_opcode assignments
This allows slightly more efficient opcode testing in-kernel. It is transparent to userland, except to applications that sneakily submit aio fsync or
aio: micro-optimize the lio_opcode assignments
This allows slightly more efficient opcode testing in-kernel. It is transparent to userland, except to applications that sneakily submit aio fsync or aio mlock operations via lio_listio, which has never been documented, requires the use of deliberately undefined constants (LIO_SYNC and LIO_MLOCK), and is arguably a bug.
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D27942
show more ...
|
| #
022ca2fc |
| 02-Jan-2021 |
Alan Somers <[email protected]> |
Add aio_writev and aio_readv
POSIX AIO is great, but it lacks vectored I/O functions. This commit fixes that shortcoming by adding aio_writev and aio_readv. They aren't part of the standard, but the
Add aio_writev and aio_readv
POSIX AIO is great, but it lacks vectored I/O functions. This commit fixes that shortcoming by adding aio_writev and aio_readv. They aren't part of the standard, but they're an obvious extension. They work just like their synchronous equivalents pwritev and preadv.
It isn't yet possible to use vectored aiocbs with lio_listio, but that could be added in the future.
Reviewed by: jhb, kib, bcr Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27743
show more ...
|
| #
f908d824 |
| 07-Nov-2020 |
Michael Tuexen <[email protected]> |
The ioctl() calls using FIONREAD, FIONWRITE, FIONSPACE, and SIOCATMARK access the socket send or receive buffer. This is not possible for listening sockets since r319722. Because send()/recv() calls
The ioctl() calls using FIONREAD, FIONWRITE, FIONSPACE, and SIOCATMARK access the socket send or receive buffer. This is not possible for listening sockets since r319722. Because send()/recv() calls fail on listening sockets, fail also ioctl() indicating EINVAL.
PR: 250366 Reported by: Yong-Hao Zou Reviewed by: glebius, rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26897
show more ...
|
|
Revision tags: release/12.2.0 |
|
| #
6fed89b1 |
| 01-Sep-2020 |
Mateusz Guzik <[email protected]> |
kern: clean up empty lines in .c and .h files
|
|
Revision tags: release/11.4.0 |
|
| #
99258935 |
| 20-Mar-2020 |
Mark Johnston <[email protected]> |
Lock the socket in soo_stat().
Otherwise nothing synchronizes with a concurrent conversion of the socket to a listening socket.
Only the PF_LOCAL protocols implement pru_sense, and it is safe to ho
Lock the socket in soo_stat().
Otherwise nothing synchronizes with a concurrent conversion of the socket to a listening socket.
Only the PF_LOCAL protocols implement pru_sense, and it is safe to hold the socket lock there, so do so for now.
Reported by: [email protected] MFC after: 1 week Sponsored by: The FreeBSD Foundation
show more ...
|