FreeBSD/src 25024d9 — sbin/nvmecontrol format.c

sbin/nvmecontrol: fix signedness comparison warning

sector_size is guaranteed to be non-zero here, so cast to
uint32_t to match the comparison.

This fixes the [gcc14 build in CI][0]:

/workspace/src/sbin/nvmecontrol/format.c: In function 'find_lbaf':
/workspace/src/sbin/nvmecontrol/format.c:132:60: error: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Werror=sign-compare]
  132 |                 if (NVMEV(NVME_NS_DATA_LBAF_LBADS, format) != lbads ||
      |                                                            ^~

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/5051/

Reviewed by:    imp
Fixes:          b991e2dd824c ("nvmecontrol: support controller-wide sector sizes")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
DeltaFile
+3-3sbin/nvmecontrol/format.c
+3-31 files

FreeBSD/src 9b6b3a3 — sys/dev/ocs_fc ocs_ioctl.c

ocf_fc: Fix up max() usage

max() truncates its parameters to 32-bit integers.

Reviewed by:    ram
Sponsored by:   The FreeBSD Foundation
Fixes:          26081296b244 ("ocs_fc: Harden ioctl, XRI lookup and FCP command validation")
DeltaFile
+1-1sys/dev/ocs_fc/ocs_ioctl.c
+1-11 files

FreeBSD/src ca16e7a — sys/kern kern_malloc.c

malloc: Fix realloc() for large allocations

min() truncates its parameters.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-2sys/kern/kern_malloc.c
+2-21 files

FreeBSD/src c525db0 — sys/vm vm_glue.c vm_extern.h

vm_glue: Use the right type for size arguments to {user,kern}acc()

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-2sys/vm/vm_glue.c
+2-2sys/vm/vm_extern.h
+4-42 files

FreeBSD/src c6b08de — sys/netpfil/ipfw ip_fw_table_algo.c

ipfw: fix off-by-one error in bdel()

After deleting an item from a sorted array, bdel() moves the tail
following it, but the size of the data to move was calculated with
an off-by-one error, causing memmove() to read one element past the
end of the array. This can happen when the table is full for ifidx
or numarray algorithms.

Obtained from:  Yandex LLC
MFC after:      1 week
Sponsored by:   Yandex LLC
DeltaFile
+1-1sys/netpfil/ipfw/ip_fw_table_algo.c
+1-11 files

FreeBSD/src c9dbbe3 — libexec/rc rc.conf

Mark network_interfaces as deprecated
DeltaFile
+1-1libexec/rc/rc.conf
+1-11 files

FreeBSD/src dca2ad4 — libexec/rc/rc.d hostid

All Jetway NF541 seem to have the same UUID
DeltaFile
+2-0libexec/rc/rc.d/hostid
+2-01 files

FreeBSD/src 1be967a — sys/conf newvers.sh

newvers.sh: Report -dirty also with staged changes

We add -dirty to the uname version string if the tree does not match the
reported hash. Previously, staged but uncommitted changes were ignored.
Noted by naddy@ in D60606.

Reviewed by:    cperciva, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60722

(cherry picked from commit 617c700abae7aba74777fca137458395936f5053)
DeltaFile
+1-1sys/conf/newvers.sh
+1-11 files

FreeBSD/src 00a6cf0 — usr.bin/mkimg mkimg.c

mkimg: Ignore redundant %align values

Partitions are trivially aligned to sector boundaries, so asking e.g.
for a partition to be aligned to a 64-byte boundary is pointless but
harmless.  Treat it as such, with a warning (in case the request was
a mistake, e.g. requesting 1-byte instead of 1M-byte alignment) rather
than as an error.

Reviewed by:    markj
Suggested by:   markj
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60819

(cherry picked from commit da04cf02c96b97c587580b336fa527392467f689)
DeltaFile
+9-1usr.bin/mkimg/mkimg.c
+9-11 files

FreeBSD/src f3e20af — . Makefile.inc1, sys/sys param.h

__FreeBSD_version: Bump for mkimg %align feature

MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60453

(cherry picked from commit 0f787e867d217583017181d1a904933939b4c34d)
DeltaFile
+3-3Makefile.inc1
+1-1sys/sys/param.h
+4-42 files

FreeBSD/src 1e86bf6 — tests/sys/vfs Makefile

tests/sys/vfs: use LIBADD for libutil, don't clobber LDFLAGS

"LDFLAGS= -lutil" dropped LDFLAGS from make.conf for every test in the
directory.

Approved by:    glebius
Fixes:          c3ac06161dd5 ("nmount: Introduce the "check_fsid" option")
Sponsored by:   Netflix
DeltaFile
+1-2tests/sys/vfs/Makefile
+1-21 files

FreeBSD/src 2c38dc0 — sys/contrib/dev/rtwn rtwn-rtl8188fufw.fw.uu, sys/dev/rtwn/rtl8188f r88f_priv.h r88f_chan.c

rtwn: add support for the RTL8188FTV USB chipset

Add support for the RTL8188FTV chipset to rtwn(4)/rtwn_usb(4).

Differential Revision: https://reviews.freebsd.org/D60875
DeltaFile
+728-0sys/dev/rtwn/rtl8188f/r88f_calib.c
+471-0sys/contrib/dev/rtwn/rtwn-rtl8188fufw.fw.uu
+444-0sys/dev/rtwn/rtl8188f/usb/r88fu_init.c
+358-0sys/dev/rtwn/rtl8188f/r88f_chan.c
+254-0sys/dev/rtwn/rtl8188f/usb/r88fu_attach.c
+214-0sys/dev/rtwn/rtl8188f/r88f_priv.h
+2,469-033 files not shown
+3,336-539 files

FreeBSD/src 96679bc — usr.bin/mkimg mkimg.1

mkimg.1: Document new %align mechanism

Reviewed by:    imp (earlier version)
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60451

(cherry picked from commit b063ea64c72e075f593d0429739881df304ccd56)
DeltaFile
+21-3usr.bin/mkimg/mkimg.1
+21-31 files

FreeBSD/src 97f2ecf — release/tools vmimage.subr

vmimage.subr: Support partition alignment

If VM_PARTALIGN is set, pass %${VM_PARTALIGN} to mkimg in the
specification of swap, config, root, and ESP partitions.  (Boot
partitions are not aligned, both because they're small and in
case firmware makes assumptions about their locations.)

Reviewed by:    lwhsu, imp
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60454

(cherry picked from commit f46269aba8a0bc2b60a0305bdafd8dfb42e0bb88)
DeltaFile
+11-7release/tools/vmimage.subr
+11-71 files

FreeBSD/src b3c301c — usr.bin/mkimg vmdk.c

mkimg: Use reallocf

Reviewed by:    ngie
Suggested by:   ngie
Improves:       1a0523197c5c ("mkimg: Check for realloc failure")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60419

(cherry picked from commit 38407c46ded957a2ecb7fe2a0dca6c4ac8e802f3)
DeltaFile
+2-5usr.bin/mkimg/vmdk.c
+2-51 files

FreeBSD/src 47ae60f — usr.bin/mkimg mkimg.c

mkimg: Remove duplicate variable assignment

Fixes:  459a61fd2d0a ("Add the ability to specify absolute and relative offsets to size partitions.")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60452

(cherry picked from commit 1485ee74f81039cfdccd294440813a1a2badfc0b)
DeltaFile
+0-1usr.bin/mkimg/mkimg.c
+0-11 files

FreeBSD/src fedfb4a — usr.bin/mkimg mkimg.c

mkimg: Don't ignore invalid partition offsets

When handling PART_KIND_FILE, the "error" variable is set to reflect
any errors in parsing the specified offset; but that value is then
overwritten by the return value of image_copyin.

Error out immediately instead.  Note that it is not necessary to change
the code in PART_KIND_SIZE which parses the size, since in that case we
do not overwrite the value in "error".

Fixes:          8f3c71c85e5f ("mkimg: Add support for offset if the source is an image")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60422

(cherry picked from commit e7f84fe6cfac2de3471e4912b1ac82023976ccfa)
DeltaFile
+1-1usr.bin/mkimg/mkimg.c
+1-11 files

FreeBSD/src 3c88daa — usr.bin/mkimg mkimg.c

mkimg: Add per-partition alignment

This adds a "%align" field to partition specifications, resulting in
the start of a partition being shifted to the next aligned position.
When both :offset and %align are used, a relative offset is treated as
a minimum value, while an unaligned absolute offset is an error.

Reviewed by:    imp (earlier version)
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60450

(cherry picked from commit 729883c93e7fd89a4b88e8b9a7ef42938a431efa)
DeltaFile
+50-12usr.bin/mkimg/mkimg.c
+50-121 files

FreeBSD/src a0cf3d5 — usr.bin/mkimg mkimg.c, usr.bin/mkimg/tests Makefile mkimg_offset_test.sh

mkimg: Restore offset support for the SIZE partition form

Commit 50c1240ebfaf moved the offset parsing into the PART_KIND_FILE case of
the switch, leaving PART_KIND_SIZE with no offset handling.
The offset was then silently ignored, so "-p efi::$size:$start" as used by
release/${ARCH}/mkisoimages.sh packed the ESP immediately after the preceding
partition.

Parse the offset outside the switch so both forms honour it.

Add tests covering absolute and relative offsets in both forms.

Reviewed by:    jrtc27, bsdimp, jlduran
Approved by:    jlduran, bsdimp
Sponsored by:   Netflix
Assisted-by:    Claude Code (Opus 5)

(cherry picked from commit 61c27edf3e00ead2bde9669c5917cb1fb32e19db)
DeltaFile
+227-0usr.bin/mkimg/tests/mkimg_offset_test.sh
+12-8usr.bin/mkimg/mkimg.c
+1-0usr.bin/mkimg/tests/Makefile
+240-83 files

FreeBSD/src 8aaf877 — usr.bin/mkimg mkimg.c

mkimg: Fix parsing of filenames containing colons

When using PART_KIND_FILE (-p type:=filename), mkimg uses a colon
to separate an optional offset (e.g., filename:offset).

strsep() was being used to split the string at the first colon.
This caused failures when the filename itself contained a colon
(e.g., "th:is").

This patch uses stat() to check if the entire string exists as a
file. If so, use it directly without splitting.

If the full string is not a valid file, fall back to splitting
at the right-most colon using strrchr().

Uses errc() to fail and exit immediately when an existing directory
is input instead of a file in PART_KIND_FILE mode.

PR: 257960

    [4 lines not shown]
DeltaFile
+21-3usr.bin/mkimg/mkimg.c
+21-31 files

FreeBSD/src 0c60967 — . Makefile.inc1, release Makefile Makefile.inc1

build: Support got

Add code for using got(1), matching how git(1) is currently used:
1. Determining the git branch,
2. Determining the checked-out hash,
3. Determining the commit count,
4. Determining the timestamp of the most recent commit,
5. Determining if the tree is "dirty",
6. Generating lists of files for the src and src-sys packages, and
7. Excluding .got directories from src.txz and ports.txz.

The release engineer hopes to use this functionality in release builds,
since got's minimalism makes it a far more manageable build tool than
git.

Reviewed by:    naddy
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60606

    [2 lines not shown]
DeltaFile
+33-2sys/conf/newvers.sh
+31-0Makefile.inc1
+27-1release/Makefile.inc1
+2-2release/Makefile
+93-54 files

FreeBSD/src 4ab9e73 — lib/libthr/thread thr_mutex.c

libthr/thr_mutex.c: make mutex asserts more useful

Print the file and line number of the caller where the assert fired.
Use _thread_exitf() directly for this.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+30-22lib/libthr/thread/thr_mutex.c
+30-221 files

FreeBSD/src 33c8b4b — usr.bin/man man.sh man.1

usr.bin/man: allow man(1) to search translated manpages in pure $man_lang subdirectory (+)

Currently our man(1) utility search manages only in $lang_country.$charset, $lang.$charset and,
as failover, in en.$charset which is historical behavior.
But nowadays most of ported software uses only $lang subdirectories for translated manpages
instead of use full locale notation, for example, share/ja/man1, share/de/man1, share/ru/man1.
In such cases, our man(1) utility cannot find any translated manpages and silently fallback to english version.

Add $man_lang in search path allows man(1) search and use translated manpages under historical and modern path traditions

MFC after:              1 day
MFC to:                 stable/15 stable/14
Reviewed by:            ziaee, fernape
Approved by:            fernape
Differential Revision:  https://reviews.freebsd.org/D55805

(cherry picked from commit 5250c98908482babae8379b4dede10c64e8639ae)
DeltaFile
+4-0usr.bin/man/man.1
+1-1usr.bin/man/man.sh
+5-12 files

FreeBSD/src 9fe7f51 — usr.bin/man man.sh man.1

usr.bin/man: allow man(1) to search translated manpages in pure $man_lang subdirectory (+)

Currently our man(1) utility search manages only in $lang_country.$charset, $lang.$charset and,
as failover, in en.$charset which is historical behavior.
But nowadays most of ported software uses only $lang subdirectories for translated manpages
instead of use full locale notation, for example, share/ja/man1, share/de/man1, share/ru/man1.
In such cases, our man(1) utility cannot find any translated manpages and silently fallback to english version.

Add $man_lang in search path allows man(1) search and use translated manpages under historical and modern path traditions

MFC after:              1 day
MFC to:                 stable/15 stable/14
Reviewed by:            ziaee, fernape
Approved by:            fernape
Differential Revision:  https://reviews.freebsd.org/D55805

(cherry picked from commit 5250c98908482babae8379b4dede10c64e8639ae)
DeltaFile
+4-0usr.bin/man/man.1
+1-1usr.bin/man/man.sh
+5-12 files

FreeBSD/src f2d4370 — sys/netpfil/ipfw ip_fw_nat.c

ipfw: declare the ipfw_nat module

The module declaration is necessary for 'kldstat -m' to see it,
and the rc(8) uses that to detect presence of ipfw_nat.

NB: the module(9) KPI lacks a way to declare a module without
providing an empty handler and no SYSINITs.

Reported by:    ambrisko
Fixes:          9bcc1e97dda8e926483b81874884211bbe4f36e9
DeltaFile
+18-0sys/netpfil/ipfw/ip_fw_nat.c
+18-01 files

FreeBSD/src acab752 — sys/arm64/arm64 pmap.c

arm64: a local TLB invalidation suffices when enabling write access

When a PTE logically supports write access, as indicated by its DBM
field, but write access is nonetheless blocked by the PTE's protection
field, pmap_fault() can enable write access with only a local TLB
invalidation.

(cherry picked from commit 7dd9a8125f70f1fc40fd9907bdaae0d23c8586c9)
DeltaFile
+33-3sys/arm64/arm64/pmap.c
+33-31 files

FreeBSD/src d9d6e77 — tests/sys/netpfil/pf igmp.py

tests/pf/igmp: fix attribute error with newer versions of scapy

This fixes the flaky testcase in CI[0].

While here:
* fix a typo in a comment
* remove an unnecessary import
* fix this deprecation warning:

  /usr/local/lib/python3.12/site-packages/scapy/contrib/igmp.py:12:
  DeprecationWarning: scapy.contrib.igmp is deprecated. Please use
  scapy.layers.igmp instead !

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/29813/testReport/junit/sys.netpfil.pf.igmp/py/TestIGMP__test_ip_opts/

Reviewed by:    kp
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
DeltaFile
+9-10tests/sys/netpfil/pf/igmp.py
+9-101 files

FreeBSD/src eca7cba — sys/dev/virtio/p9fs virtio_p9fs.c

virtio_p9fs: Mark response buffers as initialized for KMSAN

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+4-1sys/dev/virtio/p9fs/virtio_p9fs.c
+4-11 files

FreeBSD/src 73b3fb4 — sys/amd64/amd64 trap.c

amd64: Make the SYSENTER and INTn action same as for IDT case.

Fixes:  6e93f5e4d693 ("amd64: FRED support")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+23-7sys/amd64/amd64/trap.c
+23-71 files

FreeBSD/src 8671e82 — sys/amd64/amd64 genassym.c exception.S

amd64: do not pass SYSENTER frame to FRED fast syscall handler

With FRED, SYSCALL is delivered as event type syscall (7) and vector 1.
SYSENTER is syscall with vector 2.  Handle SYSENTER in slow path,
otherwise 32bit code is able to execute 64bit syscalls.

Also check that SYSCALL comes from the 64bit mode. Intel already
specifies that SYSCALL causes #UD in compatibility mode, but there is no
AMD specification for SYSCALL under FRED yet, and SYSCALL is allowed
in compatibility mode on AMD with IDT event delivery.

Fixes:  6e93f5e4d693 ("amd64: FRED support")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+4-4sys/amd64/amd64/exception.S
+6-0sys/amd64/amd64/genassym.c
+10-42 files