icmp6: clear csum_flags on mbuf reuse
When icmp6 sends an ICMPv6 message, it reuses the mbuf of the packet
that triggered the ICMPv6 message and prepends an IPv6 and ICMPv6
header. For a locally generated packet with checksum offloading, the
mbuf still has csum_flags set indicating that a SCTP/TCP/UDP checksum
has to be computed and inserted. Since this not the case anymore,
csum_flags need to be cleared.
PR: 293227
Reviewed by: kp, zlei, tuexen
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D55367
(cherry picked from commit ada4dc77577f7162353e8c2916ba5c258b6210f0)
vmm: Add privilege checks to vmmctl operations
In preparation for supporting creation of VMs by unprivileged users, add
some restrictions:
- Disallow creation of non-transient VMs by unprivileged users. That
is, if an unprivileged user creates a VM, the VM must be destroyed
automatically once the last fd referencing it is gone.
- Disallow destroying VMs created by a different user, unless the caller
has the PRIV_VMM_DESTROY privilege.
Reviewed by: bnovkov
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54740
vmm: Enable unprivileged bhyve
- Add the vmm group.
- Let /dev/vmmctl belong to the vmm group by default, and give group
write permissions.
- When creating a VM's device files, make them owned by the creating
process' effective UID.
Reviewed by: bnovkov
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54741
vmm: Start using exterror
For now, just describe the error where an unprivileged user attempts to
run a VM without DESTROY_ON_CLOSE semantics, i.e., monitor mode.
Reviewed by: bnovkov
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54743
vmm.4: Add information on VM access control
Add a section to vmm.4 explaining how vmm device file ownership works.
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D54742
types.h: use central definition of offsetof()
Previously this broke if included after (sys/)stddef.h.
Reported by: des
Fixes: 2adc3f0db187 ("stddef.h: centralize definition of offsetof()")
libpfctl: Sort order of snl attribute parser
snl atttribute parsers must be sorted by type, so PF_GS_BCOUNTERS
(16) must follow PF_GF_PCOUNTERS (15). Fix ordering and add a call
to SNL_VERIFY_PARSERS.
Without this fix, byte counters reported by 'pfctl -s info' with
a loginterface are always zero.
PR: 291763
MFC after: 1 week
Reviewed by: kp
Signed-off-by: eborisch at gmail.com
(cherry picked from commit 363b57d579bafa8a52cfb5a1dcb98af821b1ecb6)
.github: support all stable branches
If this eventually poses a problem for unsupported branches we can fix
them directly.
Sponsored by: Innovate UK
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53838
stddef.h: centralize definition of offsetof()
Move to sys/_offsetof.h and use __builtin_offsetof() instead of
__offsetof to avoid reintroducing sys/cdefs.h polution in stddef.h.
This has the side effect of allowing sys/stddef.h to be included after
stddef.h which can happen in compatability headers.
Effort: CHERI upstreaming
Sponsored by: DARPA, AFRL
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D55307
stddef.h: add ptraddr_t
I'd missed that stddef.h is standalone and isn't a copy of sys/stddef.h
in my initial merge.
Effort: CHERI upstreaming
Reviewed by: kib
Sponsored by: Innovate UK
Fixes: dca634d1544b ("new type: ptraddr_t")
Differential Revision: https://reviews.freebsd.org/D55305
icmp6: clear csum_flags on mbuf reuse
When icmp6 sends an ICMPv6 message, it reuses the mbuf of the packet
that triggered the ICMPv6 message and prepends an IPv6 and ICMPv6
header. For a locally generated packet with checksum offloading, the
mbuf still has csum_flags set indicating that a SCTP/TCP/UDP checksum
has to be computed and inserted. Since this not the case anymore,
csum_flags need to be cleared.
PR: 293227
Reviewed by: kp, zlei, tuexen
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D55367
iommu_gas: Fix assertion.
placeholder entry end changed to 0 in f591287756368
("iommu_gas: make placeholder entry at the start of the GAS zero size")
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D55326
ObsoleteFiles: Deduplicate
Since we dropped support for profile libraries, all optional entries for
them are now non-optional. Most of them were already duplicated there,
a few were not.
MFC after: 3 days
Reviewed by: jhb, emaste
Differential Revision: https://reviews.freebsd.org/D55329
(cherry picked from commit f9f4a022a8583763903771915eafcd064184766a)