HardenedBSD/src 5806cd1sys/netinet tcp_input.c tcp_subr.c, sys/netinet/tcp_stacks sack_filter.c sack_filter.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+266-150sys/netinet/tcp_stacks/sack_filter.c
+78-13sys/netinet/tcp_stacks/sack_filter.h
+29-2sys/netinet/tcp_stacks/bbr.c
+29-1sys/netinet/tcp_input.c
+25-2sys/netinet/tcp_subr.c
+20-3sys/netinet/tcp_stacks/rack.c
+447-1713 files not shown
+470-1739 files

HardenedBSD/src 3b62f6fcontrib/libarchive/libarchive archive_openssl_evp_private.h

HBSD: Resolve merge conflict

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-4contrib/libarchive/libarchive/archive_openssl_evp_private.h
+0-41 files

HardenedBSD/src c974604contrib/libarchive/libarchive archive_read_support_format_zip.c, contrib/libarchive/libarchive/test test_compat_lzip_4.tlz.uu test_compat_lzip_3.lz.uu

Merge remote-tracking branch 'internal/freebsd/13-stable/main' into hardened/13-stable/master

Conflicts:
        contrib/libarchive/libarchive/archive_openssl_evp_private.h (unresolved)
DeltaFile
+1,474-0contrib/libarchive/libarchive/test/test_compat_lzip_4.tlz.uu
+1,461-0contrib/libarchive/libarchive/test/test_compat_lzip_3.lz.uu
+1,290-0contrib/libarchive/unzip/bsdunzip.c
+0-1,132usr.bin/unzip/unzip.c
+840-0contrib/libarchive/unzip/la_queue.h
+340-178contrib/libarchive/libarchive/archive_read_support_format_zip.c
+5,405-1,310777 files not shown
+11,820-3,622783 files

HardenedBSD/src fce03f8sys/netinet tcp_input.c tcp_subr.c, sys/netinet/tcp_stacks sack_filter.c sack_filter.h

TCP can be subject to Sack Attacks lets fix this issue.

There is a type of attack that a TCP peer can launch on a connection. This is for sure in Rack or BBR and probably even the default stack if it uses lists in sack processing. The idea of the attack is that the attacker is driving you to look at 100's of sack blocks that only update 1 byte. So for example if you have 1 - 10,000 bytes outstanding the attacker sends in something like:

ACK 0 SACK(1-512) SACK(1024 - 1536), SACK(2048-2536), SACK(4096 - 4608), SACK(8192-8704)
This first sack looks fine but then the attacker sends

ACK 0 SACK(1-512) SACK(1025 - 1537), SACK(2049-2537), SACK(4097 - 4609), SACK(8193-8705)
ACK 0 SACK(1-512) SACK(1027 - 1539), SACK(2051-2539), SACK(4099 - 4611), SACK(8195-8707)
...
These blocks are making you hunt across your linked list and split things up so that you have an entry for every other byte. Has your list grows you spend more and more CPU running through the lists. The idea here is the attacker chooses entries as far apart as possible that make you run through the list. This example is small but in theory if the window is open to say 1Meg you could end up with 100's of thousands link list entries.

To combat this we introduce three things.

when the peer requests a very small MSS we stop processing SACK's from them. This prevents a malicious peer from just using a small MSS to do the same thing.
Any time we get a sack block, we use the sack-filter to remove sacks that are smaller than the smallest v4 mss (minus 40 for max TCP options) unless it ties up to snd_max (since that is legal). All other sacks in theory should be at least an MSS. If we get such an attacker that means we basically start skipping all but MSS sized Sacked blocks.
The sack filter used to throw away data when its bounds were exceeded, instead now we increase its size to 15 and then throw away sack's if the filter gets over-run to prevent the malicious attacker from over-running the sack filter and thus we start to process things anyway.
The default stack will need to start using the sack-filter which we have talked about in past conference calls to take full advantage of the protections offered by it (and reduce cpu consumption when processing sacks).


    [4 lines not shown]
DeltaFile
+266-150sys/netinet/tcp_stacks/sack_filter.c
+78-13sys/netinet/tcp_stacks/sack_filter.h
+29-2sys/netinet/tcp_stacks/bbr.c
+29-1sys/netinet/tcp_input.c
+25-2sys/netinet/tcp_subr.c
+20-3sys/netinet/tcp_stacks/rack.c
+447-1713 files not shown
+470-1739 files

HardenedBSD/src d71a87frelease Makefile.vm

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+2-1release/Makefile.vm
+2-11 files

HardenedBSD/src baa30bdsys/netinet in_pcb.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+4-0sys/netinet/in_pcb.c
+4-01 files

HardenedBSD/src 9287d18release Makefile.vm

release: Use qemu when cross-building vm images

For a bit over 5 years, we have used qemu when cross-building cloudware
images; in particular, it's necessary when installing packages which
might include post-install scripts.

Use qemu in the vm-images target too; while "generic" vm images don't
install packages, they still run newaliases and /etc/rc.d/ldconfig,
both of which fail without appropriate emulation.

MFC after:      1 week
DeltaFile
+2-1release/Makefile.vm
+2-11 files

HardenedBSD/src 0dd05e9contrib/one-true-awk run.c awk.1

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+4-240contrib/one-true-awk/run.c
+0-52contrib/one-true-awk/awk.1
+20-14contrib/one-true-awk/b.c
+0-24contrib/one-true-awk/ChangeLog
+0-23contrib/one-true-awk/parse.c
+1-19contrib/one-true-awk/awkgram.y
+25-37212 files not shown
+63-40518 files

HardenedBSD/src 1023317contrib/one-true-awk run.c awk.1

ota: Merge one true awk 20240422 (a3b68e649d2d)

Apr 22, 2024:
        fixed regex engine gototab reallocation issue that was
        introduced during the Nov 24 rewrite. Thanks to Arnold Robbins.
        Fixed a scan bug in split in the case the separator is a single
        character. thanks to Oguz Ismail for spotting the issue.

Mar 10, 2024:
        fixed use-after-free bug in fnematch due to adjbuf invalidating
        the pointers to buf. thanks to github user caffe3 for spotting
        the issue and providing a fix, and to Miguel Pineiro Jr.
        for the alternative fix.
        MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max.
        thanks to Miguel Pineiro Jr.

Sponsored by:           Netflix
DeltaFile
+4-240contrib/one-true-awk/run.c
+0-52contrib/one-true-awk/awk.1
+20-14contrib/one-true-awk/b.c
+0-24contrib/one-true-awk/ChangeLog
+0-23contrib/one-true-awk/parse.c
+1-19contrib/one-true-awk/awkgram.y
+25-3728 files not shown
+44-39514 files

HardenedBSD/src 4fc5f32share/man/man5 rc.conf.5

rc.conf.5: Fix translation from netmask to cdir

These two should have been 30 bit masks, not 32, as the original
netmasks were 255.255.255.252.

Fixes: cb808de400c7
Noticed by: Kelly Hays
DeltaFile
+2-2share/man/man5/rc.conf.5
+2-21 files

HardenedBSD/src 3f65000sys/fs/nfs nfs_var.h, sys/fs/nfsserver nfs_nfsdport.c nfs_nfsdserv.c

nfsd: Fix Link conformance with RFC8881 for delegations

RFC8881 specifies that, when a Link operation occurs on an
NFSv4, that file delegations issued to other clients must
be recalled.  Discovered during a recent discussion on nfsv4 at ietf.org.

Although I have not observed a problem caused by not doing
the required delegation recall, it is definitely required
by the RFC, so this patch makes the server do the recall.

Tested during a recent NFSv4 IETF Bakeathon event.

MFC after:      1 week
DeltaFile
+7-5sys/fs/nfsserver/nfs_nfsdport.c
+9-2sys/fs/nfsserver/nfs_nfsdserv.c
+1-1sys/fs/nfs/nfs_var.h
+17-83 files

HardenedBSD/src 41f7fa0contrib/libfido2/.actions build-bsd fuzz-linux, contrib/libfido2/.github/ISSUE_TEMPLATE bug_report.md

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+168-9contrib/libfido2/src/webauthn.h
+97-0contrib/libfido2/.actions/build-bsd
+93-0contrib/libfido2/.actions/fuzz-linux
+80-0contrib/libfido2/.github/ISSUE_TEMPLATE/bug_report.md
+67-1contrib/libfido2/src/assert.c
+39-29share/man/man4/ahc.4
+544-39128 files not shown
+2,052-365134 files

HardenedBSD/src 518d2e1lib/libc/sys gettimeofday.2, share/man/man4 vmm.4

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+22-1lib/libc/sys/gettimeofday.2
+14-1share/man/man4/vmm.4
+5-1share/man/man9/style.9
+41-33 files

HardenedBSD/src 6f44401lib/clang/include/llvm/Config llvm-config.h AsmPrinters.def

lib/clang: clean out old llvm/clang Sparc target remnants

The WITH_LLVM_TARGET_ENABLE_SPARC option was removed a long time ago,
but some ifdefs were still laying around, so clean them up.

PR:             276104
MFC after:      3 days
DeltaFile
+0-4lib/clang/include/llvm/Config/llvm-config.h
+0-3lib/clang/include/llvm/Config/AsmPrinters.def
+0-3lib/clang/include/llvm/Config/Disassemblers.def
+0-3lib/clang/include/llvm/Config/Targets.def
+0-3lib/clang/include/llvm/Config/AsmParsers.def
+0-165 files

HardenedBSD/src 1c25f3f. run.c awk.1

ota: Import One True Awk 20240422 (a3b68e649d2d)

Apr 22, 2024:
        fixed regex engine gototab reallocation issue that was
        introduced during the Nov 24 rewrite. Thanks to Arnold Robbins.
        Fixed a scan bug in split in the case the separator is a single
        character. thanks to Oguz Ismail for spotting the issue.

Mar 10, 2024:
        fixed use-after-free bug in fnematch due to adjbuf invalidating
        the pointers to buf. thanks to github user caffe3 for spotting
        the issue and providing a fix, and to Miguel Pineiro Jr.
        for the alternative fix.
        MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max.
        thanks to Miguel Pineiro Jr.

Note: This brings in the matchop-deref.* files that were missing (but in
FreeBSD already) and adds system-stauts.ok2. The latter has been deleted
in FreeBSD since it does not fit ATF well. Care must be taken to remove it

    [3 lines not shown]
DeltaFile
+4-240run.c
+0-52awk.1
+20-14b.c
+0-24ChangeLog
+0-23parse.c
+1-19awkgram.y
+25-37212 files not shown
+60-39518 files

HardenedBSD/src 60a517bcontrib/libfido2/.actions build-bsd fuzz-linux, contrib/libfido2/.github/ISSUE_TEMPLATE bug_report.md

libfido2: update to 1.14.0

Sponsored by:   The FreeBSD Foundation
DeltaFile
+168-9contrib/libfido2/src/webauthn.h
+97-0contrib/libfido2/.actions/build-bsd
+93-0contrib/libfido2/.actions/fuzz-linux
+80-0contrib/libfido2/.github/ISSUE_TEMPLATE/bug_report.md
+67-1contrib/libfido2/src/assert.c
+60-3contrib/libfido2/src/winhello.c
+565-1357 files not shown
+1,646-12463 files

HardenedBSD/src cb808deshare/man/man5 rc.conf.5

rc.conf.5: modernise network_interfaces

It's not 1996 anymore, and we use CIDR nowadays.  Update the various
ifconfig_ examples to use CIDR notation instead of netmasks, and also
add an example of a basic ifconfig_ entry that most users will be
interested in.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1217
DeltaFile
+37-20share/man/man5/rc.conf.5
+37-201 files

HardenedBSD/src 894cb08lib/clang/include VCSVersion.inc, lib/clang/include/clang/Basic Version.inc

Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9

Update version numbers, config headers, etc. Git tricked me into losing
these before pushing.

PR:             276104
Fixes:          d67fc74b9249
MFC after:      3 days
DeltaFile
+3-3lib/clang/include/lldb/Version/Version.inc
+3-3lib/clang/include/VCSVersion.inc
+3-3lib/clang/include/clang/Basic/Version.inc
+2-2lib/clang/include/llvm/Config/llvm-config.h
+2-2lib/clang/include/llvm/Config/config.h
+1-1lib/clang/include/lld/Common/Version.inc
+14-141 files not shown
+15-157 files

HardenedBSD/src 5678d1dcontrib/llvm-project/clang/lib/CodeGen CGObjCGNU.cpp CGBuiltin.cpp, contrib/llvm-project/clang/lib/Format UnwrappedLineParser.cpp

Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9.

PR:             276104
MFC after:      3 days
DeltaFile
+28-20contrib/llvm-project/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+23-17contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp
+20-14contrib/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp
+16-13contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
+14-11contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp
+16-4contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+117-7921 files not shown
+200-12827 files

HardenedBSD/src 0ad9b23usr.sbin/arp arp_netlink.c

arp(8): fix a typo in error message for -s/-S

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1214
DeltaFile
+1-1usr.sbin/arp/arp_netlink.c
+1-11 files

HardenedBSD/src 9a62cdclib/libsys intro.2

intro.2 as errno.2: Use the name macro for errno

Reviewed by: imp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1192
DeltaFile
+7-6lib/libsys/intro.2
+7-61 files

HardenedBSD/src 69ff2d7lib/libsys intro.2

intro.2: Add sys/syscall.h to SYNOPSIS

MFC after:      1 week
Co-authored-by: brooks
Reviewed by:    brooks, emaste, imp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1192
DeltaFile
+1-0lib/libsys/intro.2
+1-01 files

HardenedBSD/src 6dfbe69lib/libsys intro.2

intro.2 as errno.2: Update maximum hard link limit

MFC after:      1 week
Co-authored-by: brooks
Reviewed by:    brooks, emaste, imp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1192
DeltaFile
+7-2lib/libsys/intro.2
+7-21 files

HardenedBSD/src 6279646share/man/man4 ahc.4 ahd.4, sys/dev/aic7xxx aic79xx.c aic7xxx.c

aic7xxx: make target mode enable a device hint

Previously it was only possible to enable target mode for these drivers
by rebuilding the kernel with AHC_TMODE_ENABLE or AHD_TMODE_ENABLE and a
bitmask of which units to statically enable for target mode.

There is no space-savings in the driver by not having AHC_TMODE_ENABLE
set, so in addition to the compile time option lets also introduce some
tunables:

hint.ahc.<unit>.tmode_enable=0/1
hint.ahd.<unit>.tmode_enable=0/1

For compatibility the old behavior is retained, but it can be overridden
with tunables

Signed-off-by: HP van Braam <hp at tmm.cx>
Reviewed by: imp, mav
Pull Request: https://github.com/freebsd/freebsd-src/pull/1208
DeltaFile
+39-29share/man/man4/ahc.4
+24-12share/man/man4/ahd.4
+18-1sys/dev/aic7xxx/aic79xx.c
+18-1sys/dev/aic7xxx/aic7xxx.c
+99-434 files

HardenedBSD/src 34db47asys/dev/aic7xxx/aicasm aicasm_symbol.c, sys/modules/aic7xxx/ahc Makefile

aic7xxx: aicasm correct include file

aicasm just puts the value of the "-i" passed include file in the
generated file with quotes around it. This means that there are manual
edits made to aic7xxx_reg_print.c and aic79xx_reg_print.c

now we check to see if the value passed to '-i' starts with a '<', if it
does don't output the quotes.

Signed-off-by: HP van Braam <hp at tmm.cx>
Reviewed by: imp (minor code simplification)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1209
DeltaFile
+5-2sys/dev/aic7xxx/aicasm/aicasm_symbol.c
+2-2sys/modules/aic7xxx/ahd/Makefile
+1-1sys/modules/aic7xxx/ahc/Makefile
+8-53 files

HardenedBSD/src 758d02ftools/build checkstyle9.pl

checkstyle9: Relax sob line requirement
DeltaFile
+1-1tools/build/checkstyle9.pl
+1-11 files

HardenedBSD/src 2f9966flibexec/rc/rc.d Makefile, release/packages Makefile.package

packages: add package for NTP

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1193
DeltaFile
+5-2usr.sbin/periodic/etc/daily/Makefile
+4-2libexec/rc/rc.d/Makefile
+2-0release/packages/Makefile.package
+1-0usr.sbin/ntp/doc/drivers/icons/Makefile
+1-0usr.sbin/ntp/doc/Makefile
+1-0usr.sbin/ntp/doc/drivers/Makefile
+14-416 files not shown
+30-422 files

HardenedBSD/src 76f866fshare/man/man4 vmm.4

vmm.4: Add verbiage about need to load module from loader.conf

PR:             277530
MFC after:      1 week
Co-authored-by: Mateusz Piotrowski <0mp at FreeBSD.org>

(cherry picked from commit d0168b32bc67033414e43f07eff2a4e850652c29)
DeltaFile
+14-1share/man/man4/vmm.4
+14-11 files

HardenedBSD/src 7de39f9share/man/man4 vmm.4

vmm.4: Add verbiage about need to load module from loader.conf

PR:             277530
MFC after:      1 week
Co-authored-by: Mateusz Piotrowski <0mp at FreeBSD.org>

(cherry picked from commit d0168b32bc67033414e43f07eff2a4e850652c29)
DeltaFile
+14-1share/man/man4/vmm.4
+14-11 files

HardenedBSD/src cecda19share/man/man9 style.9

style.9: Document the existence of tools/build/checkstyle9.pl

MFC after:      3 days
Sponsored by:   Klara, Inc.

(cherry picked from commit 5626f9e790901999def12040a60746b0ceeb9b95)
DeltaFile
+5-1share/man/man9/style.9
+5-11 files