| Age | Commit message (Collapse) | Author |
|
PR kern/57450 (unplugging hung USB disk triggers panic via _vstate_assert)
|
|
|
|
All calls use the same value. Prune dead branches using it.
|
|
the device being initialized.
|
|
and RAIDFRAME_SHUTDOWN ioctls.
XXX Pullup-9
Reported-by: syzbot+1c20fcbe34d72cd7fbda@syzkaller.appspotmail.com
|
|
numCol and numSpares are "int" so they can be "-1" internally,
which means negative values need to be rejected, as well as
values higher than RF_MAXCOL/RF_MAXSPARES.
explicitly nul-terminate all strings coming from userland.
some minor CSE that avoids signed arith.
this fixes issues in the RAIDFRAME_ADD_HOT_SPARE,
RAIDFRAME_CONFIGURE, RAIDFRAME_DELETE_COMPONENT,
RAIDFRAME_INCORPORATE_HOT_SPARE, and RAIDFRAME_REBUILD_IN_PLACE
ioctl commands.
Reported-by: syzbot+b584943ad1f8ab9d4fe0@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=61e07e418261f8eec8a37a9226725fe31820edd0
https://syzkaller.appspot.com/bug?id=ca0c997b40de81c0f0b44790217731f142003149
https://syzkaller.appspot.com/bug?id=6fc452d228453494655a85264591dd9054cc0b08
https://syzkaller.appspot.com/bug?id=873f0271682713a27adc9a49dd7109c70b35fda3
XXX: pullup-8, pullup-9.
ok oster@ riastradh@
|
|
Reported-by: syzbot+048387fcc9a1a3682638@syzkaller.appspotmail.com
Reported-by: syzbot+037d1813186571cb2d38@syzkaller.appspotmail.com
|
|
vput(vp) also unlocks vp, thus unlocking happens twice in error flow
causing kernel to panic with failed assertion lktype != LK_NONE
in vfs_vnode.c#778. Thanks riastradh with finding the issue.
|
|
|
|
|
|
|
|
Prune a whole lotta dead branches as a result of this. (Some logic
calling this is also wrong for other reasons; devsw_detach is final
-- you should never have any reason to decide to roll it back. To be
cleaned up in subsequent commits...)
XXX kernel ABI change to devsw_detach signature requires bump
|
|
|
|
now it's possible to get boot-time info about raidframe root
device selection with simple "boot -x".
|
|
|
|
|
|
|
|
problem shown here:
http://mail-index.netbsd.org/tech-kern/2021/12/10/msg027851.html
but seems unlikely to fix the original problem.
tested on i386/anita. ok oster@
XXX: pullup-9 (netbsd-8 uses old APIs.)
|
|
another copyright claim line. again. (i did this in 2008 and then
did not update all of my personal templates.)
|
|
|
|
|
|
Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks;
the raidframe(4) change probably doesn't (but doesn't hurt).
|
|
the raw partition. In particular, we now need to account for the case
where an existing FS_RAID partition is now open because it is in use.
If that is the case, we don't look at the raw partition.
Addresses PR kern/56369.
|
|
|
|
|
|
these changes to fix the build.
|
|
autoconfig RAID sets. raidctl now supports looking
for autoconfig RAID sets with a new '-L' flag.
|
|
|
|
|
|
|
|
|
|
Cleanup the error path for the (no longer needed) PR_NOWAIT cases.
|
|
|
|
is not allowed.
PR bin/45162
|
|
version of RAIDFrame. Remove them from here.
|
|
isn't needed. Cleanup the flag from rf_DoAccess() and its caller as
well.
|
|
|
|
Alloclist remains not per-RAID, so initialize that pool
separately/differently than the rest.
The remainder of pools in RF_Pools_s are now per-RAID pools. Mostly
mechanical changes to functions to allocate/destroy per-RAID pools.
Needed to make raidPtr available in certain cases to be able to find
the per-RAID pools.
Extend rf_pool_init() to now populate a per-RAID wchan value that is
unique to each pool for a given RAID device.
TODO: Complete the analysis of the minimum number of items that are
required for each pool to allow IO to progress (i.e. so that a request
for pool resources can always be satisfied), and dynamically scale
minimum pool sizes based on RAID configuration.
|
|
RAIDframe can't deal with that, so create a dedicated pool of buffers
to use for IO. PR_WAITOK is fine here, as we pre-allocate more than
we need to guarantee IO can make progress. Tuning of pool still to
come.
|
|
|
|
there are two on-disk formats in use in raidframe:
- the component label
- the parity map
the parity map is a bitmap implemented as bytes, so it has no
endian issue. the component label is the problem, as most of
the fields are 32 bit. this change only supports version 2 of
raidframe (active since the year 2000.)
as component labels are read and used before a raidPtr for the
raid set has been created, there is no obvious storage for the
swapped indicator, so the in-core version remains the on-disk
version, while the rest of in-core label is swapped.
in raidread_component_label() and raidwrite_component_label(),
check if the swapped version, and if so, call new rf_swap_label()
and ensure that the in-core label is native-byte order. for the
write method, an on-stack copy is modified before writing, so
that the in-core version remains valid. (this stack usage is
below other stack usage in similar functions here.)
adjust the label ioctls RAIDFRAME_GET_COMPONENT_LABEL and
RAIDFRAME_GET_COMPONENT_LABEL80 to return the byte-swapped
version so that eg, raidctl -s reports the right version.
when performing final configuration of a raidset, report if a
label swapped, and also complain if there are differently swapped
versions on the other components.
tested on arm64, sparc64 and amd64
ok @oster
|
|
ignore spiflash as a raid device.
|
|
|
|
with the function name it comes with.
|
|
SUsPerPU is only really supported for a value of 1, and since the
first PSID is 0, the last will be numStripe-1. Also update the
setting of pending_writes to reflect the change to lastPSID.
Needs pullups to -8 and -9.
|
|
|
|
|
|
|
|
- return the error not 0 if failing.
|
|
|