HardenedBSD/src e6e9f0fsys/vm vm_mmap.c, usr.bin/clang llvm.prog.mk

HBSD: Resolve merge conflicts

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+10-21sys/vm/vm_mmap.c
+0-10usr.bin/clang/llvm.prog.mk
+10-312 files

HardenedBSD/src 3a47f06lib/libc/stdlib realpath.3, share/man/man9 ecn.9

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

Conflicts:
        sys/vm/vm_mmap.c (unresolved)
        usr.bin/clang/llvm.prog.mk (unresolved)
DeltaFile
+184-0share/man/man9/ecn.9
+106-74tools/tools/nanobsd/embedded/common
+98-55sys/netinet/ip_ecn.c
+69-51sys/netinet6/nd6_nbr.c
+31-12sys/vm/vm_mmap.c
+12-24lib/libc/stdlib/realpath.3
+500-2169 files not shown
+544-24615 files

HardenedBSD/src 046bb7esys/dev/sound/pcm feeder_volume.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+10-1sys/dev/sound/pcm/feeder_volume.c
+10-11 files

HardenedBSD/src 17920f8sys/net if_bridge.c

bridge(4): Remove epoch_enter during destruction

bridge doesn't require to enter epoch during destruction.

Reviewed by: zlei, glebius
Differential Revision: https://reviews.freebsd.org/D55935
DeltaFile
+0-5sys/net/if_bridge.c
+0-51 files

HardenedBSD/src 1c1b494share/man/man9 ecn.9

ecn.9: Replace non-ASCII characters

Reported by:    maxim
Fixes:          ba4298b05564 ("ecn.9: Add ecn(9) manual")
DeltaFile
+3-3share/man/man9/ecn.9
+3-31 files

HardenedBSD/src 894992etools/tools/nanobsd/embedded common

nanobsd: embedded: Time stamp the code image

While there is a function nano_makefs() that already takes care of this
issue, we are not yet ready to consume it.

Just add the time stamp and FFS options to makefs.  This is done
primarily to use UFS2 (UFS version 2).  If the user needs further
customization, the variable NANO_MAKEFS can be overridden.  Timestamping
takes care of making the images bit-for-bit identical.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54980
DeltaFile
+1-1tools/tools/nanobsd/embedded/common
+1-11 files

HardenedBSD/src 5902c18tools/tools/nanobsd fill_pkg.sh defaults.sh, tools/tools/nanobsd/embedded common

nanobsd: Minor cleanup

No functional change intended.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54979
DeltaFile
+47-51tools/tools/nanobsd/embedded/common
+6-6tools/tools/nanobsd/fill_pkg.sh
+2-2tools/tools/nanobsd/defaults.sh
+55-593 files

HardenedBSD/src 60f8d36tools/tools/nanobsd/embedded common

nanobsd: embedded: Fix more regressions from last cleanup

Commit c99bb5747f5e changed "()" grouping into "{}", but in these cases
we chdir and depended on the subshell not changing the directory for the
caller.  Restore the old behavior.  While things appear to work without
this change, the previous code was intentionally structured this way.

Reviewed by:    imp
Fixes:          c99bb5747f5e ("nanobsd: minor formatting cleanup")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54978
DeltaFile
+6-6tools/tools/nanobsd/embedded/common
+6-61 files

HardenedBSD/src 21970f2tools/tools/nanobsd/embedded common

nanobsd: embedded: Remove stray comment

Remove an outdated comment about NanoBSD not being able to remove the
firstboot sentinel file.

It was fixed in cb51e2bc3db7 ("rc: Allow the removal of
firstboot_sentinel on read-only file systems").

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54977
DeltaFile
+0-1tools/tools/nanobsd/embedded/common
+0-11 files

HardenedBSD/src 5de9a54tools/tools/nanobsd/embedded common

nanobsd: embedded: Remove mtools dependency

Rely on makefs -t msdos to create the MS-DOS partition and remove the
dependency on filesystems/mtools.

Note that NANO_SLICE_FAT_SIZEs defined in sectors (ending with an "s")
are no longer supported, as a workaround the letter "b" (blocks) may be
used instead.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54976
DeltaFile
+7-13tools/tools/nanobsd/embedded/common
+7-131 files

HardenedBSD/src 68f5e5btools/tools/nanobsd/embedded common

nanobsd: embedded: Calculate FAT type and scheme

Determine the FAT (MS-DOS) type (FAT32, FAT16, or FAT12) and partition
scheme (fat32lba or fat16b) based on partition size.

Accept any (NetBSD) strsuftoll(3)-compatible string, as the value will
be fed to makefs(8) "-s" in a future commit.

NANO_SLICE_FAT_SIZEs defined in sectors (ending with an "s") will not be
supported.  As a workaround, the letter "b" (blocks) may be used.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54975
DeltaFile
+46-3tools/tools/nanobsd/embedded/common
+46-31 files

HardenedBSD/src 15ebee7sys/netinet6 nd6_nbr.c nd6.h

ndp: Accept multiple queued ND for non-GRAND NAs

Multiple delayed NAs on the same ifa can occur simultaneously.
Therefore:
* Differentiate between GRAND and solicited replies.
* Cancel previous pending GRAND NA for same ifa.
* Reuse ndq memory for GRAND.
* Free non-GRAND replies immediately.
* Don't limit non-GRAND NAs.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55905
DeltaFile
+69-51sys/netinet6/nd6_nbr.c
+4-2sys/netinet6/nd6.h
+73-532 files

HardenedBSD/src d478715usr.bin/clang llvm.prog.mk

llvm: Link cross-tools with static libllvm.a

We generally use TOOLS_PREFIX being set to indicate that we are building
in the cross-build tools stage.  This check was missing for llvm.prog.mk
consumers other than *tblgen, which have not previously been built as
cross tools.

Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55930
DeltaFile
+1-1usr.bin/clang/llvm.prog.mk
+1-11 files

HardenedBSD/src bd5ce67sys/dev/sound/pcm feeder_volume.c

sound: enforce MASTER volume mute during playback

MASTER mute (vol.mute) works while audio is playing. However, if a
stream is stopped and restarted (PCMTRIG_STOP -> PCMTRIG_START), the
audio will resume even though the mixer shows the MASTER volume as
muted. Other streams that are already playing remain silent. New streams
may also start playing audio regardless of the MASTER mute state.

The volume feeder now considers the MASTER mute when determining whether
a channel should be muted. This ensures MASTER mute is consistently
enforced for all streams and removes the dependency on trigger-driven
state propagation.

Tested with Creative Labs CA0132 card.

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D55605

(cherry picked from commit ac5ff2813027c385f9037b47b2b164d4c1bebd09)
DeltaFile
+10-1sys/dev/sound/pcm/feeder_volume.c
+10-11 files

HardenedBSD/src ba4298bshare/man/man9 ecn.9 Makefile

ecn.9: Add ecn(9) manual

Add ecn manual for ip_ecn tunneling functions.

Reviewed by: pauamma_gundo.com, tuexen
Differential Revision: https://reviews.freebsd.org/D53517
DeltaFile
+184-0share/man/man9/ecn.9
+5-0share/man/man9/Makefile
+189-02 files

HardenedBSD/src 32a462bsys/netinet ip_ecn.c ip_ecn.h, sys/netinet6 ip6_ecn.h

ecn(9): Update ecn tunneling functions to RFC 6040

Update ECN tunneling functions from obsolete RFC 3168 to
newer RFC 6040.
Also, add ECN_COMPLETE to support dangerous packet reporting
without causing extra costs to existing caller functions.
Finally, return values are specified as macro to reduce
confusion, considering extra return values for ECN_WARN
and ECN_ALARM were added.

Reviewed By: glebius, tuexen
Differential Revision: https://reviews.freebsd.org/D53516
DeltaFile
+98-55sys/netinet/ip_ecn.c
+10-7sys/netinet/ip_ecn.h
+0-5sys/netinet6/ip6_ecn.h
+108-673 files

HardenedBSD/src a55f9d6sys/dev/cxgbe/common t4_hw.c, sys/netinet in_var.h

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+2-500usr.sbin/ifmcstat/ifmcstat.c
+219-0tests/sys/netinet/raw.c
+1-44usr.sbin/ifmcstat/ifmcstat.8
+15-4sys/dev/cxgbe/common/t4_hw.c
+1-4sys/netinet/in_var.h
+3-0tests/sys/netinet/Makefile
+241-5526 files

HardenedBSD/src 99d295elib/libc/stdlib realpath.c

realpath: Improve prev_len logic

* Save prev_len after having checked for and appended a trailing slash,
  not before.  This requires us to back up if we end up returning a
  partial result, but previously we would sometimes return a partial
  result with a trailing slash and sometimes without.

* Replace strlcat() with a faster strlcpy() since we know exactly how
  far into the buffer we are.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55914
DeltaFile
+7-3lib/libc/stdlib/realpath.c
+7-31 files

HardenedBSD/src 1aecb32lib/libc/stdlib realpath.3

realpath: Improve manual page

* Try to make the RETURN VALUES section flow better.

* Add basename(3), dirname(3), free(3) to the SEE ALSO section.

* Drop the CAVEATS section, which was obsolete the moment realpath(3)
  was added to the Single Unix Specification in 1994.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D55928
DeltaFile
+12-24lib/libc/stdlib/realpath.3
+12-241 files

HardenedBSD/src dad6e6fsys/vm vm_mmap.c

Provide more precise error explanations for mmap(2) EINVAL errors.

Reviewed by:  kib
Differential Revision: https://reviews.freebsd.org/D55888
MFC-after:    1 week
Sponsored by: Netflix
DeltaFile
+23-13sys/vm/vm_mmap.c
+23-131 files

HardenedBSD/src 51446d3sys/vm vm_mmap.c

Delete error-check code that can never happen.

Near the top of kern_mmap() that implements the mmap(2) system call,
it sets

        prot = PROT_EXTRACT(prot);

with

So prot can only be the three PROT_ flags.

The following test of the user's mmap(2) parameters (near line 275
in vm/vm_mmap.c):

        if (prot != PROT_NONE &&
            (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) {
                return (EXTERROR(EINVAL, "invalid prot %#jx", prot));
        }


    [7 lines not shown]
DeltaFile
+0-4sys/vm/vm_mmap.c
+0-41 files

HardenedBSD/src 6529e8asys/dev/cxgbe/common t4_hw.c, sys/netinet in_var.h

Merge remote-tracking branch 'internal/freebsd/current/main' into hardened/current/master
DeltaFile
+2-500usr.sbin/ifmcstat/ifmcstat.c
+219-0tests/sys/netinet/raw.c
+1-44usr.sbin/ifmcstat/ifmcstat.8
+15-4sys/dev/cxgbe/common/t4_hw.c
+1-4sys/netinet/in_var.h
+3-0tests/sys/netinet/Makefile
+241-5526 files

HardenedBSD/src 3701625share/mk bsd.sys.mk, stand defs.mk Makefile.inc

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+2-0share/mk/bsd.sys.mk
+2-0stand/defs.mk
+1-0stand/Makefile.inc
+5-03 files

HardenedBSD/src cfd8f4arelease/tools ec2.conf, sys/kern subr_intr.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+13-1sys/kern/subr_intr.c
+4-1release/tools/ec2.conf
+17-22 files

HardenedBSD/src 718049eshare/mk bsd.sys.mk, stand defs.mk Makefile.inc

HBSD: Disable retpolines for the bootloader

We've been building the bootloader with retpolines. With the latest
OpenZFS import, the addition of retpolines now causes the loader to be
too large in size, preventing a successful build.

Applying retpolines to the bootloader doesn't make sense, anyways. An
attacker able to exploit speculative execution vulnerabilities at the
bootloader stage has already won the game.

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
Fixes:          8a62a2a5659d1839d8799b4274c04469d7f17c78
DeltaFile
+2-0stand/defs.mk
+2-0share/mk/bsd.sys.mk
+1-0stand/Makefile.inc
+5-03 files

HardenedBSD/src 8f41ee9sys/dev/cxgbe/common t4_hw.c

cxgbe(4): decode the T7 MC interrupt correctly

The layout for the main INT_CAUSE is a bit different for T7.

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+10-0sys/dev/cxgbe/common/t4_hw.c
+10-01 files

HardenedBSD/src 6317122sys/dev/cxgbe/common t4_hw.c

cxgbe(4): adjustments to the output of the slow interrupt handler

- Display an appropriate alert character instead of a question mark for
  unknown bits.
- Display all fatal bits for a register and not just the ones that are
  currently set.

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+5-4sys/dev/cxgbe/common/t4_hw.c
+5-41 files

HardenedBSD/src ad0e698usr.sbin/ifmcstat ifmcstat.c ifmcstat.8

ifmcstat: remove libkvm(3) code

It has been broken and disabled for over 10 years.  Remove mentions of the
kvm(3) from the manual page.
DeltaFile
+2-500usr.sbin/ifmcstat/ifmcstat.c
+1-44usr.sbin/ifmcstat/ifmcstat.8
+3-5442 files

HardenedBSD/src 85cf26csys/netinet in_var.h

in_var.h: fixup comments that mention use by ifmcstat(8)
DeltaFile
+1-4sys/netinet/in_var.h
+1-41 files

HardenedBSD/src 660a79erelease/tools ec2.conf

EC2: Don't use unicode in boot loader

The boot loader menu is disabled by default in EC2, but if it is ever
turned on, the default (unicode) output breaks EC2's web interface to
the serial console.

Set loader_menu_frame="ascii" instead.

MFC after:      3 days
Sponsored by:   Amazon

(cherry picked from commit 277830b4d3ae9999c80bf915b5491850e91c6516)
(cherry picked from commit 251907ca480eff7f6177f52959b71a6cfce45579)
DeltaFile
+4-1release/tools/ec2.conf
+4-11 files