sys_mincore: stop locking potentially huge amount of user memory
the current implementation performs uvm_vslock() on the
user-specified amount of memory. it isn't safe in general.
some might even consider it as a security issue.
this commit fixes it by splitting the user-specified range into
small ones which a temporary kernel buffer can cover. it's ok to
report potentially stale values as the mincore() api is inherently
racy in the first place.
while we still ought to invent a proper "lock user memory for
direct i/o" infrastructue, in this particular use case, it isn't
necessary or appropriate.
zfs: fix case insensitive / utf-8 normalized file names (cont.)
this was intented to be a part of an earlier commit.
("zfs: fix case insensitive / utf-8 normalized file names")
for some reasons, it seems i unintentionally dropped this hunk
when porting the commit from git to cvs.
PR bin/60099 Add more test cases
More test cases to test $* expansion in a variety of
situations (all using $* unquoted - and in contexts
where field splitting could happen).
Several of these new text cases assisted with debugging
the $* expansion code in sh, avoiding issues that otherwise
might not be seen as potential problems.
PR/60069 NetBSD non booting on H3 Allwinner
Disable EFI runtime support on arm as it doesn't play nicely with many
FWs where things go south after/during the call to SetVirtualAddressMap
Also seen by cp- on Odriod-XU4
The Coprocessor Protocol Violation trap is not present on the 68010
(the vector is "unassigned, reserved"), so don't install a handler
for it on that CPU.
Fix a brain-f*rt in the special mac68k "nofault" bus error handling.
The information we need to pass along is packaged up for us neatly
in the stack frame and arguments being passed to trap(), so use those
to extract the %a2 value and faulting address.
Issue raised and fix tested by nat@
zpool_find_import_impl: fix block/character device confusion
this commit fixes zpool import failure in some cases.
the current logic sometimes (eg. "zpool import -d" with a directory
which is not "/dev") ends up with picking character devices
and pass them to ZFS_IOC_POOL_TRYIMPORT/ZFS_IOC_POOL_IMPORT ioctl.
such attempts would fail, marking the corrosponding vdevs UNAVAIL.
this commit fixes it by skipping character devices.
also, this commit makes the label checking logic prefer to use
character devices when available because it seems like the intention
of the upstream logic.
also, this commit fixes import of file-backed vdevs.
zfs: fix file vdev
make solaris compat vn_openat to honor the root vnode specified
by the caller. it's currently only used for vdev_file.c.
this commit fixes "no such pool or dataset" error on zpool create
with files:
```
uma% dd if=/dev/zero of=/tmp/hoge count=100
100+0 records in
100+0 records out
51200 bytes transferred in 0.001 secs (51200000 bytes/sec)
uma% sudo zpool create f /tmp/hoge
cannot create 'f': no such pool or dataset
uma%
```
cf. "file" in "Virtual Devices (vdevs)" in zpool(8).
tests/kernel/t_time_arith.c: update for the recent kernel change
the test updates in the recent change was for some reasons incomplete.
("itimer_transition: do not keep it_value unchanged after firing the event")
https://mail-index.netbsd.org/source-changes/2026/03/17/msg161046.html
this commit updates the rest of tests.
tested with a full build and then the following command:
```
# chroot destdir
# cd /usr/tests/kernel
# atf-run t_time_arith > /dev/null
# echo $?
0
#
```
test failures are pointed out by Taylor R Campbell
[5 lines not shown]
ahc: Fix support for multi-channel PCI controllers.
Some old EISA controllers driven by ahc had two channels on one
controller (aka "TWIN" channels), while all later PCI models
supporting multiple channels did so by having multiple controllers
in one PCI device, each being a separate PCI function.
The ahc interrupt handler wrongly assumed that anything but channel
'A' is always the 2nd channel of a TWIN channel controller, passing
sc_channel_b to scsipi_channel_{freeze,thaw}(). This of course is
wrong for multi-channel PCI ahc controllers, leading to a immediate
panic when there's anything connected to any channel but 'A'.
Some platforms need to declare the vector table in a particular way
for their own reasons. mac68k falls into this category; it needs
be at address $0000.0000 and immediately preceed the Mac ROM variable
storage area.
Provide a hook for this to allow such platforms to use the shared
vector table initialization and manipulation routines.
Oops missed sun3x in previous changes:
Now that all of the m68k copies of the "rei" function are functionally
equivalent, pick the one that uses the fewest cycles in the "no AST
pending" case and re-factor it into trap_subr.s.
Re-factor badtrap into the shared trap_subr.s. This time we pick the
sun2/sun3 implementation of this trap stub because it provides more
context to the stray trap reporting routine (adjust the N copies of
straytrap() to compensate as needed, sigh).
Re-factor trap0 (system calls) into trap_subr.s. Here we pick the flavor
that has the in-line astpending check bcause it's a few cycles faster in
the (common) case where no AST is pending at the end of a system call.
Re-factor trap12 ("cachectl") into trap_subr.s. Already identical everywhere
except for 68010, where it's a no-op.
PR/59994 gcc/m68k generates bad code for stack protector
Record the alignment of the stack canary before allocating space for
it in a stack frame.
Generate an assignment expression to initialise the canary instead of
emitting a move instruction.