HardenedBSD/src 090fb28sys/compat/linprocfs linprocfs.c, sys/conf kern.pre.mk

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+5-9sys/compat/linprocfs/linprocfs.c
+4-2sys/conf/kern.pre.mk
+9-112 files

HardenedBSD/src b496e44sys/compat/linprocfs linprocfs.c, sys/conf kern.pre.mk

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+5-9sys/compat/linprocfs/linprocfs.c
+4-2sys/conf/kern.pre.mk
+9-112 files

HardenedBSD/src 859e512libexec/flua Makefile linit_flua.c, libexec/flua/lfbsd lfbsd.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+457-0libexec/flua/lfs/lfs.c
+0-448libexec/flua/modules/lfs.c
+289-0libexec/flua/lfbsd/lfbsd.c
+0-285libexec/flua/modules/lfbsd.c
+39-8libexec/flua/Makefile
+28-5libexec/flua/linit_flua.c
+813-74634 files not shown
+1,028-85840 files

HardenedBSD/src de2ea54sys/conf kern.pre.mk

zstd: disable weak-symbol tracing hooks in the kernel

zstd's tracing API (zstd_trace.h) declares ZSTD_trace_compress_begin()
and friends as __attribute__((weak)) externals, gated on the
ZSTD_HAVE_WEAK_SYMBOLS compile-time probe.  That probe has covered
x86_64 and i386 since at least zstd 1.5.6, and was extended to aarch64
and riscv in 1.5.7.

In a static kernel image there is no dynamic linker to patch the PLT GOT
entries at runtime.  On amd64 the undefined weak symbols resolve directly
to NULL, so the "!= NULL" guard in the zstd source correctly suppresses
every call through the stubs.  On aarch64 and riscv the ABI requires
GOT-based indirection for external calls: the PLT stub address is
non-NULL, the guard passes, and the call lands in an uninitialized GOT
slot.  Because this happens before exception handlers are in place the
machine resets silently, making the kernel unbootable after the zstd
1.5.7 import.

The upstream-supported suppression is ZSTD_NO_TRACE (zstd_internal.h),

    [8 lines not shown]
DeltaFile
+4-2sys/conf/kern.pre.mk
+4-21 files

HardenedBSD/src 5f5cc3csys/compat/linprocfs linprocfs.c

compat/linprocfs: Update /proc/partitions output

Linux /proc/partitions reports the major/minor pair, the device size in
1K blocks, and the device name.  linprocfs still printed obsolete
statistics columns and reported the size in bytes.

Update linprocfs_dopartitions() to emit the Linux-style header and
report provider sizes in 1K blocks.

Signed-off-by: Shunchao Hu <ankohuu at gmail.com>
Reviewed by:    des
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2126
Closes:         https://github.com/freebsd/freebsd-src/pull/2126
DeltaFile
+5-9sys/compat/linprocfs/linprocfs.c
+5-91 files

HardenedBSD/src ee79b84sys/arm64/qualcomm qcom_gcc.c, sys/dev/qcom_gcc qcom_gcc_msm8916_clock.c qcom_gcc_msm8916_reset.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+0-143sys/arm64/qualcomm/qcom_gcc.c
+0-112sys/netinet6/nd6_rtr.c
+84-0sys/dev/qcom_gcc/qcom_gcc_msm8916_clock.c
+71-0sys/dev/qcom_gcc/qcom_gcc_msm8916_reset.c
+41-0sys/dev/qcom_gcc/qcom_gcc_msm8916.h
+0-39sys/net/if_ethersubr.c
+196-29423 files not shown
+266-38129 files

HardenedBSD/src bc67551sys/fs/nfsserver nfs_nfsdsocket.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+2-1sys/fs/nfsserver/nfs_nfsdsocket.c
+2-11 files

HardenedBSD/src 5183de1libexec/flua/lfs lfs.c

stand: lua: break out a few more dirent types in lfs

These are non-standard and specific to the version used in loader.  We
have some desire to recognize symlinks to avoid filtering out kernel
symlinks in the autodetection bits when they would be perfectly fine to
`load`.

This won't be usable right away, so any impending use will need to be
careful to account for nil.

Reported by:    leres

(cherry picked from commit bc531a96c9b28b1cabcd5deb0c9f8f6d815cfebc)
DeltaFile
+4-0libexec/flua/lfs/lfs.c
+4-01 files

HardenedBSD/src ec37fd5libexec/flua Makefile, libexec/flua/modules lposix.c

flua: lposix: fix WARNS=6 issues

lposix is the last holdout of modules built into flua until we can fix
the module design to have the right parts require()able.  Address a
valid bug in lua_read() found at a higher WARNS and drop the override
entirely.  Some of the modules could possibly be re-evaluated.

Reported by:    des
Reviewed by:    des
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.

(cherry picked from commit b41b6fdb3a1635de4c2a9280aab12b83e3aeffc5)
DeltaFile
+8-4libexec/flua/modules/lposix.c
+0-1libexec/flua/Makefile
+8-52 files

HardenedBSD/src 9ba365alibexec/flua/lfbsd lfbsd.c lfbsd.h, libexec/flua/lfs lfs.c

flua: kick out the remaining builtin modules

Bootstrap flua has some magic now to handle modules by building them in
and discovering them via linker sets.  This is slightly cleaner than
always building them in and baking them into loadedlibs for both
bootstrap and system flua.

Adjust the stand build now that these three libs have their own new
homes.  lposix remains builtin because it's structured incorrectly in
our version.

Reviewed by:    bapt, emaste, markj

(cherry picked from commit b11a5709ec2b61fefb03bfdd38e2f06d2c1107c1)
(cherry picked from commit 9c7db0931d486ce800aa71d9f41abfad9f7f691f)
(cherry picked from commit d505ef08ffbe3b7383fbc6ed30121de9256ac18e)
DeltaFile
+453-0libexec/flua/lfs/lfs.c
+0-448libexec/flua/modules/lfs.c
+289-0libexec/flua/lfbsd/lfbsd.c
+0-285libexec/flua/modules/lfbsd.c
+0-32libexec/flua/modules/lfbsd.h
+32-0libexec/flua/lfbsd/lfbsd.h
+774-76511 files not shown
+826-80317 files

HardenedBSD/src 2ef21ab. Makefile.inc1, libexec/flua Makefile bootstrap.h

flua: support our flua modules in the bootstrap flua

This version builds every module into the flua binary itself, since all
of the bootstrap tools are built -DNO_SHARED.  As a result, we also
cannot dlsym(), so we can't really discover the names of our newly
builtin modules.  Instead, just build out a linker set with all of our
luaopen_*() functions to register everything up-front.

Building in all of the modules isn't strictly necessary, but it means
that we have an example of how to add a bootstrap module everywhere you
go and one doesn't need to consider whether bootstrap flua can use a
module when writing scripts.  On my build machine, the consequence on
our binary size is an increase from around 1.6M -> 1.9M, which isn't
really that bad.

.lua modules can install into their usual path below $WORLDTMP/legacy
and we'll pick them up automagically by way of the ctor that sets up
LUA_PATH early on.


    [32 lines not shown]
DeltaFile
+36-6libexec/flua/Makefile
+32-0libexec/flua/bootstrap.h
+28-1libexec/flua/linit_flua.c
+1-19libexec/flua/liblyaml/Makefile
+20-0libexec/flua/liblyaml/Makefile.inc
+14-1Makefile.inc1
+131-2718 files not shown
+189-5024 files

HardenedBSD/src 072ca5dlibexec/nuageinit nuageinit

nuageinit: require lfs where it's needed

nuageinit largely already did this, but one spot was missed -- add the
necessary require() in to get the module loaded.

(cherry picked from commit bb4167463ac44b47ded4e0223a0abd8381ca6cd8)
DeltaFile
+1-0libexec/nuageinit/nuageinit
+1-01 files

HardenedBSD/src 6dddd25sys/fs/nfsserver nfs_nfsdsocket.c

nfs_nfsdsocket.c: All Copy and Clone across file systems

For some server file system types, such as ZFS, a Copy/Clone
operation can be done across file systems of the same file
system type.

As such, this patch allows the Copy/Clone to be attempted
when the file handles are for files on different file systems.

This fixes a problem for exported ZFS file systems when a
copy_files on file_range(2) between file systems in the same
NFSv4 mount is attempted.

PR:     294010

(cherry picked from commit b65e7b4944cc2f594c9d9e6abc9b8618d3d62ff8)
DeltaFile
+2-1sys/fs/nfsserver/nfs_nfsdsocket.c
+2-11 files

HardenedBSD/src f95b974share/mk src.opts.mk

HBSD: Resolve merge conflict

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-5share/mk/src.opts.mk
+0-51 files

HardenedBSD/src 59627d9sys/arm64/qualcomm qcom_gcc.c, sys/dev/qcom_gcc qcom_gcc_msm8916_clock.c qcom_gcc_msm8916_reset.c

Merge remote-tracking branch 'origin/freebsd/current/main' into hardened/current/master

Conflicts:
        share/mk/src.opts.mk (unresolved)
DeltaFile
+0-143sys/arm64/qualcomm/qcom_gcc.c
+0-112sys/netinet6/nd6_rtr.c
+84-0sys/dev/qcom_gcc/qcom_gcc_msm8916_clock.c
+71-0sys/dev/qcom_gcc/qcom_gcc_msm8916_reset.c
+41-0sys/dev/qcom_gcc/qcom_gcc_msm8916.h
+0-39sys/net/if_ethersubr.c
+196-29423 files not shown
+269-37929 files

HardenedBSD/src 0425476lib/libsys procctl.2, lib/libusb libusb20_dev_open.3 libusb20_be_device_foreach.3

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+7-77share/man/man5/style.mdoc.5
+69-0lib/libusb/libusb20_dev_open.3
+62-0share/man/man4/vmgenc.4
+56-0lib/libusb/libusb20_be_device_foreach.3
+24-24lib/libsys/procctl.2
+29-0share/man/man4/man4.arm/dwcotg.4
+247-10122 files not shown
+373-14428 files

HardenedBSD/src 4e3fdcesys/arm64/qualcomm qcom_gcc.c, sys/conf files.arm64

qcom_gcc: migrate the MSM8916 support to qcom_gcc

* migrate the MSM8916 (snapdragon 410) support to qcom_gcc
* add the full qcom_gcc / qcom_clk list to files.arm64, replacing
  the MSM8916 stub in sys/arm64/qualcomm .

Differential Revision:  https://reviews.freebsd.org/D49706
DeltaFile
+0-143sys/arm64/qualcomm/qcom_gcc.c
+84-0sys/dev/qcom_gcc/qcom_gcc_msm8916_clock.c
+71-0sys/dev/qcom_gcc/qcom_gcc_msm8916_reset.c
+41-0sys/dev/qcom_gcc/qcom_gcc_msm8916.h
+19-3sys/dev/qcom_gcc/qcom_gcc_main.c
+14-1sys/conf/files.arm64
+229-1475 files not shown
+244-15511 files

HardenedBSD/src 87bea33sys/net if_ethersubr.c, sys/netinet6 nd6_rtr.c nd6.h

nd6: Remove DRAFT_IETF_6MAN_IPV6ONLY_FLAG and EXPERIMENTAL options

The draft-ietf-6man-ipv6only-flag has been obsoleted by RFC 8925.
Remove the EXPERIMENTAL compile option from the kernel and remove
DRAFT_IETF_6MAN_IPV6ONLY_FLAG from userland.
This compile option was not enabled by default.
Also regenerate src.conf.5.

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D56228
DeltaFile
+0-112sys/netinet6/nd6_rtr.c
+0-39sys/net/if_ethersubr.c
+0-13usr.sbin/rtadvd/rtadvd.c
+0-11usr.sbin/rtadvd/config.c
+1-6usr.sbin/ndp/ndp.c
+0-6sys/netinet6/nd6.h
+1-18711 files not shown
+2-22217 files

HardenedBSD/src 8208871lib/libsys procctl.2

procctl.2: Align list indentation

Remove 81 lines of whitespace at default manual rendering width.

MFC after: 3 days

(cherry picked from commit db9bbe131c92f55e6cf03657dc030c9eea93a9fb)
DeltaFile
+24-24lib/libsys/procctl.2
+24-241 files

HardenedBSD/src 20bbad1lib/libc/stdlib atexit.3, lib/libsys _exit.2

_exit.2: Cross-reference atexit(3)

atexit(3) is one of the cases when _exit(2) must be used instead of
exit(3).

MFC after:              3 days
Reviewed by:            mhorne, ziaee
Differential Revision:  https://reviews.freebsd.org/D54467

(cherry picked from commit c082e5656417945bfa567114c60969844f3d7bdf)
DeltaFile
+5-4lib/libsys/_exit.2
+2-1lib/libc/stdlib/atexit.3
+7-52 files

HardenedBSD/src 252f0c2share/man/man4 vmgenc.4 Makefile

vmgenc.4: Add VM Generation ID Counter manual

Document the vmgenc(4) ACPI driver which detects virtual machine
cloning and snapshot restoration via the VM Generation ID
specification. The driver reseeds the kernel entropy pool when
a generation change is detected.

MFC after:              3 days
Reviewed by:            cem (previous), ziaee
Signed-off-by:          Christos Longros <chris.longros at gmail.com>
Differential Revision:  https://reviews.freebsd.org/D56011

(cherry picked from commit 59cb18f35617d3a53f7d7e142b4f91ad7951f5e0)
DeltaFile
+62-0share/man/man4/vmgenc.4
+1-0share/man/man4/Makefile
+63-02 files

HardenedBSD/src 2ba48eelib/libsys kldload.2

kldload.2: Provide more info about file argument

The information is basically taken from kldload(8).

Reviewed by:            kib, ziaee
Differential Revision:  https://reviews.freebsd.org/D55170

(cherry picked from commit 1e2c9bcc4ed5fd2a27abdbcf5dfb007193251648)
DeltaFile
+15-2lib/libsys/kldload.2
+15-21 files

HardenedBSD/src 528d53bshare/man/man4/man4.arm dwcotg.4 Makefile

dwcotg.4: Initial manual page

Create visibility in apropos and the Hardware Release Notes.

MFC after:              3 days
Reviewed by:            pauamma, ray
Differential Revision:  https://reviews.freebsd.org/D53287

(cherry picked from commit 8475cd93fb6db65a02afe435f16306bc18e96ec9)
DeltaFile
+29-0share/man/man4/man4.arm/dwcotg.4
+1-0share/man/man4/man4.arm/Makefile
+30-02 files

HardenedBSD/src 74406b7share/man/man4 igc.4

igc.4: Describe better

MFC after:      3 days

(cherry picked from commit 6560ee97e8f51d5147521319dfd9d1e7afe74d34)
DeltaFile
+4-4share/man/man4/igc.4
+4-41 files

HardenedBSD/src d7bda1ausr.sbin/freebsd-update freebsd-update.8 freebsd-update.sh

freebsd-update: Document -v verbosity flag

PR:             276099
MFC after:      3 days
Reported by:    michaelo
Co-authored-by: Alexander Ziaee <ziaee at FreeBSD.org>

(cherry picked from commit 02fd9fa2952705ea0ed142061dd86aad7e01f8db)
DeltaFile
+12-1usr.sbin/freebsd-update/freebsd-update.8
+1-0usr.sbin/freebsd-update/freebsd-update.sh
+13-12 files

HardenedBSD/src 782ea98share/man/man7 ports.7

ports.7: Document DEFAULT_VERSIONS

MFC after:              3 days
Co-authored-by:         Adam Weinberger <adamw at FreeBSD.org>
Differential Revision:  https://reviews.freebsd.org/D55443

(cherry picked from commit 74aec9f02d9d8fbde250da1ecc881729c8baf489)
DeltaFile
+4-0share/man/man7/ports.7
+4-01 files

HardenedBSD/src e774d86share/man/man5 style.mdoc.5

style.mdoc: Left angle bracket is not less-than

MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D55300

(cherry picked from commit 06ac71cffba4a0f86334844453d0a6fb3c46aa12)
DeltaFile
+1-1share/man/man5/style.mdoc.5
+1-11 files

HardenedBSD/src 7f30d5cshare/man/man5 style.mdoc.5

style.mdoc: Remove synopsis formatting advice

Remove incorrect advice. The first rule was no spaces padding pipes
when showing alternates. Almost universally we not do this, and third
party manuals do not either. The second was using Cm to mark up symbols.
This advice is in conflict with mdoc(7), and the extended documentation
on mdoc linked below, which is also linked at the bottom of mdoc(7).

Conflicting information in our docs is a natural result of documentation
proliferation. The most important thing we can do to reduce technical
debt in the documentation is reduce the amount of doc overlap. Excessive
technical debt and conflicting rules is a barrier to new contributors.
This type of work requires thorough expertise, is not glamorous at all,
and to add insult to injury, is socially unsafe. To get new contributors
to the docs project, we must deduplicate documentation.

We have the mdoc manual, examples/mdoc, style.mdoc, and the fdp chapter
on manual pages. With this many, they will inevitably come to contain
conflicting information, and people will learn not to read them or work

    [7 lines not shown]
DeltaFile
+0-67share/man/man5/style.mdoc.5
+0-671 files

HardenedBSD/src 906f274share/man/man5 style.mdoc.5

style.mdoc: Li macro is undeprecated for some time

Previously, the mdoc linter warned against using Li as it was deprecated
upstream. However, upstream undeprecated it since last year. As usual
when it comes to style, the best thing to do is to follow the existing
style of the page. We have many manuals which prefer double quotes.

MFC after:              3 days
Citation:               https://cvsweb.bsd.lv/mandoc/mdoc.7?rev=1.297
Differential Revision:  https://reviews.freebsd.org/D55297

(cherry picked from commit fae551b76785d2357b09e2c022a92f410d871b9b)
DeltaFile
+1-9share/man/man5/style.mdoc.5
+1-91 files

HardenedBSD/src 67f2880usr.bin/newgrp newgrp.1

newgrp.1: Provide examples

"These examples appear to be originally noted thirteen years ago by
Mark Saad, contributed by eadler, put into a patch by Felix Johnson,
and made into mdoc by myself. Finally, put this bug to rest." ~ziaee

PR:                     167742
Co-authored-by:         eadler, ziaee, Mark Saad
Differential Revision:  https://reviews.freebsd.org/D48877

(cherry picked from commit 86dc5dd0b2a861cf9d8cad18fc17c17dbbfc4465)
DeltaFile
+16-1usr.bin/newgrp/newgrp.1
+16-11 files