HBSD: Disable retpolines for the bootloader
We've been building the bootloader with retpolines. With the latest
OpenZFS import, the addition of retpolines now causes the loader to be
too large in size, preventing a successful build.
Applying retpolines to the bootloader doesn't make sense, anyways. An
attacker able to exploit speculative execution vulnerabilities at the
bootloader stage has already won the game.
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
Fixes: 8a62a2a5659d1839d8799b4274c04469d7f17c78
cxgbe(4): decode the T7 MC interrupt correctly
The layout for the main INT_CAUSE is a bit different for T7.
MFC after: 1 week
Sponsored by: Chelsio Communications
cxgbe(4): adjustments to the output of the slow interrupt handler
- Display an appropriate alert character instead of a question mark for
unknown bits.
- Display all fatal bits for a register and not just the ones that are
currently set.
MFC after: 1 week
Sponsored by: Chelsio Communications
EC2: Don't use unicode in boot loader
The boot loader menu is disabled by default in EC2, but if it is ever
turned on, the default (unicode) output breaks EC2's web interface to
the serial console.
Set loader_menu_frame="ascii" instead.
MFC after: 3 days
Sponsored by: Amazon
(cherry picked from commit 277830b4d3ae9999c80bf915b5491850e91c6516)
(cherry picked from commit 251907ca480eff7f6177f52959b71a6cfce45579)
intrng: Shuffle unhandled interrupts too
When interrupt vectors are first allocated, they get assigned to
CPU #0; at SI_SUB_SMP / SI_ORDER_SECOND (aka once we have multiple
CPUs), the intr_irq_shuffle SYSINIT clears their CPU sets with the
effect of forcing them to be assigned to new CPUs later.
In case where interrupt vectors were allocated *but not yet bound*
this code did not run, with the effect that those interrupts would
remain pinned to CPU #0 forever. This affected the ena(4) driver,
which allocates interrupts for I/O when the device is attached but
doesn't set them up until the interface is brought up much later in
the boot process (and, crucially, long after intr_irq_shuffle runs).
Adjust intr_irq_shuffle to clear the CPU set for an interrupt source
even if it currently has no handlers, so that it will be properly
assigned to a CPU when it is used later.
Reviewed by: andrew, mhorne
[5 lines not shown]
tests/netinet: provide test for raw_ip.c:rip_input()
The test creates differently bound SOCK_RAW sockets and sends different
probe packets. There is expected results matrix that every probe is
checked against.
pfctl: consistency
% pfctl -F ethernet
Ethernet rules cleared
% pfctl -s ethernet
pfctl: Unknown show modifier 'ethernet'
pfctl accepts 'ethernet' (or any prefix of it) in the -F flag but
accepts only 'ether' (or any prefix of it) in the -s flag, which seems
inconsistent. This change brings the two to parity while remaining
backwards compatible.
Reviewed by: kp
MFC after: 2 weeks
Signed-off-by: Seth Hoffert <seth.hoffert at gmail.com>
(cherry picked from commit 36acf1bd32ed5749af4a9f735aeea1a3434fe42f)
LinuxKPI: Fix simple_read_from_buffer for zero-size and off-the-end reads
I noticed that the buf_size < 0 check can never be true (it's a
size_t) and decided to check for this condition by an alternate
expression, and I also noticed that a read_size of 0 would incorrectly
return -EFAULT. Instead, return success for both of these cases as
reading beyond the EOF of a normal file also returns EOF, not EINVAL.
Reviewed by: bz
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D55845
lindebugfs: Pass user buffer pointers to the read/write file operations
The Linux file_operations API expects the read and write operations
to take a single user buffer pointer (along with the length and the
file offset as an in/out parameter).
However, the debugfs_fill function was violating this part of the
contract as it was passing down kernel pointers instead. An earlier
commit (5668c22a13c6befa9b8486387d38457c40ce7af4) hacked around this
by modifying simple_read_from_buffer() to treat its user pointer
argument as a kernel pointer instead. However, other commits keep
tripping over this same API mismatch
(e.g. 78e25e65bf381303c8bdac9a713ab7b26a854b8c passes a kernel pointer
to copy_from_user in fops_str_write).
Instead, change debugfs_fill to use the "raw" pseudofs mode where the
uio is passed down to directly to the fill callback rather than an
sbuf. debufs_fill now iterates over the iovec in the uio similar to
the implementation of uiomove invoking the read or write operation on
[24 lines not shown]
arm64: Have a common call to userret
Rather than each exception calling userret use a common copy. As
syscallret already calls userret we need to skip it in that case.
Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55250
LinuxKPI: Clear the sbuf at the start of each call to seq_read
Each invocation of seq_read invokes the seq_file.show callback which
writes into the sbuf. Then it invokes sbuf_finish before copying the
data into the caller's buffer. Without this, a second call to
seq_read on the same file would try to append data to a finished sbuf.
Reviewed by: bz
Sponsored by: AFRL, DARPA
virtio: Ensure power-of-two alignment for indirect queue
Some platforms enforce power-of-two alignment for bus_dma tags. Rounding up
the natural size may result in over-alignment, but should be safe.
PR: 293770
Reviewed by: andrew
Fixes: c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations")
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55843