FreeBSD/src 38dd686sys/kern kern_jaildesc.c

jaildesc: Publish the new fd only after the jaildesc is initialized

jaildesc_alloc() finishes initializing the file structure only after it
is made visible from the file descriptor table via finit().  In that
window, other threads could try to perform operations on the descriptor
and thus access an incompletely initialized jaildesc.

Defer the finit() call until locks are initialized.  While here,
simplify the error path for falloc_caps().

Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
                and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
Reviewed by:    jamie
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58049
DeltaFile
+4-6sys/kern/kern_jaildesc.c
+4-61 files

FreeBSD/src 92dfe30lib/libsys inotify.2

inotify.2: Fix formatting and lint

MFC after:      1 week
DeltaFile
+8-8lib/libsys/inotify.2
+8-81 files

FreeBSD/src b70997csys/kern vfs_inotify.c, tests/sys/kern inotify_test.c

inotify: Unconditionally generate IN_IGNORED events for files/dirs

The implementation previously only generated an IN_IGNORED event for a
deleted watched file if the watch explicitly requested IN_DELETE_SELF.
This is not correct, IN_IGNORED should always be raised when the watched
subject is deleted.  Adjust the implementation of inotify_log_one()
accordingly.

This also fixes a problem where a deleted watched file's watch
would not be removed if IN_DELETE_SELF was not in the watch's event
mask, in which case the unlinked vnode would linger until the inotify
descriptor itself is closed.

Add a regression test.

Reported by:    jrtc27
Reviewed by:    jrtc27
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D58050
DeltaFile
+23-12sys/kern/vfs_inotify.c
+24-0tests/sys/kern/inotify_test.c
+47-122 files

FreeBSD/src 4805b88lib/libc/resolv res_init.c

libc/resolv: Dead code and style cleanup

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57928
DeltaFile
+17-42lib/libc/resolv/res_init.c
+17-421 files

FreeBSD/src 3f15998include resolv.h

resolv.h: Remove unused parts

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57927
DeltaFile
+0-49include/resolv.h
+0-491 files

FreeBSD/src 60827d7lib/libc/resolv res_init.c, share/man/man5 resolver.5

libc/resolv: Add no-debug and no-rotate options

These are simply the reverse of the debug and rotate options.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57926
DeltaFile
+12-0share/man/man5/resolver.5
+4-0lib/libc/resolv/res_init.c
+16-02 files

FreeBSD/src fbe0257lib/libc/resolv res_init.c Makefile.inc, share/man/man5 resolver.5

libc/resolv: Reimplement the sortlist parser

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
DeltaFile
+136-110lib/libc/resolv/res_init.c
+23-13share/man/man5/resolver.5
+1-0lib/libc/resolv/Makefile.inc
+160-1233 files

FreeBSD/src ffeb569lib/libc/resolv res_init.c

libc/resolv: Refactor the configuration parser

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
DeltaFile
+381-268lib/libc/resolv/res_init.c
+381-2681 files

FreeBSD/src 9bfdfeclib/libc/resolv res_init.c

libc/resolv: Refactor the option parser

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.


    [4 lines not shown]
DeltaFile
+106-90lib/libc/resolv/res_init.c
+106-901 files

FreeBSD/src aba9ffflib/libc/nameser ns_parse.c, lib/libc/resolv res_init.c res_comp.c

libc/resolv: Drop Solaris 2 compatibility

MFC after:      1 week
Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D57922
DeltaFile
+0-42lib/libc/resolv/res_init.c
+0-11lib/libc/resolv/res_comp.c
+0-5lib/libc/nameser/ns_parse.c
+0-583 files

FreeBSD/src 4319e4bshare/man/man5 resolver.5

resolver(5): Overhaul

* Modernize the markup

* Describe the comment syntax

* Drop obsolete advice

* Capitalize sentences

* Improve the language

* Replace no_tld_query with no-tld-query; both are supported, but all the
  other multi-word options use hyphens rather than underscores.

* Add missing ENVIRONMENT section

* Redo the example


    [3 lines not shown]
DeltaFile
+116-111share/man/man5/resolver.5
+116-1111 files

FreeBSD/src 24576c3sys/dev/sound/pcm dsp.c channel.c

sound: track kqueue low watermark per-knote for mmaped channels

Use kn->kn_sdata to track the last bs->total value for each knote
attached to an mmaped channel. An event is delivered only when the total
byte counter has advanced by at least c->lw since the last delivery.
After delivery kn_sdata is updated to the current total.

Each knote tracks its own watermark independently, so multiple knotes
attached to the same mmaped channel all receive events correctly.

Non-mmap channels keep the existing level-triggered behavior via
chn_polltrigger().

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57833
DeltaFile
+13-1sys/dev/sound/pcm/dsp.c
+9-5sys/dev/sound/pcm/channel.c
+1-1sys/dev/sound/pcm/channel.h
+23-73 files

FreeBSD/src b125b73sys/ofed/drivers/infiniband/core ib_sysfs.c

ibcore: Fix GID sysctl fallback formatting

When a GID table entry is empty or not yet present in the cache,
show_port_gid() falls back to printing a zero GID.  Use the existing
GID_PRINT_FMT/GID_PRINT_ARGS helpers instead of Linux's %pI6 format,
which FreeBSD printf treats as a pointer followed by "I6".
This makes empty GID sysctl entries consistently report
0000:0000:0000:0000:0000:0000:0000:0000.

Tested by:      Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Reviewed by:    jhb, kib
Sponsored by:   NVIDIA Networking
Fixes:  6a75471dbcf0 ("OFED: Various changes from Linux 4.19")
Differential Revision:  https://reviews.freebsd.org/D58042
DeltaFile
+1-1sys/ofed/drivers/infiniband/core/ib_sysfs.c
+1-11 files

FreeBSD/src 806f0b4sys/dev/bnxt/bnxt_en if_bnxt.c

bnxt: Report actual link speed, rather than hard-coded 100Gbs

(cherry picked from commit fdca6b70aa7ebbc95b544cec6e155ea5b1041899)
DeltaFile
+1-1sys/dev/bnxt/bnxt_en/if_bnxt.c
+1-11 files

FreeBSD/src 0dc46fbsys/net ieee8023ad_lacp.c

lacp: Simplify lacp_compose_key()

(cherry picked from commit e98ed8d99fd41873dc52cf78e70e9f12e3e93042)
DeltaFile
+40-133sys/net/ieee8023ad_lacp.c
+40-1331 files

FreeBSD/src 020f7f6sys/net ieee8023ad_lacp.c

lacp: fix link state with multiple aggregators

(cherry picked from commit 9f69446d45484c16d2b9b9bf71bbb2fca86cb6e5)
DeltaFile
+6-2sys/net/ieee8023ad_lacp.c
+6-21 files

FreeBSD/src b86eb36sys/net ieee8023ad_lacp.c

lacp: Sort port map by interface index

(cherry picked from commit 7ff3b13f12d97b7f67f09ecb9141e6dbaa1ad007)
DeltaFile
+25-1sys/net/ieee8023ad_lacp.c
+25-11 files

FreeBSD/src 60bb6c3sys/dev/mlx5/mlx5_en mlx5_en_main.c

mlx5en: guard against empty eth_proto_oper mask

(cherry picked from commit 17cf7760a98a87c33d0415e2d2e1d4b24dd69e4d)
DeltaFile
+7-0sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+7-01 files

FreeBSD/src d479355sys/dev/mlx5/mlx5_core mlx5_port.c

mlx5: Add missing speeds translation

(cherry picked from commit 49b78368c5ed9cf41dedfc1c02a597fd49468537)
DeltaFile
+3-0sys/dev/mlx5/mlx5_core/mlx5_port.c
+3-01 files

FreeBSD/src 2bdcf05contrib/ofed/libmlx5 mlx5.c, sys/dev/mlx5/mlx5_core mlx5_main.c

libmlx5: sync PCI device allowlist with mlx5_core_pci_table

(cherry picked from commit 0e2175cef5027728c0ca1ff98366cf6ecfbe2db3)
DeltaFile
+19-0contrib/ofed/libmlx5/mlx5.c
+4-0sys/dev/mlx5/mlx5_core/mlx5_main.c
+23-02 files

FreeBSD/src 69a8bf9contrib/ofed/libmlx5 mlx5.c, sys/dev/mlx5/mlx5_core mlx5_main.c

mlx5: Add PCI IDs for ConnectX-9.

(cherry picked from commit 741f489ed09ab1d9172d1f61aa341004b5c3e968)
DeltaFile
+1-1sys/dev/mlx5/mlx5_core/mlx5_main.c
+1-0contrib/ofed/libmlx5/mlx5.c
+2-12 files

FreeBSD/src 3ab9e20sys/dev/mlx5 port.h, sys/dev/mlx5/mlx5_core mlx5_port.c

mlx5: Add support for 800Gbit/s and 400Gbit/s with 2 lanes

(cherry picked from commit 3e4cbdebfc9bcb2f2c64acc8ee8f67c3383cd676)
DeltaFile
+44-0sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+12-0sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+4-0sys/dev/mlx5/mlx5_core/mlx5_port.c
+3-0sys/dev/mlx5/port.h
+63-04 files

FreeBSD/src 05bd1cesys/ofed/drivers/infiniband/core ib_sysfs.c, sys/ofed/include/rdma ib_verbs.h

ibcore: Add support for XDR link speed.

(cherry picked from commit b3c09af215ee4803fa67ca94301f662d5eca03a0)
DeltaFile
+4-0sys/ofed/drivers/infiniband/core/ib_sysfs.c
+2-1sys/ofed/include/rdma/ib_verbs.h
+6-12 files

FreeBSD/src 5d044e4sys/dev/bnxt/bnxt_re ib_verbs.c, sys/dev/mlx5/mlx5_ib mlx5_ib_main.c

RDMA: Fix link active_speed size

(cherry picked from commit e5d8b775bbf6f378a591211e373859ec44f74149)
DeltaFile
+3-3sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+3-2sys/dev/bnxt/bnxt_re/ib_verbs.c
+2-1sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c
+1-1sys/dev/qlnx/qlnxr/qlnxr_verbs.c
+1-1sys/ofed/include/rdma/ib_verbs.h
+10-85 files

FreeBSD/src f71aaa2sys/net if_media.h ieee8023ad_lacp.c

net/if_media.h: Add 800GBase-X and 200Gbit/s per lane support

(cherry picked from commit 51f313dbc7a28a7bd2013c205261f29f115eb0a7)
DeltaFile
+42-0sys/net/if_media.h
+3-0sys/net/ieee8023ad_lacp.c
+45-02 files

FreeBSD/src d1f7902sys/sys systm.h

sys/systm.h: include sys/limits.h for SSIZE_MAX

PR:     296489

(cherry picked from commit bcb471cfb499f61d98abdc7bfd48bee0e229b02b)
DeltaFile
+1-0sys/sys/systm.h
+1-01 files

FreeBSD/src 5ed7b34sys/x86/include specialreg.h, sys/x86/x86 identcpu.c

x86: add CPUID bits for SHA512/SM3/SM4

(cherry picked from commit cf851111b02fae7425f9642460762d644983fdca)
DeltaFile
+3-0sys/x86/include/specialreg.h
+3-0sys/x86/x86/identcpu.c
+6-02 files

FreeBSD/src 10ed74blib/libc/gen posix_spawn.c

posix_spawn(3): create a guard page below the stack for rfork_thread on x86

(cherry picked from commit 2767a1f3686e5b1657ff4c3d57737c7f21598125)
DeltaFile
+18-29lib/libc/gen/posix_spawn.c
+18-291 files

FreeBSD/src b9ff22flib/libc/gen posix_spawn.c

do_posix_spawn(): use bool

(cherry picked from commit b516c234d0e4ccd69ca1f3d3a8bb80eed3f0a87c)
DeltaFile
+3-3lib/libc/gen/posix_spawn.c
+3-31 files

FreeBSD/src b3ce127libexec/rtld-elf map_object.c

rtld: unify the return path for map_object()

(cherry picked from commit 70fb92cd56bfe88a12d2a253542320bad7198321)
DeltaFile
+4-6libexec/rtld-elf/map_object.c
+4-61 files