Revert "rc.d: Add hastd as a prereq for devd"
This reverts commit 2d17f44a5ae6e948c3a93cac30b8315d127ba900. It hangs
the boot. It turns out I installed my test on the wrong machine and
rebooted the other one...
Sponsored by: Netflix
hptrr: Better error recovery
This bug and https://www.mail-archive.com/freebsd-stable@freebsd.org/msg124458.html
both have this fix. It turns unknown errors into an autosense failure, which causes
us to grab the sense buffer manually. It also sets a condition that we use to retry
timed out commands that jmg reports as being helpful.
I'm torn on committing it. The code seems fine in terms of fixing
things. But this is a 10-year-old bug with few other bugs and a short CC
list for a driver that might go away in 15 anyway. I'm going to commit
and close the bug, and MFC it in a week, unless someone complains (which
seems unliekly, given the age of this hardware, I susepct most of it is
out of service).
Suggested by: jmg, Scott Long
PR: 191135
MFC After: 1 week
Reviewed by: imp
netlink: initialize VNET context with VNET_SYSINIT()
With the initial check-in netlink(4) was very conservative with regards to
using memory and intrusiveness to the kernel and network stack. In
particular it would initialize the VNET context only on the first actuall
call to socket(PF_NETLINK), saving on allocation of a struct nl_control of
size 224 bytes.
Now it is clear that netlink(4) is primary citizen of FreeBSD, with a set
of system tools using it. So resort to normal VNET_SYSINIT() and with
that shave a lot of complexity, since after the change V_nl_ctl is
immutable.
netlink: rename functions that manipulate group membership of a pcb
Use nlp_ prefix for them, cause they operate on single pcb. Use words
"join" and "leave" instead of "add" and "del", cause we aren't creating
or destroying groups, we are just joining or leaving.
Really assert locks instead of just having "locked" suffix.
mpt: replace mpt_prt with mpt_lprt in mpt_cam.c
Replace mpt_prt with mpt_lprt with DEBUG level to print kernel pointers
only at the debug level.
PR: 238662
Signed-off-by: Fuqian Huang <huangfq.daxian at gmail.com>
Reviewed-by: imp
mpt: print req->index rather than the pointer itself in mpt.c
Print req->index instead of printing the pointer itself to avoid kernel
pointer leakage.
PR: 238661
Signed-off-by: Fuqian Huang <huangfq.daxian at gmail.com>
Reviewed-by: imp
unlink, rmdir: call notify_upper from VOP pre method instead of syscall
Suppose that there are two or more nullfs mounts over some fs, and
suppose the we unlink a file on one of the nullfs mount.
This way notify_upper get called from the lower vnode as well, allowing
the other nullfs mounts to note that and drop their caches for the
unlinked vnode.
PR: 254210
Reviewed by: olce
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D48825
pf: send ICMP destination unreachable fragmentation needed when appropriate
Just like we do for IPv6, generate an ICMP fragmentation needed packet if we're
going to need fragmenation for IPv4 as well (i.e. DF is set). Do so before full
processing, so we generate it with pre-NAT addreses, just as we do for IPv6.
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D48805
pfil: set PFIL_FWD for IPv4 forwarding
Just like we already do for IPv6 set the PFIL_FWD flag when we're forwarding
IPv4 traffic. This allows firewalls to make more precise decisions.
Reviewed by: glebius
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D48824
arch.7: Update version reference to 13.0
This document is intended to be a reference for supported FreeBSD
versions, so update text to refer to 13.0 and later.
Sponsored by: The FreeBSD Foundation
netstat: Use bool more widely
Following c2aa91745e87 ("netstat: restore printing the "default"
keyword, provide -nn option"), consistently use bool where appropriate
for commandline flags.
Reviewed by: glebius
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48832
cam: Fix off by one error in ASC/ASCQ lookup
To implement ranges of ASC/ASCQ codes, we set SS_RANGE on an entry with
the entry being the end (highest) of the range (with the prior entry
being the start). When looking up a ASC/ASCQ code, however, we return
the second entry, which just has the range info. Instead, return the
prior entry in these cases so we can print the ASC/ASCQ code string
correctly.
Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D48685
cam: Fail ASC 0x40
ASC 0x40 is use to report diagnostics (as in the self test the drive
runs on itself) failures. The ASCQ code is the part that failed. These
failures are such that I/O to the drive's LBA range is not possible, so
make this condition fatal, and signal the drive's ill health.
Sponsored by: Netflix
Reviewed by: ken, mav
Differential Revision: https://reviews.freebsd.org/D48684
cam/da: Document what an 'invalid pack' means.
An 'invalid pack' in the da driver means that the media for the drive is
temproarily missing, pending an action by a third party (eg robot arm or
human inserting a disk pack, etc) or has changed since we opened. We
invalidate a pack when the ASC/ASCQ tells us the media is missing (ASC
0x3a MEDIA MISSING), for 0x28/0 (NOT READY TO READY CHANGE, MEDIUM MAY
HAVE CHANGED) and for that brief period of time after a peripheral has
been invalidated before the disk is destroyed. When the pack is invalid,
we can't do READ/WRITE operations to the media, so we fail all
outstanding I/O and any new I/O that comes in when this happens. This
is cleared in daopen when we've repobed the device.
Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D48687
cam/xpt: Put all messages on one line
Make all error messages from *xpt.c be greppable by putting them on one
line, "outdenting" where necessary to keep things under about 90
columns. More of cam could use this treatment, but not finding a message
in xpt is what prompted this round.
Sponsored by: Netflix
riscv: Fix and generalise saving TP (PCPU pointer) whilst in userspace
In cpu_fork, we allocate sizeof(struct pcb) + sizeof(struct trapframe)
space on the stack, then round it for stack alignment. This not only
fails to include the space needed for TP but also doesn't round up the
trapframe allocation to be stack-aligned, yet TF_SIZE does, as is the
expectation of fork_trampoline and cpu_exception_handler. Given that
sizeof(struct pcb) + sizeof(struct trapframe) is a multiple of 16, this
causes the saved TP to be stored in the PCB's pcb_sp (the intended
trapframe padding aliasing pcb_ra), which is probably harmless in
practice as the PCB isn't expected to be current, but definitely not
intended.
In cpu_thread_alloc, we do include the 8 bytes for TP and then stack
align that. This again fails to include the padding for trapframe as
present in TF_SIZE, but sizeof(struct pcb) + sizeof(struct trapframe)
happens to be a multiple of 16, as above, so adding 8 then rounding to
stack alignment (16) includes an extra 8 bytes of padding, giving the
right result for the wrong reason (and could be broken by future struct
[11 lines not shown]
bsdinstall: Switched back to amended single-button finalconfig
Commit ac78e3e9c581 ("bsdinstall: Add "Finish" button to finalconfig")
removed the Exit entry from the menu, renamed OK to Select and added a
Finish in place of the old Exit entry. On the surface this seemed like a
good idea, as at a glance OK wasn't clear that it was selecting an entry
rather than just closing the box, Exit isn't the most obvious term
to use for proceeding through the installer without doing anything, and
it separated out the different cases of "do something extra" and
"continue". However, because bsddialog (and dialog) keep a menu entry
highlighted even when the Cancel (in this case, Finish) button is
selected, this now looks even more confusing, with users easily
believing that they are about to select the Add User option (being
either surprised when it doesn't actually do that, or being confused
about how to not select it).
Instead, go back to the old scheme that fits more with bsddialog's
supported functionality but tweak it to try and improve on the confusing
UI/UX from the past. Specifically, the UI changes compared with the
[10 lines not shown]
mountd: Promote missing netmask log to LOG_ERR
Historical network classes are deprecated, but currently still supported
in mountd with a LOG_WARNING-priority message added by Mike Karels in
2021. Upgrade the log to LOG_ERR well in advance of this becoming a
fatal error.
Reviewed by: rmacklem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48795
mk: Add missing escape character
Add a missing escape character that splits a long line to avoid breaking
the builds.
Reported by: cy
Approved by: emaste (mentor)
Fixes: 88d448ec815c ("mk: Move vm stack test debug symbols")
MFC after: 1 week
ifnet: Detach BPF descriptors on interface vmove event
When an interface is moving to/from a vnet jail, it may still have BPF
descriptors attached. The userland (e.g. tcpdump) does not get noticed
that the interface is departing and still opens BPF descriptors thus
may result in leaking sensitive traffic (e.g. an interface is moved
back to parent jail but a user is still sniffing traffic over it in
the child jail).
Detach BPF descriptors so that the userland will be signaled.
Reviewed by: ae
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45727
ifnet: Make if_detach_internal() and if_vmove() void
if_detach_internal() never fail since change [1]. As a consequence,
also does its caller if_vmove(). While here, remove a stall comment.
No functional change intended.
This reverts commit c7bab2a7ca9a6dae79f970c6730a19b65a1ed86e.
[1] a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
Reviewed by: glebius
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D48820