FreeBSD/src c485a0blib/msun/man math.3

man/math.3: mention fmaximum_mag_num, fminimum_mag_num

PR:             294719
MFC after:      1 month

(cherry picked from commit 9f98195ff615417f7af875b65cdaf220239206db)
DeltaFile
+5-3lib/msun/man/math.3
+5-31 files

FreeBSD/src f8a72f4lib/msun/src s_fmaximum_num.c s_fmaximum_numf.c

lib/msun: Replaced pattern to force exception in _num families

Replaced the old pattern of using a ternary to force addition
(raising exceptions for sNaN's) with a new one using a volatile
variable. The _mag_num family was already implemented with this pattern

PR:             294719
Reviewed by:    fuz, kargl
MFC after:      1 month

(cherry picked from commit 7c20e15592a07ea457cacb0d6706948815c8420e)
DeltaFile
+10-4lib/msun/src/s_fmaximum_num.c
+10-4lib/msun/src/s_fmaximum_numf.c
+10-4lib/msun/src/s_fmaximum_numl.c
+10-4lib/msun/src/s_fminimum_num.c
+10-4lib/msun/src/s_fminimum_numl.c
+10-4lib/msun/src/s_fminimum_numf.c
+60-246 files

FreeBSD/src 9bba4a2lib/msun/man fmaximum_mag_num.3, lib/msun/src s_fminimum_mag_num.c s_fmaximum_mag_num.c

lib/msun: fmaximum_mag_num family. Tests and man page

Added the fmaximum_mag_num{,f,l} and fminimum_mag_num{,f,l} functions.

PR:             294719
Reviewed by:    fuz, kargl
MFC after:      1 month

(cherry picked from commit f62d826a6f5b9022b0cedfe22a698998ad9cb7f4)
DeltaFile
+109-0lib/msun/man/fmaximum_mag_num.3
+90-0lib/msun/src/s_fminimum_mag_num.c
+88-0lib/msun/src/s_fmaximum_mag_num.c
+85-0lib/msun/src/s_fminimum_mag_numf.c
+84-0lib/msun/src/s_fmaximum_mag_numf.c
+79-0lib/msun/src/s_fminimum_mag_numl.c
+535-06 files not shown
+677-1912 files

FreeBSD/src f77d37csys/compat/linux linux_file.c

linuxulator: Return EINVAL for invalid inotify flags

We implement all of the currently-defined Linux inotify mask bits and
flags, with the same values as Linux.  Return EINVAL for unknown bits,
as Linux does.

This also moves the translation inline into linux_inotify_add_watch.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57387
DeltaFile
+6-12sys/compat/linux/linux_file.c
+6-121 files

FreeBSD/src 68004e5sys/net if.c if_private.h

net: Fix handling of unmapped user pages in if_getgroup()

We cannot call copyout() while in a net epoch section, unless the user
memory is wired.  Use the global ifnet lock to synchronize the accesses
instead.

Reported by:    emaste
Reviewed by:    zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57154
DeltaFile
+23-33sys/net/if.c
+1-1sys/net/if_private.h
+24-342 files

FreeBSD/src 49d90d9sys/net if_lagg.c

lagg: Handle a port count of zero

The sc_count check in lagg_transmit_ethernet() and
lagg_transmit_infiniband() is racy, as the lagg protocol handlers are
only synchronized by net_epoch.  Handle a count of 0 in each protocol
handler where it's needed, namely in the RR and LB handlers.

Reported by:    Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:    pouria, zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56942
DeltaFile
+23-17sys/net/if_lagg.c
+23-171 files

FreeBSD/src 369207ausr.sbin/virtual_oss/virtual_oss virtual_oss.c

virtual_oss(8): Fix buffer overflow in voss_compressor() call

This particular calls swaps the samples and maxchan arguments, which can
cause a buffer overflow in p_ch_chain if maxchan exceeds its bounds
(VMAX_CHAN).

Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste

(cherry picked from commit 453de99b386d40754a038cc4b804f4c7a3b04624)
DeltaFile
+2-2usr.sbin/virtual_oss/virtual_oss/virtual_oss.c
+2-21 files

FreeBSD/src 8632639contrib/llvm-project/clang/lib/Serialization ASTReaderDecl.cpp

Merge commit 63c29df8eceb from llvm git (by Dmitry Polukhin):

  [Serialization] Fix assertion on re-deserialized friend template spec… (#200566)

  …ialization in PCH (#198133)

  A friend function-template specialization declared inside a class
  template is serialized into a PCH. When the class template is later
  instantiated while loading the PCH, the friend specialization can be
  deserialized re-entrantly (VisitFriendDecl -> VisitFunctionDecl -> ...
  -> VisitFunctionDecl for the same specialization) at the same time as
  the canonical copy, producing two redeclarations of the same
  specialization in the template's specialization set.

  ASTDeclReader::VisitFunctionDecl asserted that this collision could only
  happen when merging declarations from different modules. Since
  38b3d87bd384, friend functions defined inside dependent class templates
  are loaded eagerly, so the collision can now also occur within a single
  PCH/AST file (non-modules build), tripping the assertion:

    [16 lines not shown]
DeltaFile
+0-2contrib/llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp
+0-21 files

FreeBSD/src 606d3cbsys/amd64/amd64 machdep.c

amd64: do not switch back and restore UEFI IDT in wrmsr_early_safe_end()

The memory where the pre-OS IDT was located might be already consumed by
kernel.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57321
DeltaFile
+0-8sys/amd64/amd64/machdep.c
+0-81 files

FreeBSD/src 16f21c5sys/x86/x86 ucode.c

amd64: there is no reason to copy ucode around in ucode_load_bsp()

PR:     294630
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differrential revision: https://reviews.freebsd.org/D57368
DeltaFile
+9-11sys/x86/x86/ucode.c
+9-111 files

FreeBSD/src 72e34b3sys/kern kern_resource.c

get/setpriority: Add capability mode checks

Reviewed by: oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57345
DeltaFile
+16-0sys/kern/kern_resource.c
+16-01 files

FreeBSD/src 79d0dbcsys/security/mac_do mac_do.c, tests/sys/mac/do invalid_configs.sh

MAC/do: Fix double-free on parse error after "executable paths" feature

parse_rules() has been calling toast_rules() in case of a parse error in
order to deallocate the 'struct rule' objects it has constructed up to
that point.

toast_rules() would take a pointer to a full 'struct rules' object, and
besides freeing all 'struct rule' referenced by it, would also free the
holding 'struct rules' itself.

With the introduction of the "executable paths" feature, and the
embedding of 'struct rules' into 'struct conf', meaning that the
lifecycle for 'struct rules' was no longer independent, toast_rules()
was changed not to free the passed 'struct rules' (as it was a field of
a 'struct conf' object).  Unfortunately, this change was not completed
with a reinitialization of the rules list head, so the 'struct conf'
object would continue to reference just-freed rules, which then would be
freed a second time on destruction of that container.


    [16 lines not shown]
DeltaFile
+8-8sys/security/mac_do/mac_do.c
+14-0tests/sys/mac/do/invalid_configs.sh
+22-82 files

FreeBSD/src 84dd0accontrib/dma conf.c dma.conf

dma: support relaying to an LMTP endpoint

Approved by:            bapt
Differential Revision:  https://reviews.freebsd.org/D55627
Upstream:               https://github.com/corecode/dma/pull/152
DeltaFile
+7-0contrib/dma/conf.c
+3-0contrib/dma/dma.conf
+1-1contrib/dma/net.c
+1-0contrib/dma/dma.h
+12-14 files

FreeBSD/src dfd2273bin/sh miscbltin.c

sh: Fix pipebuf limit

Since the factor is not 1, we need to provide a unit.

MFC after:      1 week
Fixes:          5d92f20c7d31 ("bin/sh: support RLIMIT_PIPEBUF")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57352
DeltaFile
+1-1bin/sh/miscbltin.c
+1-11 files

FreeBSD/src 4ccbceesys/dev/intel spi_pci.c

spi: Remove incorrect pci id

This id is for SPI flash instead of spi bus

Fixes: 39e297bf54a5 ("ig4iic: Add PantherLake IDs")
MFC after:      2 weeks
Sponsored by:  The FreeBSD Foundation
Sponsored by:  Framework Computer Inc
DeltaFile
+0-1sys/dev/intel/spi_pci.c
+0-11 files

FreeBSD/src 1876f62share/man/man9 style.9

style.9: Fix a typo (missing word)

Fixes:          af2c7d9f6452 ("style.9: Encourage style changes when doing significant modifications")
MFC after:      1 day
Sponsored by:   The FreeBSD Foundation
DeltaFile
+3-3share/man/man9/style.9
+3-31 files

FreeBSD/src f983cb3sys/fs/msdosfs msdosfs_conv.c direntry.h

fs/msdosfs: add support for file namws with surrogate pairs

Long file names are using UTF-16 symbols to represent international or
special characters. The implementation in FreeBSD did not support the
"Supplementary Private Use Area-B" (PUA-B), which requires a surrogate
pair to be represented in UTF-16 (Unicode code points beyond U+FFFF).

The PUA-B is used to represent emoji characters, which are supported
in file names on other common operating systems. The motivation for
this change was that removable media written on another system were
only partially readable on FreeBSD, since they contained emojis in
file names.

A test script that verifies correct operations on files names with
emojis has been added to the tools/test/stress2/misc directory under
the name msdos24.sh.

Reported by:    Fabian Keil <fk at fabiankeil.de>
Reviewed by:    ib

    [4 lines not shown]
DeltaFile
+130-34sys/fs/msdosfs/msdosfs_conv.c
+5-4sys/fs/msdosfs/direntry.h
+4-3sys/fs/msdosfs/msdosfs_lookup.c
+139-413 files

FreeBSD/src 39e297bsys/dev/ichiic ig4_pci.c, sys/dev/ichsmb ichsmb_pci.c

ig4iic: Add PantherLake IDs

MFC after:      2 weeks
Sponsored by:   Framework Computer Inc
Signed-off-by: Daniel Schaefer <dhs at frame.work>
DeltaFile
+12-0sys/dev/ichiic/ig4_pci.c
+4-0sys/dev/ichsmb/ichsmb_pci.c
+1-0sys/dev/intel/spi_pci.c
+17-03 files

FreeBSD/src a1d7837stand/efi/loader main.c

stand: Revert the EFI loader back to strict mode

The change to relaxed mode has had too many unintended breakages. Revert
back to strict mode until that works for all the cases that are
currently broken.

Fixes: 784150fd2535, d69fc3a9dc71
PR:  295289
Sponsored by: Netflix
DeltaFile
+1-1stand/efi/loader/main.c
+1-11 files

FreeBSD/src 0e3c9cbusr.sbin/bsdinstall/scripts script

bsdinstall: script: Fix scripted DISTRIBUTIONS

Restore exporting DISTRIBUTIONS to make it available to other scripts.

Reviewed by:    imp, asomers
Fixes:          dc14ae4217a0 ("bsdinstall: do pkgbase installations with the "script" command")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57319

(cherry picked from commit 283959bbe0863917c4fc3200a92d1055a4c89bdc)
DeltaFile
+1-0usr.sbin/bsdinstall/scripts/script
+1-01 files

FreeBSD/src 439710cinclude assert.h

assert.h: Revert "Remove leading tabs for whitespace consistency"

This reverts commit 157c184689ea3d7b8b6bd89aff849e94f004aa0e.

As per style(9), a tab goes after #define.  This should not have been
removed.

Reported by:    kib
Fixes:          157c184689ea3d7b8b6bd89aff849e94f004aa0e.
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+13-13include/assert.h
+13-131 files

FreeBSD/src 963a92dstand/man loader.efi.8, sys/amd64/amd64 machdep.c

amd64: explain in more details why the slop is needed

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+7-0sys/amd64/amd64/machdep.c
+3-0stand/man/loader.efi.8
+10-02 files

FreeBSD/src 03c69ddsys/dev/hwpmc hwpmc_intel.c, sys/sys pmc.h

pmc: add sapphire rapids model

This commit adds the sapphire rapids CPU model to hwpmc_intel.c,
allowing hwpmc to be used on this CPU family.

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D57263
DeltaFile
+4-0sys/dev/hwpmc/hwpmc_intel.c
+1-0sys/sys/pmc.h
+5-02 files

FreeBSD/src 510ee66sys/dev/ntsync linux_ntsync.c linux_ntsync.h, sys/modules Makefile

linux_ntsync: linux compat shim for ntsync(9)

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
DeltaFile
+302-0sys/dev/ntsync/linux_ntsync.c
+62-0sys/dev/ntsync/linux_ntsync.h
+6-0sys/modules/linux_ntsync/Makefile
+1-0sys/modules/Makefile
+371-04 files

FreeBSD/src d0ea3afsys/dev/ntsync ntsync.c, sys/sys user.h

ntsync: add kinfo reporting

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
DeltaFile
+44-3sys/dev/ntsync/ntsync.c
+24-0sys/sys/user.h
+68-32 files

FreeBSD/src 0ac9aacetc/mtree BSD.include.dist, include Makefile

ntsync: install headers for userspace consumption

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
DeltaFile
+1-1include/Makefile
+2-0etc/mtree/BSD.include.dist
+3-12 files

FreeBSD/src 03ca6dbsys/dev/ntsync ntsync.c ntsyncvar.h, sys/modules Makefile

ntsync(4)

The driver implements the ntsync interface as specified in the Linux
7.0-rc3 document Documentation/userspace-api/ntsync.rst.  Only the
documentation and the userspace tests (Linux'
tools/testing/selftests/drivers/ntsync/ntsync.c) were used for
reference.  When the documentation contradicted the tests, tests
behavior was implemented.

One quirk is that Linux API needs to return an error from ioctl() and to
copyout the modified ioctl() argument.  Our generic ioctl() is not flexible
enough to implement this, so the ntsync_ioctl_copyout() hack allows to
copyout the ioctl parameter directly from the ioctl method, instead of
relying on the ioctl infra.

The FreeBSD port of the tests, that can be compiled both on FreeBSD and
Linux, is available at https://github.com/kostikbel/freebsd-ntsync-test.
The Linux binary compiled with the Linux test harness, cannot be run
under linuxolator due to unimplemented syscalls, but the shims in

    [6 lines not shown]
DeltaFile
+1,379-0sys/dev/ntsync/ntsync.c
+119-0sys/dev/ntsync/ntsyncvar.h
+66-0sys/dev/ntsync/ntsync.h
+6-0sys/modules/ntsync/Makefile
+1-0sys/modules/Makefile
+1-0sys/sys/file.h
+1,572-06 files

FreeBSD/src aef014dsys/contrib/edk2/Include Base.h

Revert "edk2: enable static asserts for *INT64 alignment"

This fails when using WITH_BEARSSL. It seems like we build the EFI bits
of libsecureboot (which is really just part of libsa in this case), even
when building the BIOS loader. Revert for now to unbreak the build.

This reverts commit 2fa4bdd7f9e99698a6652db405c3165fdcd41c1d.

Reported by: freebsd at walstatt-de.de
DeltaFile
+2-0sys/contrib/edk2/Include/Base.h
+2-01 files

FreeBSD/src 23996d9stand/efi Makefile

stand/efi/Makefile: fix build order

Move liblua32efi and ficl32efi before .WAIT, otherwise there's a race
between the interpreter and the loader being built.

Reported by:    kbowling
Discussed with: kevans
Fixes:          d15cc7625dde9bcb6a63ee59cccf14f3b93b15bf
DeltaFile
+4-3stand/efi/Makefile
+4-31 files

FreeBSD/src 8809ea4sys/dev/usb/input ukbd.c

ukbd: fix SET_REPORT wValue always using report ID 0 for LED output

ukbd_set_leds_callback() built the SET_REPORT control request with
USETW2(req.wValue, UHID_OUTPUT_REPORT, 0) before the loop that
determines the actual HID report ID from sc_id_numlock,
sc_id_scrolllock, or sc_id_capslock.  The data payload was already
correctly prefixed with the real report ID when id != 0, but the
control request's wValue told the device to set report ID 0, which
does not exist on devices that use non-zero report IDs for LED output.

Apple Internal Keyboard / Trackpad (0x05ac:0x0274) uses report ID 1
for LED output.  The mismatch caused the device to STALL every
SET_REPORT request, so the capslock LED could never be updated.

Move the USETW2 call to after the LED-detection loop so that wValue
carries the correct report ID.

Signed-off-by:  Joshua Rogers <Joshua at Joshua.Hu>
Reviewed by:    wulf

    [2 lines not shown]
DeltaFile
+8-8sys/dev/usb/input/ukbd.c
+8-81 files