summaryrefslogtreecommitdiff
path: root/sys/dev/softraid_crypto.c
AgeCommit message (Collapse)Author
2013-01-18Convert softraid crypto to the new ccb and workunit completion functions.Joel Sing
2013-01-16Set resid to zero if the scsi transfer completed without error.Joel Sing
ok krw@
2013-01-15Always initialise the discipline name, not just when we are doing a create.Joel Sing
2013-01-15Keep a function pointer to the per-discipline I/O interrupt handler in theJoel Sing
discipline data structure. To be used with an upcoming diff.
2012-10-09Provide a mechanism for the kernel to directly pass a mask key through toJoel Sing
a crypto volume when it is assembling it.
2012-10-08Provide a mechanism for the kernel to pass data through to the disciplineJoel Sing
during volume assembly.
2012-01-30Prevent softraid from being used with devices that do not have a sectorJoel Sing
size of 512 bytes - any other size is not currently supported. ok krw@
2012-01-22Convert softraid(4) to new bio(4) status interface. This allows bioctl(8)Joel Sing
to provide useful feedback, rather than reporting an ioctl failure and leaving the user to consult dmesg. For now we continue to print most things to the console, even if the message is a result of an ioctl.
2012-01-22Move list initialisation to the start of the function - this prevents usJoel Sing
from walking an uninitialised list if we fail to read the key disk.
2011-12-26Provide default set chunk state and set volume state functions whichJoel Sing
cover the no redundancy/no rebuild case. Use these for the AOE, crypto and RAID 0 disciplines.
2011-12-25Initialise discipline function pointers with defaults and only overrideJoel Sing
those that are needed by a specific discipline.
2011-09-20Mark softraid crypto volumes as being capable of auto assembly, since theyJoel Sing
are if used with a key disk.
2011-09-20Simplify the crypto descriptor handling by changing the list head, insteadJoel Sing
of splitting and rejoining the list.
2011-09-18Add support for variable length optional metadata in softraid(4). ThisJoel Sing
will allow new optional metadata types to be added without needing to change the softraid metadata version. Note that this commit changes the softraid metadata version, however an upgrade from older metadata is handled automatically. A full backup prior to upgrading is still strongly recommended. With feedback from stsp@ and marco.
2011-09-18Rename the optional metadata handler function and factor out the optionalJoel Sing
metadata handling code. This will simplify upcoming changes.
2011-07-07only allocate and copyin the length of kdfinfo data.Ted Unangst
ok deraadt matthew
2011-07-05ENOMEM causing EIO errors is bad juju. Softraid crypto did this.Owain Ainsworth
Instead of allocating a crypto op and the optional dma buffer on each and every io, preallocate a list of softraid crypto wus that contain a buffer of the max size we will use (MAXPHYS). since we know the number of openings we have in advance this means that on each io we just pick one, shorten the list of crypto descs, init any values then do the io. ok jsing (who provided many useful comments. he also provided a smarter way of handling the cryptop lists which is not in this diff but will be implemented soonish), marco@. dlg@ pointed out that this should probably use iopools but letting disciplines allocate their own iopool involves more softraid rejigging that will have to be done first. For now this is sufficient.
2011-06-18Change sizeof(&kdfinfo2) to sizeof(kdfinfo2).Matthew Dempsky
ok deraadt@
2011-06-17M_WAITOK cleanup of two cases:Michael Knudsen
1) Allocating with M_WAITOK, checking for NULL, and calling panic() is pointless (malloc() will panic if it can't allocate) so remove the check and the call. 2) Allocating with M_WAITOK, checking for NULL, and then gracefully handling failure to allocate is pointless. Instead also pass M_CANFAIL so malloc() doesn't panic so we can actually handle it gracefully. 1) was done using Coccinelle. Input from oga. ok miod.
2011-06-05Fix function names in debug printfs and use a more user-friendly errorStefan Sperling
message if the key disk cannot be opened. ok marco (some time ago)
2011-05-20sr_scsi_cmd copes with failed i/o just fine so there's no needMike Belopuhov
to panic if we couldn't allocate memory for crypto descriptors; tested by dcoppa, ok marco
2011-04-06make crypto work with bigmemMarco Peereboom
2011-04-05Iopoolification. Testing by marco@.Kenneth R Westerback
ok dlg@ marco@
2011-03-06fix function name in error/debug messages; ok marcoStefan Sperling
2011-01-12stray tabMarco Peereboom
2011-01-12explicit zeroing of key information in the softraid ioctl codeTheo de Raadt
ok marco
2011-01-12more explicit_bzero to delete keys.Marco Peereboom
prodded and ok deraadt
2011-01-12lots of explicit_bzero for things which contain parts of keysTheo de Raadt
ok marco
2010-11-06Move raid1 and crypto io to a workq. This is to avoid a potential VOP_Marco Peereboom
call while in interrupt context. Contains an additional spl dance as found by thib. Tested by many opn various arches. Note that raid 0/4/5/6 have not been moved over yet.
2010-09-27A few M_ZEROs without any M_WAITOK/M_NOWAITs.Thordur I. Bjornsson
2010-09-27tedu's shiny new pool_get kassert found an instance of PR_NOWAIT orMarco Peereboom
PR_WAITOK not being set. While here add a diagnostic check for malloc.
2010-09-23The only sensible argument for VOP_* calls that take a struct proc pointer isOwain Ainsworth
curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this pointer, which was fine until the called vnode function tried to do something with it. Typically, this code was then copy/pasted to various parts of the tree. Accept the facts of life and switch all of these over to passing curproc for now until the argument can be removed. Discovered by stsp trying to create a softraid on top of a vnd, which crashed with a NULL deref in vndioctl. softraid bits tested by mikeb and jsing. raidframe bits tested by pea, matthieu and naddy. The rest tested by at least thib, jsing and myself. ok thib@, jsing@.
2010-07-02Rename the volume specific flags variable.Joel Sing
ok marco@
2010-07-02Determine the data offset using a variable specified within the softraidJoel Sing
metadata. This allows us to implement seamless transitions from the previous metadata version to the current version, avoiding the need to recreate the softraid volume. Joint work with marco@ during c2k10. ok marco@
2010-05-18dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisDavid Gwynne
gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
2010-04-18Make key disks use their own optional metadata type, rather than reusingJoel Sing
crypto optional metadata. ok marco@
2010-03-28Completely overhaul optional metadata handling, allowing for multipleJoel Sing
optional metadata per volume and discipline specific optional metadata processing. ok marco@
2010-03-28Correctly initialise variables to prevent possible free without malloc inJoel Sing
error path. Found by jsg@ using the clang static analyser.
2010-03-26Add storage for the boot block and boot loader to the softraid metadata.Joel Sing
Also add a new optional metadata type for boot data. This is the first step (of many) towards being able to boot from softraid volumes. WARNING: This version of the softraid metadata is not compatible with previous versions. As a result, any softraid volumes created with older kernels will not assemble. Data on existing softraid volumes should be backed up before upgrading. The volume should then be recreated and the data restored. ok marco@
2010-01-09Zap all setting of ITSDONE in drivers that don't look at it. NobodyKenneth R Westerback
else cares so it's just noise. Drivers that actually look at ITSDONE are unchanged. ok marco@ (for his files) dlg@ beck@
2009-12-31Assert copyright.Joel Sing
ok marco@
2009-12-31Add support for key disks. This allows a crypto volume to be constructedJoel Sing
without using a passphrase - instead the encryption mask key is stored on the specified key disk partition (ideally being one on a removable device). This also enables automatic assembly of crypto volumes at boot time. ok marco@
2009-12-15Factor out discipline specific create/assemble code.Joel Sing
"in, in, in!" marco@
2009-12-07Define discipline capabilities using a set of flags.Joel Sing
"shiny!!" marco@
2009-11-24Allow the passphrase to be changed on softraid crypto volumes. Ensure thatJoel Sing
you backup your data and lock up your pets prior to using this. Tested by todd@ ok marco@
2009-11-24Factor out crypto code allowing for future reuse.Joel Sing
ok marco@
2009-08-09Switch softraid to vnodes to prevent bad things from happening when usingMarco Peereboom
d_open/d_close. tested by many, ok jsing, thib, krw
2009-06-11Create a hotplug callback mechanism.Marco Peereboom
2009-06-11KNFMarco Peereboom
2009-06-09fix potential null dereference.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok marco@