aboutsummaryrefslogtreecommitdiff
path: root/lib/libsys
Commit message (Collapse)AuthorAgeFilesLines
* pdfork.2: document kern.pdfork_implicit_nowaitpidKonstantin Belousov8 days1-0/+11
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59349
* recv(2): update description of MSG_WAITALLGleb Smirnoff9 days1-3/+5
| | | | | | Remove a note about "data of a different type". This was a bug that was fixed in FreeBSD 15. Instead put an exact quote from SUS that lists allowed cases of a short read with MSG_WAITALL. See discussion in D57511.
* pdfork.2: document cap mode, namely pdopenpid(2) and pdptrace(2) errorsKonstantin Belousov2026-08-282-0/+43
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58989
* ptrace.2: document PT_GET_ABI_NAMEKonstantin Belousov2026-08-281-0/+11
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59113
* pdfork.2, rights.4: document pdptrace(2), CAP_PTRACE, and pdfork(PD_PTRACE_CAP)Konstantin Belousov2026-08-282-3/+49
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58586
* RegenKonstantin Belousov2026-08-282-0/+4
|
* lib/libsys: export pdptrace(2)Konstantin Belousov2026-08-281-0/+1
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58586
* shmfd: consistently return size in 512 byte blocks for fstat(2) st_blocksKonstantin Belousov2026-08-191-2/+6
| | | | | | | | | | | This is ABI-breaking change that could be considered as the bug fix. Requested by: David Timber <dxdt@dev.snart.me> Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation Relnotes: yes MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58942
* unix: allow connectat(2) to name the peer socket by descriptorJohn Ericson2026-08-101-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accept an empty `sun_path` when `fd` is not `AT_FDCWD`: the descriptor then names the peer unix socket directly, instead of being the starting directory for a pathname lookup. The held file reference keeps the peer PCB stable, playing the role `unp_vp_mtxpool` plays in the pathname path. The descriptor must carry `CAP_CONNECTAT` and refer to an `AF_UNIX` socket (`EPROTOTYPE` otherwise, `ENOTSOCK` for non-sockets). As with a pathname, a stream/seqpacket peer must be listening. No filesystem permission or MAC vnode check applies on this path: possession of the descriptor is the authorization, as with descriptor passing. Note this makes it possible to connect a datagram socket to an unbound peer, which no pathname could previously name. `connect(2)` and the implicit-connect send path pass `AT_FDCWD` and still reject an empty path with `EINVAL`. The `unp_sun_path()` call is hoisted out of `unp_connectat()` because the early exit conditions for the two system calls (`connect(2)` and `connectat(2)`) are slightly different. Additionally, support `/dev/fd/<N>`. In a world with `connectat(2)`, this is largely overkill, but this also allows me to add support for direct peer connections with plain `connect(2)`. I think that is a wise choice because this will allow me to propose this functionality for Linux too without a new system call (saving that conversation for later). Ultimately, I want to see multiple operating systems support this to foster broader userland adoption, which should benefit everyone including FreeBSD --- it's nicer if more 3rd party in addition to 1st party software uses the new kernel functionality. Therefore, I hope this additional feature is also acceptable. Signed-off-by: John Ericson <John.Ericson@Obsidian.Systems> Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5) Reviewed by: markj MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D58405
* pddupfd.2: fix errno value returned for non-procdesc argumentKonstantin Belousov2026-08-051-4/+4
| | | | | | | Noted and reviewed by: lwhsu Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58666
* manuals: Fix Fx and nearby mechanical typosAlexander Ziaee2026-08-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Fix compiler warnings related to the Fx macro, as well as all other mechanical typos that were visible within one screenful of them. These cause rendering glitches on various toolchains with various of the five and a half decades of rich output formats and tooling manpages scale to. The *x macro set specifies operating systems. These macros take the rest of the line as an argument. Sometimes, a space was not used to separate the argument of Fx and the trailing period. Another, FreeBSD Foundation was misrepresented as an operating system version instead of an author. Two more had other parts of the sentence supplied as an argument to Fx. While I had those open, fix the other mechancial typos visible on those specific screenfulls. Fix a list width glitch, correct section typo AUTHOR to AUTHORS, and switch AUTHORS sections containing prose to prose-mode so that they wrap freely when rendered. PR: 297248 MFC after: 3 days Fixes: d39e310c7d6a ("man/man3: add stdbit.3") Fixes: d790b16bbf0c ("add man pages for stdbit functions") Fixes: b61850c4e6f6 ("net.link.bridge.member_ifaddrs to false") Reported by: wosch (groff is complaining about incorrect Fx usage)
* stat.2: enhance the description of st_blocksKonstantin Belousov2026-08-021-1/+11
| | | | | | | Reviewed by: emaste, mckusick Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D58592
* pdwait(2), wait(2): document interaction between pdopenpid() and waitpid()Konstantin Belousov2026-08-012-13/+57
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58264
* mknod.2: properly document root requirementsKonstantin Belousov2026-07-281-1/+1
| | | | | | | Submitted by: Martijn Dekker <mcdutchie@hotmail.com> PR: 297082 Fixes: 4090d103b0c3 ("mknod.2: update the man page") MFC after: 3 days
* Regenerate after fixing getfhat(2) prototypeJohn Baldwin2026-07-271-2/+2
|
* _umtx_op.2: document the CVWAIT_UMTX_TIME flag for the UMTX_OP_CV_WAIT_UC ↵Konstantin Belousov2026-07-271-2/+21
| | | | | | | | | request Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58463
* mknod.2: update the man pageKonstantin Belousov2026-07-271-7/+16
| | | | | | | | | | | State that FIFOs can be created, document the requirement that dev must be zero then. Mention whiteouts. PR: 297082 Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D58478
* Bump datesDag-Erling Smørgrav2026-07-271-1/+1
| | | | | | Fixes: c8f5e6819d4d ("pwait: Optionally wait until process is reaped") Fixes: eddd8aa99ca8 ("pwait: Add a SIGINFO handler") Fixes: 356d0b79cf6f ("rc.subr: Fix premature return from wait_for_pids")
* kqueue: Add NOTE_REAPDag-Erling Smørgrav2026-07-271-2/+8
| | | | | | | | | | | Add a NOTE_REAP event for EVFILTER_PROC which provides a notification when the process is reaped. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D58313
* procdesc: Disallow pddupfd() of non-passable filesMark Johnston2026-07-241-0/+6
| | | | | | | | Reported by: Maik Muench of Secfault Security Reviewed by: kib Fixes: 1ad21a652182 ("kern: add pddupfd(2)") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58403
* ptrace.2: document PT_GET_CHILDRENKonstantin Belousov2026-07-201-0/+55
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58315
* kqueue.2: document EVFILT_PROCDESC support for NOTE_FORKKonstantin Belousov2026-07-191-0/+35
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58292
* ptrace.2: Document PT_SET_SC_RETKonstantin Belousov2026-07-161-0/+20
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58247
* kqueue.2: document NOTE_PDSIGCHLDKonstantin Belousov2026-07-131-1/+9
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58123
* rename.2: Document AT_RENAME_EXCHANGEKonstantin Belousov2026-07-111-0/+6
| | | | | | | | | Reviewed by: mckusick Discussed with: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57658
* pdfork.2: grammarKonstantin Belousov2026-07-081-2/+2
| | | | | Submitted by: des MFC after: 1 week
* Regen.Konstantin Belousov2026-07-072-0/+4
|
* pdfork.2: document pddupfd()Konstantin Belousov2026-07-072-5/+55
| | | | | | | | Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57163
* libsys: export pddupfd(2)Konstantin Belousov2026-07-071-0/+1
| | | | | | | | Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57163
* pdfork.2: grammarKonstantin Belousov2026-07-071-1/+3
| | | | | Submitted by: des MFC after: 1 week
* RegenKonstantin Belousov2026-07-072-0/+4
|
* pdfork.2: document pdopenpid(2)Konstantin Belousov2026-07-072-0/+69
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57124
* pdfork.2: clarify that PD_DAEMON acts on current fileKonstantin Belousov2026-07-071-2/+8
| | | | | | | | | Also do not start a new list for each flag item. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D57124
* pdfork.2: document EINVAL for pdwait(2)Konstantin Belousov2026-07-071-0/+5
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57124
* libsys: export pdopenpid(2)Konstantin Belousov2026-07-071-0/+1
| | | | | | | | Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57124
* inotify.2: Fix formatting and lintMark Johnston2026-07-061-8/+8
| | | | MFC after: 1 week
* kern: add a security knob to disable unprivileged access to kenvKyle Evans2026-06-221-1/+6
| | | | | | | | | | | | | | | | | We sometimes store sensitive things in the kenv that get zapped, but we really shouldn't rely on that zapping to actually happen. Most unprivileged processes don't really need to read from the kernel environment in the first place, so add a knob that allows it to be disabled. Note that we consider jailed root to be unprivileged from this perspective; they have their own meta/env concepts and we should encourage users to take advantage of those for passing information to jails. "Hey we should do something about that": dch Reviewed by: imp, ziaee, zlei (all slightly previous version) Differential Revision: https://reviews.freebsd.org/D57697
* kqueue.2: knote is activated as the first action of tdsendsignal()Konstantin Belousov2026-06-221-1/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* adjtime(2): document that delta can be NULLKyle Evans2026-06-201-2/+12
| | | | | | | | The current verbiage somewhat indicates that always adjusts the time, which hasn't been true as far back as I had the energy to `git blame`. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D57676
* unix: implement basic SO_PASSRIGHTS functionalityKyle Evans2026-06-192-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With exception to sockopt functionality, implement the so_options flag in unix(4) itself. The general argument for the flag is that SCM_RIGHTS can be used maliciously for, e.g., a DoS that the receiving side can't avoid if it is expecting other control messages. This option gives the receiver a way to disable SCM_RIGHTS on the sender-side, surfacing an EPERM to them instead. This seems to match the semantics that Linux offers. If an SCM_RIGHTS was already sent before we disabled SO_PASSRIGHTS, then a subsequent recvmsg(2) will silently discard any in-flight files. This has the downside of punting a file with the potential to hang over to the deferred-close task, but perhaps usage of the option would discourage folks from attempting to take advantage of that possibility anyways. Various manpages updated to describe the new behavior. The ru_msgsnd accounting here might need to be re-evaluated: some error paths will increment it while others will not, and it isn't really clearly labelled. At some point in the operation enough work has been done that one could consider it enough resources to count, but it's not obvious that it should work this way. This change doesn't attempt to address that. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D57423
* uipc_usrreq: revert addition of EMPTYPATH for bindat(2)Konstantin Belousov2026-06-041-3/+1
| | | | | | | | | | | The caller wants the parent vnode, which cannot be provided for emptypath lookups. Reported and reviewed by: markj Fixes: 12c590a9abd7 ("bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets") Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57448
* open.2: document O_PATH behavior for bindat/connectatKonstantin Belousov2026-06-021-0/+6
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57370
* divert: Define semantics for SO_REUSEPORT_LB on divert socketsMark Johnston2026-05-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | Allow SO_REUSEPORT_LB to be set on divert sockets. If set, then bind() will add the socket to a "load-balancing group". When a divert-to rule matches a port with an associated group, the corresponding state ID is used to select a specific socket from the group. Packets without an associated state are simply forwarded to the first socket in the group. For now I only pass a state ID from pf, as I couldn't see a useful identifier on the ipfw side. This implementation is simple but has a caveat, that being that if sockets are added to the group while flows are being processed, the size of the group will change and this changes the mapping of state IDs to sockets. So, to get a consistent mapping, the divert socket application must bind all of its sockets before any traffic is diverted by the firewall. Reviewed by: glebius MFC after: 1 month Sponsored by: OPNsense Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D56563
* fcntl.2: clarify arg use for F_SETFDKonstantin Belousov2026-05-241-1/+3
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D57162
* clock_gettime.2: Fix a couple of typosJohn Baldwin2026-05-131-2/+2
| | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D56990
* dtrace: Document the syscall providerMateusz Piotrowski2026-05-071-2/+3
| | | | | MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56831
* fexecve(2): call out a scenario where you want !O_EXECKyle Evans2026-05-011-1/+12
| | | | | | | | | | | We note a reason why you might need it, but there's an equally important reason you may need to omit it: interpreted programs. Add a note accordingly, along with the workaround configuration if there's reason you can't help it. PR: 294780 Reviewed by: Jan Bramkamp <crest_freebsd_rlwinm.de>, kib Differential Revision: https://reviews.freebsd.org/D56704
* chroot.2: "filedescriptors" => "file descriptors"Olivier Certner2026-04-271-3/+3
| | | | | | | "filedescriptors" is the odd one out when looking at other manual pages. MFC after: 3 days Sponsored by: The FreeBSD Foundation
* pkru: Fix handling of 1GB largepage mappingsMark Johnston2026-04-211-0/+3
| | | | | | | | | | | | | | pmap_pkru_update_range() did not handle the case where a PDPE has PG_PS set. More generally, the SET_PKRU and CLEAR_PKRU sysarch implementations did not check whether the request covers a "boundary" vm map entry. Fix this, add the missing PG_PS test, and add some tests. Approved by: so Security: FreeBSD-SA-26:11.amd64 Security: CVE-2026-6386 Reported by: Nicholas Carlini <npc@anthropic.com> Reviewed by: kib, alc Differential Revision: https://reviews.freebsd.org/D56184
* membarrier.2: document MEMBARRIER_CMD_GET_REGISTRATIONSKonstantin Belousov2026-04-201-0/+6
| | | | | | | Reviewed by: markj, Ricardo Branco <rbranco@suse.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D56507