HardenedBSD/src 4333cf0sys/kern kern_cpu.c, sys/x86/cpufreq hwpstate_amd.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+144-54sys/x86/cpufreq/hwpstate_amd.c
+2-6sys/kern/kern_cpu.c
+1-0tests/sys/netlink/test_rtnl_gre.c
+147-603 files

HardenedBSD/src 25d4a9bsys/kern kern_cpu.c, sys/x86/cpufreq hwpstate_amd.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+144-54sys/x86/cpufreq/hwpstate_amd.c
+2-6sys/kern/kern_cpu.c
+1-0tests/sys/netlink/test_rtnl_gre.c
+147-603 files

HardenedBSD/src f1b93fcsys/x86/cpufreq hwpstate_amd.c

hwpstate_amd(4): Fix punctuation in 'desired_performance' knob's description

To be consistent with that of the others.

No functional change.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/x86/cpufreq/hwpstate_amd.c
+1-11 files

HardenedBSD/src b69a396sys/x86/cpufreq hwpstate_amd.c

hwpstate_amd(4): CPPC: Allow attaching even if CAPABILITY_1 cannot be read

If that MSR cannot be read, we fallback to defaults specified by the
ACPI specification, as we are already doing when the minimum and maximum
values in there look bogus.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55252
DeltaFile
+28-17sys/x86/cpufreq/hwpstate_amd.c
+28-171 files

HardenedBSD/src 953b916sys/kern kern_cpu.c

cpufreq(4): cpufreq_levels_sysctl(): Remove always false NULL test

'sc->levels_buf' is initialized with malloc(M_WAITOK), so can never be
NULL.  Another sysctl handler function (cpufreq_curr_sysctl()) already
relies on that.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-6sys/kern/kern_cpu.c
+2-61 files

HardenedBSD/src 80d32a6sys/x86/cpufreq hwpstate_amd.c

hwpstate_amd(4): CPPC: Switch the default to maximum performance

Set controls to maximum performance to avoid regressions now that CPPC
is activated by default and to match what the P-state support does.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55253
DeltaFile
+10-8sys/x86/cpufreq/hwpstate_amd.c
+10-81 files

HardenedBSD/src 7f36d7asys/x86/cpufreq hwpstate_amd.c

hwpstate_amd(4): Consistency of cached CPPC_REQUEST value

If writing to the CPPC_REQUEST MSR fails, make sure we do not set the
softc's 'cppc.request' field to the intended new value.  Both
set_cppc_request_cb() and enable_cppc_cb() were changed to this effect.

In case enable_cppc_cb() could not read CPPC_REQUEST, mark that through
a new softc flag, HWPFL_CPPC_REQUEST_NOT_READ, so that we do not keep
and use a wrong value when the content of CPPC_REQUEST is read/written
through sysctl(9) knobs, but instead retry reading the MSR (this is the
purpose of the new get_cppc_request() sub-function).

When setting CPPC_REQUEST has failed, distinguish the case where it
could not be read at all from the case where it could not be written, by
respectively returning EIO and EOPNOTSUPP in these cases.  The previous
return value of EFAULT was confusing as sysctl(3) documents it as
happening if the passed arguments are invalid.

While here, add some herald comment before sysctl_cppc_dump_handler()

    [5 lines not shown]
DeltaFile
+108-31sys/x86/cpufreq/hwpstate_amd.c
+108-311 files

HardenedBSD/src 1635ba9tests/sys/netlink test_rtnl_gre.c

gre tests: Add required_kmods to gre netlink test

Fixes: e1e18cc12e68
Differential Revision: https://reviews.freebsd.org/D54443
DeltaFile
+1-0tests/sys/netlink/test_rtnl_gre.c
+1-01 files

HardenedBSD/src 785fc3dsys/dev/asmc asmc.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+36-21sys/dev/asmc/asmc.c
+36-211 files

HardenedBSD/src c548b4dsys/dev/asmc asmc.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+36-21sys/dev/asmc/asmc.c
+36-211 files

HardenedBSD/src 22c97besys/netpfil/ipfilter/netinet fil.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+22-3sys/netpfil/ipfilter/netinet/fil.c
+22-31 files

HardenedBSD/src ef1cde5sys/dev/asmc asmc.c

chore: asmc: use designated initializers in macros

This code cleanup makes it easier for human readers to understand what each
of the fields actually represents, as well as makes it easier to modify
what the macros actually do under the covers, without introducing
potential human errors.

No functional change intended.

MFC after:      1 week
DeltaFile
+33-18sys/dev/asmc/asmc.c
+33-181 files

HardenedBSD/src 90edc16sys/dev/asmc asmc.c

asmc: use symbolic names with the MacPro3,1 model

Use `ASMC_LIGHT_FUNCS_DISABLED` and `ASMC_SMS_FUNCS_DISABLED` instead of
the unrolled versions of the macros.

This makes it easier to adjust the underlying macros/fields for
`struct asmc_model`.

No functional change intended.

MFC after:      1 week
DeltaFile
+2-2sys/dev/asmc/asmc.c
+2-21 files

HardenedBSD/src 7b862cfsys/dev/asmc asmc.c

asmc: use `ASMC_FAN_FUNCS2` with the Macmini4,1

The Macmini4,1 model does not have "fansafespeed" support. This issue
typically manifests with messages like so:

```
asmc0: asmc_key_read for key F0Sf failed 10 times, giving up
```

Swap out `ASMC_FAN_FUNCS` with `ASMC_FAN_FUNCS2` to explicitly drop
"fansafespeed" checks in the driver for the model as it doesn't support
that hardware feature.

MFC after:      1 week
Reported by:    @probonopd
Closes:         https://github.com/helloSystem/ISO/issues/357
DeltaFile
+1-1sys/dev/asmc/asmc.c
+1-11 files

HardenedBSD/src afaf984sys/netpfil/ipfilter/netinet fil.c

ipfilter: Interface name must not extend beyond end of buffer

sifpidx (an interface name) cannot extend beyond the end of the
fr_names buffer.

We do the validation for fr_sifpidx here because it is a union that
contains an offset only when fr_sifpidx points to an interface name,
an offset into fr_names. The union is  an offset into fr_names in this
case only.

interr_tbl now becomes a static variable outside a function to facilitate
its use by two functions within fil.c

Note that sifpidx is only used in ipf_sync() which implments ipf -y.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
MFC after:      1 week

(cherry picked from commit 47fb51847fdea3f1cce841b5f2bbbcd6f8a04ee0)
DeltaFile
+21-2sys/netpfil/ipfilter/netinet/fil.c
+21-21 files

HardenedBSD/src dda404esys/netpfil/ipfilter/netinet fil.c

ipfilter: Fix possible overrun

The destination buffer is FR_GROUPLEN (16 bytes) in length. When
gname is created, the userspace utilities correctly use FR_GROUPLEN
as the buffer length. The kernel should also limit its copy operation to
FR_GROUPLEN bytes to avoid any user written code from exploiting this
vulnerability.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>

(cherry picked from commit e40817302ebdf89df2f3bcd679fb7f2a18c244dc)
DeltaFile
+1-1sys/netpfil/ipfilter/netinet/fil.c
+1-11 files

HardenedBSD/src b4835c8sys/riscv/conf GENERIC, tools/build/mk OptionalObsoleteFiles.inc

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+54-22usr.sbin/bhyve/rfb.c
+17-9usr.sbin/bhyve/usb_mouse.c
+2-2tools/build/mk/OptionalObsoleteFiles.inc
+1-2usr.sbin/syslogd/tests/syslogd_format_test_common.sh
+1-0sys/riscv/conf/GENERIC
+75-355 files

HardenedBSD/src 670ba26sys/riscv/conf GENERIC, tools/build/mk OptionalObsoleteFiles.inc

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+54-22usr.sbin/bhyve/rfb.c
+17-9usr.sbin/bhyve/usb_mouse.c
+2-2tools/build/mk/OptionalObsoleteFiles.inc
+1-2usr.sbin/syslogd/tests/syslogd_format_test_common.sh
+1-0sys/riscv/conf/GENERIC
+75-355 files

HardenedBSD/src 35c46cdsys/x86/include x86_var.h, sys/x86/x86 cpu_machdep.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+123-8sys/x86/x86/cpu_machdep.c
+4-5sys/x86/include/x86_var.h
+127-132 files

HardenedBSD/src 218663dshare/mk src.opts.mk

HBSD: Resolve merge conflict

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

HardenedBSD/src 6bb4ef1crypto/openssl/crypto/ec ecp_nistz256_table.c, crypto/openssl/test ecdsatest.h quic_record_test.c

Merge remote-tracking branch 'internal/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        share/mk/src.opts.mk (unresolved)
DeltaFile
+28,572-0sys/contrib/dev/broadcom/brcm80211/brcmsmac/phy/phy_n.c
+14,894-9,513crypto/openssl/crypto/ec/ecp_nistz256_table.c
+10,184-10,183crypto/openssl/test/ecdsatest.h
+9,620-1,938crypto/openssl/test/quic_record_test.c
+10,099-0sys/contrib/dev/broadcom/brcm80211/brcmsmac/phy/phytbl_n.c
+8,689-0sys/contrib/dev/broadcom/brcm80211/brcmfmac/cfg80211.c
+82,058-21,6344,327 files not shown
+372,872-185,8574,333 files

HardenedBSD/src 10d5404usr.sbin/bhyve usb_mouse.c

bhyve: fix USB mouse requests

USB HCI requests may not include HCI transfer block structures (i.e.,
xfer->data[] == NULL), but in several places, the USB mouse emulation
code assumes one will exist. This can lead to a NULL pointer dereference
and a SEGV in the bhyve process as observed via experiments with an
Ubuntu guest and PyUSB code. Note that many of the cases processing
other request types already checked for data == NULL.

While in the neighborhood, fix a typo in the loop iterating over the
usb_data_xfer_block array which used the wrong variable to check for
valid data (idx vs. i).

Reported by: danmcd at edgecast.io
Obtained from: SmartOS
MFC after: 1 week
Relnotes: yes

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54661
DeltaFile
+17-9usr.sbin/bhyve/usb_mouse.c
+17-91 files

HardenedBSD/src e334b70sys/x86/include x86_var.h, sys/x86/x86 cpu_machdep.c

x86: provide extended description for x86_msr_op(9)

(cherry picked from commit cb81a9c18db93a2046c47b0c7dc0bd6adcdd2495)
DeltaFile
+43-0sys/x86/x86/cpu_machdep.c
+2-4sys/x86/include/x86_var.h
+45-42 files

HardenedBSD/src b0bc769sys/x86/x86 cpu_machdep.c

x86_msr_op(9): consistently return the value read from MSR

(cherry picked from commit 36ceb5509d01ff2e6482a78ca809c344574e9a25)
DeltaFile
+15-4sys/x86/x86/cpu_machdep.c
+15-41 files

HardenedBSD/src 0558fa8sys/x86/include x86_var.h, sys/x86/x86 cpu_machdep.c

x86: add a safe variant of MSR_OP_SCHED* operations for x86_msr_op(9)

(cherry picked from commit af99e40af1dd4e8b39ca986240ee8b9aea722958)
DeltaFile
+68-7sys/x86/x86/cpu_machdep.c
+2-1sys/x86/include/x86_var.h
+70-82 files

HardenedBSD/src c721ceeusr.sbin/syslogd/tests syslogd_format_test_common.sh

syslogd/tests: use kern.features to detect INET support

This fixes INET feature detection with kernel configs
that do not include the kern.conftxt sysctl, such as
riscv64 currently[0].

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/usr.sbin.syslogd/syslogd_forwarded_format_test/O_flag_bsd_forwarded_legacy/

Reviewed by:    markj
Approved by:    emaste (mentor)
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55383
DeltaFile
+1-2usr.sbin/syslogd/tests/syslogd_format_test_common.sh
+1-21 files

HardenedBSD/src 1e64949sys/riscv/conf GENERIC

riscv: GENERIC: enable KERN_TLS

This unskips 585 sys/kern/ktls_test testcases[0] in CI. All 585 tests currently pass.

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/sys.kern/

Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55376
DeltaFile
+1-0sys/riscv/conf/GENERIC
+1-01 files

HardenedBSD/src 818971cusr.sbin/bhyve rfb.c

bhyve: Fix unchecked stream I/O in RFB handler

Convert rfb_send_* helpers to return status codes and check their
results. Add missing checks for stream_read() and stream_write() returns
during the handshake in rfb_handle() to avoid acting on failed I/O.

Signed-off-by:  Hayzam Sherif <hayzam at gmail.com>

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55343
DeltaFile
+54-22usr.sbin/bhyve/rfb.c
+54-221 files

HardenedBSD/src 6d413b1sys/sys priv.h

HBSD: Resolve merge conflict

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

HardenedBSD/src 459685fshare/man/man4 vmm.4, sys/dev/vmm vmm_dev.c

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

Conflicts:
        sys/sys/priv.h (unresolved)
DeltaFile
+49-0tools/build/stddef.h
+39-0share/man/man4/vmm.4
+29-5sys/dev/vmm/vmm_dev.c
+15-15sys/sys/syscallsubr.h
+20-5usr.sbin/bhyve/bhyve.8
+19-0sys/sys/_offsetof.h
+171-2561 files not shown
+301-3467 files