LinuxKPI: Add drm support to dev_is_pci() function
drmn driver is attached to PCI bus via intermediate vgapci driver.
Check for it presence in device tree branch too to handle drm-kmod
cases.
MFC after: 2 month
Reviewed by: emaste (LGTM)
Differential Revision: https://reviews.freebsd.org/D60138
vt_vga: repost only a vgapci(4) video device
When vt(4) falls back to vt_vga, vga_init() passes vd_video_dev to
vga_pci_repost(), which expects a vgapci(4) device. The framebuffer
driver that set it need not provide one: drm-kmod's linux_fb passes the
parent of the DRM parent device, which is vgapci for LinuxKPI PCI
drivers but the PCI bus for virtio-gpu, whose DRM parent is the virtio
PCI transport. On x86, vga_pci_repost() then calls pci_get_class() on
the bus, which fails the accessor's KASSERT under INVARIANTS; without
INVARIANTS the class reads as 0 and the repost is skipped. Repost only
a vgapci device.
Signed-off-by: Denis Borovikov <denis.borovikov at gmail.com>
Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D60880
bnxt: avoid unintialized use of media_type in bnxt_add_media_types()
When 5e6e4f752833 landed, it inadvertently allowed unsupported / unknown
phys with a valid link_info->sig_mode to use media_type uninitialized.
Fix this by returning from those cases that do not assign a media_type
so as to avoid using it uninitialized.
Reported by: imp (forwarding an llm's post-commit review of previous
changes to this file)
Fixes: 5e6e4f752833
Reviewed by: imp, kbowling, sumit.saxena_broadcom.com
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61164
iflib: prefer simple_tx over mp_ring
In preparation for removing mp_ring, enable simple_tx by default.
Users encountering bugs are still able to set the tunable:
net.iflib.prefer_mpring="1"
at boot, but are encouraged to report any regressions so they
can be fixed.
My plan is to remove mp_ring assuming no major bugs are found in
simple_tx after a month or two.
Reviewed by: kbowling, netchild, rcm
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61166
ixgbe: Guard E610 Link Default Override access
Reading Link Default Override uses the E610 Admin Command Interface,
whose mutex is initialized only on E610. Calling it on other adapters
can hang attach, as observed on X520.
Skip the read on non-E610 devices, leaving the cached policy invalid so
that the existing link-state guard also skips force-link commands.
Reviewed by: kgalazka
Fixes: 7868958f5c79 ("ix(4): Support Total Port Shutdown on E610")
MFC after: 1 week
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D61144
bhyve: check paddr_guest2host return in _vq_record
_vq_record() stored the result of paddr_guest2host() without checking for
NULL. A guest descriptor with an invalid address causes a NULL dereference
in every virtio driver. Return early on failure; the caller sees zero
descriptors and discards the chain.
The indirect path already performs this check (line 357).
Reviewed by: bnovkov
Differential Revision: https://reviews.freebsd.org/D60870
MFC after: 1 week
ports-mgmt/pkg: update to 2.9.0
Major changes
=============
- Security hardening everywhere
- libpkg: add the pkg_repo_meta_extra() API
- full support for musl
- keys: fall back on the host keys when using a root directory
- pkg set -v: store the vital flag as a user override combined with the
package's own flag
- clean: keep the exact archives of the installed packages
- db: add out-of-schema pkg_local and pkg_attr to improve changes
without schema incompatibilities
- upgrade/install: report why each installed package that the plan
removes
- upgrade/install: require an explicit confirmation before removing
explicitly installed packages
- upgrade/install: require an explicit confirmation before removing
explicitly installed packages
[36 lines not shown]
ports-mgmt/pkg-devel: 2.8.99.6
Changes since 2.8.99.4:
- Lots of hardening
- rwhich performances improvements
- repo: do not keep a meta file which failed its verification
- triggers: honour RUN_SCRIPTS
- pkg add: remove the temporary files and directories left by a failed
extraction
- libfetch: sync with FreeBSD-current
- config: do not warn about an OS upgrade when the ABI describes another OS
- update all vendors software
- support for ML-DSA
- db: the read-only commands can read a database created by an older
pkg(8) requiring upgrade of the schema
cap_enter(2): stricter checks
- single-thread the process
Make cap_enter() a serialization point, ensuring that no threads are
executing with old credentials cached after the syscall returned.
- disallow entering capability mode if the file descriptor table or pwd
are shared. They are shared after rfork(2), and allowing it lets another
process grant additional privileges to the process in capability mode.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D60963
kern: do not allow unprivileged chroot when pwd is shared
Unprivileged chroot(2), fchroot(2), chaltroot(2), and fchaltroot(2)
rely on PROC_NO_NEW_PRIVS to make set-ID images harmless under the
new root. But the pwddesc can be shared by rfork(2) without RFFDG
with a process that has not enabled PROC_NO_NEW_PRIVS, and the
change of the root affects that process as well. It can then
execute a set-ID image whose ELF interpreter is resolved under the
root controlled by the caller.
Refuse the unprivileged operations when the pwddesc is shared.
Processes that start sharing it later are created by the caller and
inherit PROC_NO_NEW_PRIVS.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D60963
pwddesc: add sharecount
The pd_refcount field counts both sharing processes and the transient
pdhold() references taken by sysctls and mountcheckdirs(), so it
cannot answer "is this pwddesc shared". As a result pdunshare() made
needless copies while the pwddesc was held, and a copy made while
mountcheckdirs() held it lost the cwd/root update.
Add pd_sharecount, counting only processes using the pwddesc, and use
it for the sharing decision. Existing pd_refcount still manages the
lifetime.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D60963
Makefile.inc1: Fix bare $ characters
The '$' characters inside awk commands need to be $$ when appearing
inside a Makefile. Without this, we generate empty src and src-sys
packages.
Reported by: Stefan Grundmann
Fixes: a8be89928930 ("build: Support got")
MFC after: 1 day
(cherry picked from commit 6a99232c75f6460b03a95019e2625828a158d457)
sdiob: copy vendor/device IDs from card common CIS
Copy both the vendor and device IDs from the card common CIS if they are
absent in a function.
These are optional according to the spec. [1]
[1] Part E1 SDIO Simplified Specification §16.6
MFC after: 3 days
Reviewed by: kibab, imp, adrian
Differential Revision: https://reviews.freebsd.org/D60988
auditd: Support logging directly to syslog
Every tenth call to auditwarnlog(), check that the audit_warn(5) script
exists and is executable by us. If it is, execute it as previously;
otherwise, fall back to calling syslog(3) directly.
Additionally, if we choose to use the script and fail, also log the
original message to syslogd, not just the fact that we failed to log.
We could record the result of trying to execute the script, but that
would require pausing while it runs (or at least until the execve(2)
call has completed).
Retesting every tenth call is a little clunky but avoids having to
restart or signal auditd(8) to force it to notice a change in
availability, or adding a command-line option and / or modifying the
audit_control(5) syntax to let the user express a preference.
MFC after: 1 week
[4 lines not shown]
audit_warn: Avoid pointless fork and path search
While here, document what the script actually does, not what it once did
on a project branch somewhere that was never merged.
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Qualys, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D60171