aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* libsysdecode: add Netlink attribute decoding infrastructureIshan Agrawal2026-07-241-2/+213
| | | | | | | | | | | | Introduce a generic Netlink attribute decoding framework based on attribute decoder tables. The framework supports decoding primitive attribute types as well as nested attributes and can be reused by different Generic Netlink families. Signed-off-by: Ishan Agrawal <iagrawal9990@gmail.com> Sponsored-by: Google LLC (GSoC 2026) Reviewed-by: kp Pull-Request: https://github.com/freebsd/freebsd-src/pull/2337
* unbound: Update to 1.25.2Dag-Erling Smørgrav2026-07-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Release notes at https://community.nlnetlabs.nl/t/unbound-1-25-2-released Merge commit 'c68e7bcd81d62e9f5364c6da22fd9917976acf85' Security: CVE-2026-14586 Security: CVE-2026-32665 Security: CVE-2026-40691 Security: CVE-2026-41637 Security: CVE-2026-42955 Security: CVE-2026-44621 Security: CVE-2026-44687 Security: CVE-2026-44690 Security: CVE-2026-46582 Security: CVE-2026-50045 Security: CVE-2026-50046 Security: CVE-2026-50243 Security: CVE-2026-50248 Security: CVE-2026-50251 Security: CVE-2026-50252 Security: CVE-2026-52863 Security: CVE-2026-54478 Security: CVE-2026-55708 Security: CVE-2026-55717 Security: CVE-2026-55973 Security: CVE-2026-55990 Security: CVE-2026-55991 Security: CVE-2026-56416 Security: CVE-2026-56444
* libsysdecode: Recognize NOTE_PDSIGCHLDDag-Erling Smørgrav2026-07-211-2/+2
| | | | | | | MFC after: 1 week Fixes: 2a5e58c59694 ("procdesc: add NOTE_PDSIGCHLD") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D58388
* hwpmc: Add EXTERROR diagnostics to the hwpmc syscall pathAndre Silva2026-07-211-0/+1
| | | | | | | | | | | | | Annotate validation failures in the PMC syscall handlers (allocate, attach, read/write) with EXTERROR(), so pmc(3) callers see which precondition failed, not a bare errno. Register HWPMC_MOD in exterr_cat.h and the generated filenames.h. Signed-off-by: Andre Silva <andasilv@amd.com> Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne Sponsored by: AMD Pull Request: https://github.com/freebsd/freebsd-src/pull/2180
* hwpmc: Add EXTERROR diagnostics to the AMD and IBS allocatorsAndre Silva2026-07-211-0/+1
| | | | | | | | | | | | Replace bare EINVAL in AMD/IBS allocation and config-validation with EXTERROR(), so a failed pmc(3) allocation names the check and value. Register HWPMC_AMD in exterr_cat.h and the generated filenames.h. Signed-off-by: Andre Silva <andasilv@amd.com> Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne Sponsored by: AMD Pull Request: https://github.com/freebsd/freebsd-src/pull/2180
* libutil: Reimplement getlocalbase()Dag-Erling Smørgrav2026-07-214-98/+206
| | | | | | | | | | | | | | | * Get rid of the pointless LOCALBASE_CTL_LEN mechanism * Apply minimal normalization to the paths obtained from the environment or sysctl variable * Turn the manual page into a manual page * Add tests MFC after: 1 week Reviewed by: se Differential Revision: https://reviews.freebsd.org/D58362
* 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
* libproc: link against libctf if MK_CTF != no instead of MK_CDDL != noEnji Cooper2026-07-161-1/+1
| | | | | | | | | | | | | | | Logic prior to this change would incorrectly try linking when MK_CDDL != no, instead of MK_CTF != no, which could result in the library and the tests being broken if/when MK_CTF == no and MK_CDDL != no (an uncommon, but possible combination with today's build knobs). This change updates the conditional to correctly track the value of MK_CTF, which in turn is properly toggled to no if/when MK_CDDL == no as it's a dependent build knob. This [niche] build bug has been present in FreeBSD since 2014. MFC after: 1 week
* libnetmap: fix extra indirection in nmreq_remove_optionGiuseppe Lettieri2026-07-131-1/+1
| | | | | | | Reviewed by: zlei, vmaffione Obtained from: https://github.com/luigirizzo/netmap/commit/7d9177ed9a121e66bf4eaa0acb5d574e408297da MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D58151
* libnetmap: fix error path in nmport_extmem_from_fileJose Luis Duran2026-07-131-1/+3
| | | | | | | Reviewed by: zlei, vmaffione Obtained from: https://github.com/luigirizzo/netmap/commit/b52a2bcae35e56548acfb0849b248a1e4b0c0c3b MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D58150
* libfetch: Reduce copyingDag-Erling Smørgrav2026-07-134-50/+61
| | | | | | | | Reduce the amount of copying we do when performing buffered reads. MFC after: 1 week Reviewed by: op Differential Revision: https://reviews.freebsd.org/D58113
* libfetch: Make fetch_ref an inlineDag-Erling Smørgrav2026-07-133-13/+13
| | | | | | | | Make fetch_ref() an inline and provide a fetch_deref(). MFC after: 1 week Reviewed by: op Differential Revision: https://reviews.freebsd.org/D57944
* libfetch: Document fetchTimeoutDag-Erling Smørgrav2026-07-131-2/+16
| | | | | | | | Document the global fetchTimeout variable, now that it works reliably. MFC after: 1 week Reviewed by: op Differential Revision: https://reviews.freebsd.org/D57910
* libfetch: Apply timeout to connection attemptsDag-Erling Smørgrav2026-07-131-6/+41
| | | | | | | | | Mark the socket non-blocking before connecting and poll for completion, applying fetchTimeout if set. MFC after: 1 week Reviewed by: op Differential Revision: https://reviews.freebsd.org/D57909
* libfetch: Add read bufferingDag-Erling Smørgrav2026-07-134-71/+118
| | | | | | | | | | | | | | | | | Previously, we would read FTP control connection messages and HTTP reponse headers one character at a time. Now, we read as much as will fit in our buffer and look for a newline. If there is data left over, it will be reused by the next fetch_getln() call. This also requires the addition of a fetch_bufread() which takes the buffer into account, otherwise the start of the HTTP response body will be stuck in the buffer after we read the last line of the header. This should noticeably improve HTTP performance, especially for small transfers. MFC after: 1 week Reviewed by: op Differential Revision: https://reviews.freebsd.org/D57907
* libfetch: Overhaul socket read / writeDag-Erling Smørgrav2026-07-132-83/+127
| | | | | | | | | | | | | | | | | | | | | | | | * Make fetch_ssl_read() and fetch_ssl_write() behave more like read(2) and write(2), and drop fetch_socket_read() in favor of read(2). * Don't request POLLERR, it's implied. * Don't needlessly set errno, it's relatively costly. * Always check for EAGAIN from writev(2), otherwise we will abort on a short write instead of proceeding to poll(2). * Always check for EAGAIN from poll(2) even though it can't happen on FreeBSD; POSIX says it can, and it might in the future. * Rewrite fetch_read() and fetch_writev() to be more similar to each other. The main difference is that a partial read is treated as success while a partial write is treated as failure. PR: 296316 MFC after: 1 week Reviewed by: op Differential Revision: https://reviews.freebsd.org/D57906
* 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
* Revert "chflags: Add a new UF_DONTCACHE flag"Rick Macklem2026-07-131-3/+1
| | | | | | | | This reverts commit 74654ba3b1b3bcf6ba8870a54310accbb6adbf0b. Apparently it breaks cross building from Linux for some reason. I'll admit I didn't even know we supported cross building from Linux.
* chflags: Add a new UF_DONTCACHE flagRick Macklem2026-07-121-1/+3
| | | | | | | | | | | | | | | | | | | This internet draft (which is close to being an RFC) specifies a new NFSv4.2 attribute which tells the NFSv4.2 client to not cache file data. (Similar to O_DIRECT, but triggered by this attribute set on the file on the NFSv4.2 server and not by the application's open(2).) https://datatracker.ietf.org/doc/draft-ietf-nfsv4-uncacheable-files/ This patch adds a new chflags(1) flag called UF_DONTCACHE to implement this. Patches for NFS and ZFS will be done separately. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D58181
* 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
* build: Retire LLVM_COV src.conf knobEd Maste2026-07-101-3/+2
| | | | | | | | | | | | | | I introduced it in commit 1b49115a40ad ("Promote llvm-cov to a standalone option"). llvm-cov was previously enabled as part of the CLANG_EXTRAS option. I made it a standalone, default-enabled option for parity with the tools provided by the GCC-based toolchain. We no longer provide an in-tree GCC toolchain. Now, just build llvm-cov along with Clang to simplify build infrastructure. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58155
* 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
* Retire dialogDag-Erling Smørgrav2026-07-0725-4968/+0
| | | | | | | | | | This is the last remaining piece of GPL software in the base system. The installer transitioned to bsddialog four years ago, and the last remaining dialog consumer, dpv, was turned off more than two years ago. Retire dpv, libdpv, libfigpar (used only by dpv), and dialog itself. Reviewed by: dteske Differential Revision: https://reviews.freebsd.org/D55424
* 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
* pf: revert netlink commands back to enumGleb Smirnoff2026-07-061-1/+1
| | | | | | | | Revert pf_nl.h part of 017690e50913 and use new libsysdecode build glue that parses enums. Reviewed by: kp, glebius Differential Revision: https://reviews.freebsd.org/D57866
* libsysdecode: Teach mktables to handle enumsDag-Erling Smørgrav2026-07-061-20/+39
| | | | | | | | While here, clean up and simplify the existing code. MFC after: 1 week Reviewed by: glebius, jhb Differential Revision: https://reviews.freebsd.org/D57993
* acl_from_text.c: Allow negative uid/gid numbers to be handledPeter Eriksson2026-07-061-9/+32
| | | | | | | | | | | | getfacl / acl_to_text() incorrectly prints uid/gid numbers as signed integers. This causes uid / gid numbers larger than 2G (2147483648) to print as negative numbers. The libc acl_from_text() function does not handle negative numbers. This diff adds a backwards compatiblity fix to allow negative numbers... Reviewed by: rmacklem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D57180
* libllvmminimal: Fix building with LLVM < 21 on riscv64Jessica Clarke2026-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | On most architectures we end up not needing ABIBreak.cpp as, although some of the sources here do reference EnableABIBreakingChecks (or, if assertions are disabled, DisableABIBreakingChecks) at a source level, we compile with -ffunction-sections and -fdata-sections, and link with --gc-sections, and it happens to be the case that all references can be GC'ed. However, prior to LLVM 21, the RISC-V backend did not apply -fdata-sections to .sdata, where references to these symbols end up, and for some files we're building with such references we end up not being able to GC .sdata due to the other unrelated data in it, meaning that we do in fact need to build ABIBreak.cpp. Whilst we could make this conditional on the architecture, it's a tiny file, and it's a bit fragile to rely on GC behaviour, so just include it unconditionally. Reviewed by: dim, emaste Fixes: 770cf0a5f02d ("Fixups after llvm-project main llvmorg-21-init-19288-gface93e724f4 merge") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D58044
* inotify.2: Fix formatting and lintMark Johnston2026-07-061-8/+8
| | | | MFC after: 1 week
* libc/resolv: Dead code and style cleanupDag-Erling Smørgrav2026-07-061-42/+17
| | | | | Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57928
* libc/resolv: Add no-debug and no-rotate optionsDag-Erling Smørgrav2026-07-061-0/+4
| | | | | | | These are simply the reverse of the debug and rotate options. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57926
* libc/resolv: Reimplement the sortlist parserDag-Erling Smørgrav2026-07-062-110/+137
| | | | | | | | | | | | | | | | | When we switched from the BIND4 resolver to the BIND9 resolver, the sortlist parser was inadvertently disabled due to a missing #define, and nobody seemed to notice. The sorting code remained enabled in the resolver, but there was no way to set a sort order. Reimplement the sortlist parser, but correctly, and update the manual accordingly. The new parser accepts IPv4 and IPv6 addresses with or without a mask or prefix length, just like the old one, except IPv6 support was a bit wonky in the original code. Fixes: 5342d17f09a8 ("Update the resolver in libc to BIND9's one.") Relnotes: yes Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57925
* libc/resolv: Refactor the configuration parserDag-Erling Smørgrav2026-07-061-267/+380
| | | | | | | | | | | | | | | | This was previously all a single loop in res_init(), apart from option parsing which we cleaned up in a previous commit. Break it out into separate functions for reading the configuration line by line, setting the default domain, setting the search list, and adding a nameserver to the nameserver list. Sprinkle bounds checks and code comments all around. The sortlist code, which has been disabled for the past 20 years, will be dealt with in a separate commit. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57924
* libc/resolv: Refactor the option parserDag-Erling Smørgrav2026-07-061-89/+105
| | | | | | | | | | | | | | | | | | | | | | | | Start the loop by finding the end of the option name, the name-value separator (if any), and the end of the option. Use those pointers to simplify matching the option name and parsing the option value, and validate option names and values more strictly. This means that: * We no longer accept trailing garbage in an option name or value. For instance, we would previously interpret “edns0123” as “edns0” and “timeout:3xyz” as “timeout:3”. This was actually quite lucky because we also failed to recognize the newline at the end of the option line as a whitespace character. * For options that take a numerical argument, we would previously accept negative values and treat non-numerical arguments as 0, while large numerical arguments would be capped to the option's maximum permitted value. Now, any failure to parse the argument, including overflow, results in the option being left unchanged. MFC after: 1 week Relnotes: yes Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57923
* libc/resolv: Drop Solaris 2 compatibilityDag-Erling Smørgrav2026-07-063-58/+0
| | | | | | MFC after: 1 week Reviewed by: kevans, markj Differential Revision: https://reviews.freebsd.org/D57922
* libsysdecode: decode PF Generic Netlink commandsIshan Agrawal2026-07-051-2/+27
| | | | | | | | | | Decode the Generic Netlink command header for messages belonging to the PF Generic Netlink family. Display the command name using the PF Generic Netlink command decoder. Signed-off-by: Ishan Agrawal <iagrawal9990@gmail.com> Reviewed by: kp Sponsored-by: Google LLC (GSoC 2026)
* libsysdecode: cache Generic Netlink family IDsIshan Agrawal2026-07-051-0/+32
| | | | | | | | | | | Record Generic Netlink family IDs learned from CTRL_CMD_GETFAMILY responses and use them to decode subsequent Generic Netlink messages using symbolic family names instead of numeric IDs. Signed-off-by: Ishan Agrawal <iagrawal9990@gmail.com> Reviewed by: kp Sponsored-by: Google LLC (GSoC 2026)
* libsysdecode: decode Generic Netlink controller messagesIshan Agrawal2026-07-051-10/+60
| | | | | | | | | | | Decode Generic Netlink controller (GENL_ID_CTRL) messages in Netlink payloads. Display the Generic Netlink header along with the CTRL_CMD_GETFAMILY attributes, including the family ID and family name. Signed-off-by: Ishan Agrawal <iagrawal9990@gmail.com> Reviewed by: kp Sponsored-by: Google LLC (GSoC 2026)
* truss: track Netlink socket protocolsIshan Agrawal2026-07-052-2/+3
| | | | | | | | | | | | | Record the Netlink protocol associated with AF_NETLINK sockets when they are created and pass it to libsysdecode during message decoding. Use the protocol to distinguish between Generic Netlink and Route Netlink sockets, ensuring that Generic Netlink decoding is only performed for NETLINK_GENERIC sockets. Signed-off-by: Ishan Agrawal <iagrawal9990@gmail.com> Reviewed by: kp Sponsored-by : Google LLC (GSoC 2026)
* libc locale/localeconv.c: use release semantic when clearing locale_changedKonstantin Belousov2026-07-051-2/+2
| | | | | | PR: 296410 Submitted by: Tomas Vondra <tomas@vondra.me> MFC after: 1 week