HardenedBSD/src 574bee4share/man/man4 dtrace_pid.4, usr.sbin/bhyve bhyve_config.5 ipc.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+51-9usr.sbin/bhyvectl/bhyvectl.c
+22-2share/man/man4/dtrace_pid.4
+11-0usr.sbin/bhyve/ipc.c
+6-2usr.sbin/bhyvectl/bhyvectl.8
+1-2usr.sbin/bhyvectl/Makefile
+1-1usr.sbin/bhyve/bhyve_config.5
+92-166 files

HardenedBSD/src f4836deshare/man/man4 dtrace_pid.4, usr.sbin/bhyve bhyve_config.5 ipc.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+51-9usr.sbin/bhyvectl/bhyvectl.c
+22-2share/man/man4/dtrace_pid.4
+11-0usr.sbin/bhyve/ipc.c
+6-2usr.sbin/bhyvectl/bhyvectl.8
+1-2usr.sbin/bhyvectl/Makefile
+1-1usr.sbin/bhyve/bhyve_config.5
+92-166 files

HardenedBSD/src 7d22bd4sys/compat/linuxkpi/common/include/linux pm.h pci.h, sys/compat/linuxkpi/common/src linux_pci.c

Merge remote-tracking branch 'rad/hardened/15-stable/main' into hardened/15-stable/pledge
DeltaFile
+54-1sys/compat/linuxkpi/common/src/linux_pci.c
+36-0sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+34-1sys/compat/linuxkpi/common/include/linux/pci.h
+17-0sys/compat/linuxkpi/common/include/linux/pm.h
+4-6sys/dev/mlx4/mlx4_core/mlx4_catas.c
+3-5sys/dev/mthca/mthca_catas.c
+148-1313 files not shown
+182-2419 files

HardenedBSD/src 360c4eashare/man/man4 dtrace_pid.4, usr.sbin/bhyve bhyve_config.5 ipc.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+51-9usr.sbin/bhyvectl/bhyvectl.c
+22-2share/man/man4/dtrace_pid.4
+11-0usr.sbin/bhyve/ipc.c
+6-2usr.sbin/bhyvectl/bhyvectl.8
+1-2usr.sbin/bhyvectl/Makefile
+1-1usr.sbin/bhyve/bhyve_config.5
+92-166 files

HardenedBSD/src 601a434sys/compat/linuxkpi/common/include/linux pm.h pci.h, sys/compat/linuxkpi/common/src linux_pci.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+54-1sys/compat/linuxkpi/common/src/linux_pci.c
+36-0sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+34-1sys/compat/linuxkpi/common/include/linux/pci.h
+17-0sys/compat/linuxkpi/common/include/linux/pm.h
+4-6sys/dev/mlx4/mlx4_core/mlx4_catas.c
+3-5sys/dev/mthca/mthca_catas.c
+148-1313 files not shown
+182-2419 files

HardenedBSD/src ed60e57usr.sbin/bhyve bhyve_config.5 ipc.c, usr.sbin/bhyvectl Makefile bhyvectl.8

bhyvectl: support querying VM pid

Extend bhyvectl(8) to support querying VM pid using the
`--get-vm-pid` flag.

This is useful in monitor mode when the VM pid differs
from the main bhyve(8) process run by the user. Knowing the VM pid
is necessary, for example, to query process resource usage or
trigger ACPI shutdown with SIGTERM.

Of course, it could be obtained by matching the monitor process
children by the process title, but it's a little more complex
and fragile than it could be.

Implement that by adding the "get_vm_pid" IPC command,
and using it to implement `bhyvectl --get-vm-pid`, which
prints the VM PID.

When the VM PID is not known, ESRCH is returned.

    [4 lines not shown]
DeltaFile
+51-9usr.sbin/bhyvectl/bhyvectl.c
+11-0usr.sbin/bhyve/ipc.c
+6-2usr.sbin/bhyvectl/bhyvectl.8
+1-2usr.sbin/bhyvectl/Makefile
+1-1usr.sbin/bhyve/bhyve_config.5
+70-145 files

HardenedBSD/src 7008192share/man/man4 dtrace_pid.4

dtrace_pid.4: Add example "Listing Program's Function Entries"

Reviewed by:    bcr
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57515
DeltaFile
+22-2share/man/man4/dtrace_pid.4
+22-21 files

HardenedBSD/src f0c0168bin/dd args.c, bin/ed io.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+9-5bin/dd/args.c
+5-1usr.sbin/bhyveload/bhyveload.c
+2-2usr.sbin/pkg/pkg.c
+2-2sys/arm/mv/mv_cp110_icu.c
+2-2bin/ls/print.c
+1-1bin/ed/io.c
+21-136 files

HardenedBSD/src 9809f65bin/dd args.c, bin/ed io.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+9-5bin/dd/args.c
+5-1usr.sbin/bhyveload/bhyveload.c
+2-2usr.sbin/pkg/pkg.c
+2-2sys/arm/mv/mv_cp110_icu.c
+2-2bin/ls/print.c
+1-1bin/ed/io.c
+21-136 files

HardenedBSD/src fada884. UPDATING, usr.sbin/bhyve pci_nvme.c

Merge remote-tracking branch 'rad/hardened/15-stable/main' into hardened/15-stable/pledge
DeltaFile
+10-0UPDATING
+1-1usr.sbin/bhyve/pci_nvme.c
+11-12 files

HardenedBSD/src 23e05c0bin/dd args.c, bin/ed io.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+9-5bin/dd/args.c
+5-1usr.sbin/bhyveload/bhyveload.c
+2-2usr.sbin/pkg/pkg.c
+2-2sys/arm/mv/mv_cp110_icu.c
+2-2bin/ls/print.c
+1-1bin/ed/io.c
+21-136 files

HardenedBSD/src 2b9f0b3. UPDATING, usr.sbin/bhyve pci_nvme.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+10-0UPDATING
+1-1usr.sbin/bhyve/pci_nvme.c
+11-12 files

HardenedBSD/src 47f9e66usr.sbin/pkg pkg.c

pkg(7): Preserve const qualifier on strrchr(3) results

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59777
DeltaFile
+2-2usr.sbin/pkg/pkg.c
+2-21 files

HardenedBSD/src cc61cc7bin/ls print.c

ls(1): Preserve const qualifier on strstr(3) result

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59774
DeltaFile
+2-2bin/ls/print.c
+2-21 files

HardenedBSD/src 066fad8bin/ed io.c

ed(1): Preserve const qualifier on strchr(3) result

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59773
DeltaFile
+1-1bin/ed/io.c
+1-11 files

HardenedBSD/src 225612cbin/dd args.c

dd(1): Preserve const qualifier on bsearch(3) results

Reviewed by:    fuz, dteske
Approved by:    fuz (mentor), dteske (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59754
DeltaFile
+9-5bin/dd/args.c
+9-51 files

HardenedBSD/src 4c6e74a. UPDATING, sys/sys param.h

UPDATING: bump __FreeBSD_version to 1501503 for LinuxKPI changes

The size of multiple embedded structs have changed and may lead to
problems (pci_error_handlers in pci_driver, dev_pm_info in struct device).
Allow these changes to be detected by bumping __FreeBSD_version.

(cherry picked from commit e1ad124136deb4f270d4cef759bf9e9debdb17d3)
DeltaFile
+6-0UPDATING
+1-1sys/sys/param.h
+7-12 files

HardenedBSD/src 3ff1aeasys/compat/linuxkpi/common/include/linux pci.h

LinuxKPI: pci: add reset_{prepare,done} to pci_error_handlers

Needed by an upcoming wireless driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58882

(cherry picked from commit c40219c572df8b4b0c2392ee341d93bc82e6076b)
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/pci.h
+2-01 files

HardenedBSD/src 9b0e737sys/compat/linuxkpi/common/src linux_80211.c linux_80211_macops.c

LinuxKPI: 802.11: Always lock around lkpi_80211_mo_{remove_interface,stop}()

Add the missing locking to another two MO driver downcalls, as drivers
always expect it (e.g. rtw89 by assertion).

Add the lock and might_sleep assertions to the respective lkpi_80211_mo_*
downcalls.

PR:             298417
Reviewed by:    bz
Differential Revision: https://reviews.freebsd.org/D59608

(cherry picked from commit 73166d21bd831db264509cbdce1ab3b63ab5b189)
DeltaFile
+6-0sys/compat/linuxkpi/common/src/linux_80211_macops.c
+2-0sys/compat/linuxkpi/common/src/linux_80211.c
+8-02 files

HardenedBSD/src 28ca279sys/compat/linuxkpi/common/include/linux pm.h, sys/compat/linuxkpi/common/src linux_compat.c

LinuxKPI: add can_wakeup option and accessor functions

We can implement device_set_wakeup_capable() in the !CONFIG_PM_SLEEP
case;  we do not have the infrastructure in place for the CONFIG_PM_SLEEP
case so leave a pr_debug TODO.

Needed by an upcoming wireless driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58883

(cherry picked from commit a424fb3519ebf8fb972e7ba45ba19df322992b00)
DeltaFile
+17-0sys/compat/linuxkpi/common/include/linux/pm.h
+6-0sys/compat/linuxkpi/common/src/linux_compat.c
+23-02 files

HardenedBSD/src 5fd93b6sys/compat/linuxkpi/common/include/linux pci.h, sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: add PCI_IRQ_AFFINITY #define

Add the #define for PCI_IRQ_AFFINITY and leave a pr_debug note in
pci_alloc_irq_vectors() that it is unimplemented.

The flag is needed by an upcoming WiFi driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58881

(cherry picked from commit b589e403a2c3bd2a94fb2ab88cd23255c68a9f05)
DeltaFile
+3-0sys/compat/linuxkpi/common/src/linux_pci.c
+1-0sys/compat/linuxkpi/common/include/linux/pci.h
+4-02 files

HardenedBSD/src e44083csys/compat/linuxkpi/common/include/linux types.h

LinuxKPI: add typedef for clockid_t

Needed by a wireless driver (not really using it) to compile.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58877

(cherry picked from commit 401d0922a4bfcf40d3ae1866a0d90f955264def0)
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/types.h
+2-01 files

HardenedBSD/src 0b1dea8sys/compat/linuxkpi/common/include/linux dma-mapping.h, sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: implement dma_{alloc,free}_{noncoherent,attrs}

We use one to implement the other given direction stays unused.

This is needed by an upcoming wifi driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58880

(cherry picked from commit c3fa17a6a331db8aad03e9cb89ba97e1811ab381)
DeltaFile
+50-0sys/compat/linuxkpi/common/src/linux_pci.c
+36-0sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+86-02 files

HardenedBSD/src 4909288sys/compat/linuxkpi/common/include/linux interrupt.h pci.h, sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: fix argument type to lkpi_pci_msi_desc_alloc()

lkpi_pci_msi_desc_alloc() takes an unsigned int, not an int.
While here make sure the prototype is visibile in interrupt.h as
well before use to avoid -Wimplicit-function-declaration errors.

Discovered while working on a wireless driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58879

(cherry picked from commit cfb23b01e269e8a0a84066637b82b746f01b46b4)
DeltaFile
+2-1sys/compat/linuxkpi/common/include/linux/pci.h
+1-1sys/compat/linuxkpi/common/src/linux_pci.c
+1-0sys/compat/linuxkpi/common/include/linux/interrupt.h
+4-23 files

HardenedBSD/src 67c01ebsys/compat/linuxkpi/common/include/linux pci.h

LinuxKPI: pci: add pci_select_bars() and pci_msix_vec_count()

For pci_select_bars() we use the LinuxKPI internal information, while
for pci_select_bars() we fall back to the native PCI stack.

Needed by a wifi driver.

Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58878

(cherry picked from commit 55c07af60172b211116be47010fc0831aafc99e8)
DeltaFile
+29-0sys/compat/linuxkpi/common/include/linux/pci.h
+29-01 files

HardenedBSD/src a8420c2sys/compat/linuxkpi/common/include/linux ethtool.h

LinuxKPI: add #include of rculist.h to ethtool.h for Linux conformance

Add #include rculist.h to ethtool.h to fullfill expectations of
Linux drivers without having to modify them.

Reviewed by:    dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D58874

(cherry picked from commit 4570a1bf760a3cd63eb7dd9e3ebbc3cf103bda4d)
DeltaFile
+2-1sys/compat/linuxkpi/common/include/linux/ethtool.h
+2-11 files

HardenedBSD/src 6aef530sys/dev/mlx5/mlx5_core mlx5_health.c

mlx5: remove init_timer()

The init_timer() was there from day one in (dc7e38ac4da50).  It was
never needed as the setup_timer() below already did more than just
that part of the job.
This is part of trying to clear up the Linux pre-4.15 timer KPI
from LinuxKPI.

Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59681

(cherry picked from commit 3769ee9bc4167d4f508ba4f14cf544dedf7c520e)
DeltaFile
+0-1sys/dev/mlx5/mlx5_core/mlx5_health.c
+0-11 files

HardenedBSD/src c1a87absys/compat/linuxkpi/common/include/linux rculist.h

LinuxKPI: rcu: add optional condition to list_for_each_entry_rcu()

list_for_each_entry_rcu() can take an optional condition.  Add the
macro argument so code remains compiling but do not do anything with
it just yet.

Leave comments as list_for_each_entry_rcu() likely should have a
different implementation.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D59292

(cherry picked from commit e975ce86ff11a330128f5b21c7cd11c28d3aff87)
DeltaFile
+4-2sys/compat/linuxkpi/common/include/linux/rculist.h
+4-21 files

HardenedBSD/src e03abecsys/dev/mlx4/mlx4_en en.h mlx4_en_cq.c

mlx4: convert to timer_setup() Linux KPI

The Linux driver switched away from using this timer in e22979d96a55d.
Locally adjust the code to use timer_setup/from_timer in order to get
us out of Linux version 4.15 (and earlier) KPIs.
Also, right away, apply 41cb08555c416 from_timer -> timer_container_of.

Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59680

(cherry picked from commit 871c09c9b47eb0ef0f17a5a1fc2299dba7693516)
DeltaFile
+1-3sys/dev/mlx4/mlx4_en/mlx4_en_cq.c
+2-2sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
+1-1sys/dev/mlx4/mlx4_en/en.h
+4-63 files

HardenedBSD/src d7eb529sys/dev/mlx4/mlx4_core mlx4_catas.c

mlx4: apply upstream changes to convert to timer_setup() Linux KPI

Apply Linux change 55c0fcc3de460 "Convert timers to use timer_setup()"
to get us out of Linux version 4.15 (and earlier) KPIs.
Also apply 41cb08555c416 from_timer -> timer_container_of.

Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59679

(cherry picked from commit 272138c279dd1954f3fb88d9e0b2874db74597a3)
DeltaFile
+4-6sys/dev/mlx4/mlx4_core/mlx4_catas.c
+4-61 files