Commit Graph

72 Commits

Author SHA1 Message Date
ume
73402ef817 stop including rijndael-api-fst.h from rijndael.h.
this is required to integrate opencrypto into crypto.
2005-03-11 15:42:51 +00:00
imp
872b48591b /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 18:27:30 +00:00
brueffer
77a79d8302 Fix typo in a comment.
MFC after:	3 days
2004-12-15 12:18:41 +00:00
phk
3e1bf8d8b5 Fix a problem that shows up if less than the full complement of
lock sectors are defined ("number_of_keys" argument to gbde init being
less than 4 in the default compile).
2004-09-11 17:58:53 +00:00
phk
9b11b1fb2c Respect that G_BDE_MAXKEYS is a compile time variable. 2004-09-11 17:57:51 +00:00
phk
d8d2b01380 Tag all geom classes in the tree with a version number. 2004-08-08 07:57:53 +00:00
phk
8a11f1b4a6 Use default method initialization on geoms. 2004-08-08 06:49:07 +00:00
jhb
2642ed4029 kthread_exit() no longer requires Giant, so don't force callers to acquire
Giant just to call kthread_exit().

Requested by:	many
2004-03-05 22:42:17 +00:00
phk
c9a89db245 Do not check error code from closing ->access() calls, we know they succeed. 2004-02-14 17:59:44 +00:00
phk
124977fbb6 Remove the absolute count g_access_abs() function since experience has
shown that it is not useful.

Rename the relative count g_access_rel() function to g_access(), only
the name has changed.

Change all g_access_rel() calls in our CVS tree to call g_access() instead.

Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source
code compatibility.
2004-02-12 22:42:11 +00:00
phk
3f5293e827 Polish the work/state engine in preparation for HW-crypto support. 2004-02-08 10:19:18 +00:00
phk
fd04c07950 Add a missing error case return.
Problem reported by:	Flemming Jacobsen <fj@batmule.dk>
2004-02-08 09:39:02 +00:00
phk
bcf2cf333e We don't need to hold Giant to create the worker kthread. 2004-02-07 23:01:17 +00:00
phk
a3cc95eec9 Remove the MD5_KEY debugging tool 2004-01-23 11:47:06 +00:00
phk
a7b8d85b93 Interior decoration changes. 2003-10-07 09:28:07 +00:00
phk
bab9696ceb Correct bzero length so we clear the entire key structure. 2003-09-08 18:35:26 +00:00
phk
db461ec795 Bzero the right number of bytes.
Found by:	Juergen Buchmueller <pullmoll@stop1984.com>
2003-09-06 18:37:17 +00:00
phk
069191fcbf Simplify the GEOM OAM api: Drop the request type, and let everything
hinge on the "verb" parameter which the class gets to interpret as
it sees fit.

Move the entire request into the kernel and move changed parameters
back when done.
2003-06-01 13:47:51 +00:00
phk
ef00c86fce Remove unused variable.
Found by:       FlexeLint
2003-05-31 19:28:53 +00:00
phk
48e54f8060 Don't use & in front of arrays.
Found by:       FlexeLint
2003-05-31 19:23:11 +00:00
phk
c48dbf1758 Remove unused variable.
Found by:       FlexeLint
2003-05-31 19:08:23 +00:00
phk
e2298826ec Remove the G_CLASS_INITIALIZER, we do not need it anymore. 2003-05-31 16:59:27 +00:00
phk
3f2e0ad16d Re-order the the initialization slightly to improve structure. 2003-05-05 08:58:12 +00:00
phk
d6ece911bb Use a dedicated malloc(9) bucket for sector storage. 2003-05-05 08:37:07 +00:00
phk
d73072efd4 Considering that I did cast the arguments to (intmax_t) I must have
been sleepy since I used %qd instead of %jd.
2003-05-02 19:08:57 +00:00
phk
a43e2a0d8e Fix an obscure fencepost error in GBDE's sector mapping code:
For certain combinations of sectorsize, mediasize and random numbers
(used to define the mapping), a multisector read or write would ignore
some subset of the sectors past the first sector in the request because
those sectors would be mapped past the end of the parent device, and
normal "end of media" truncation would zap that part of the request.

Rev 1.19+1.20 of g_bde_work.c added the check which should have alerted
me to this happening.  This commit maps the request correctly and
adds KASSERTS to make sure things stay inside the parent device.

This does not change the on-disk layout of GBDE, there is no need to
backup/restore.
2003-04-29 19:46:42 +00:00
phk
df12452858 Typo in last commit: Do not press xZZ to leave vi(1). 2003-04-29 19:38:55 +00:00
phk
46e72efe59 When a bio comes back from below with a zero error code, check that
it wrote the full length.  The only case where this should be able
to happen is if we try to read/write past the end and the request
is truncated.  We obviously should never try to do that, so this
code should never activate.
2003-04-29 19:37:36 +00:00
phk
647f79f459 I accidentally leaked this debugging tool in with my last commit.
Disable it with a direct warning.
2003-04-28 17:57:12 +00:00
phk
1b6624b999 Rename g_bde_get_sector() to g_bde_get_keysector() and pick up the
offset from the work packet.
2003-04-28 06:38:31 +00:00
phk
1adaf3d22c Only attempt total cache-purge once in case of failure. 2003-04-28 06:19:41 +00:00
phk
5299f69145 Better criteria for skipping disk reading BIO_READ work packets. 2003-04-28 06:15:39 +00:00
phk
600f5cf898 Explicitly set the sector state to JUNK if we encounter a read-error. 2003-04-28 06:10:35 +00:00
phk
cd6350ca83 Bail as soon as the first write request has failed, there is no point
in trying the second write if the first one went nowhere.
2003-04-26 21:40:26 +00:00
phk
da80cf8fcc Appearantly UFS no longer issues BIO_DELETE requests correctly, and
consequently trashes data.  Disable BIO_DELETE handling in gbde for now.
2003-04-26 21:39:33 +00:00
phk
876e7e7a6d Do an explicit retry after we have dumped the cache, rather than a
(potential) tail recursion.
2003-04-25 21:43:11 +00:00
phk
82e4f296ff If on a BIO_READ request, we failed to allocate the bio for reading
our key-sector, we would end up returning the read without an error,
despite the fact that the data was not correctly decrypted.

This would result in data corruption on read, but intact data still
on the media.
2003-04-25 21:28:28 +00:00
phk
017246b9b8 Fix a problem and slightly improve the ENOMEM handling:
Give up the entire bio as soon as we detect a problem.

When we detect a problem, give up the bio by contributing the
remainder with ENOMEM, rather than kicking the bio back right
away.

If we failed on a non-first iteration we previously could end up
modifying fields in the bio after we delivered it.  This could
account for memory corruption (none directly reported) on machines
with GBDE.
2003-04-25 21:20:57 +00:00
phk
e2ee68d54b Don't count a sector in the cache unless we manage to create it. 2003-04-25 20:56:27 +00:00
phk
b2fdd2cc0f Rename g_bde_release_sector() to g_bde_release_keysector() and pick up
the sector from the work item.
2003-04-25 20:35:34 +00:00
phk
5b6422dcef Rename g_bde_read_sector() to g_bde_read_keysector() pick up the offset
in the work structure.
2003-04-25 20:16:59 +00:00
phk
cbe207a30e Remove all references to BIO_SETATTR. We will not be using it. 2003-04-03 19:19:36 +00:00
phk
34a3abe946 Use sys/endian.h instead of geom_enc.c for endian-agnostfication. 2003-04-03 11:33:51 +00:00
phk
85edc96041 Remove the old config interface now that the new OAM is functional. 2003-04-01 07:33:17 +00:00
phk
cdc67e7072 Add create_geom and destroy_geom methods. 2003-03-29 22:14:21 +00:00
phk
87ed6d02e4 Forward compatibility: NULL check the passed in meta argument. 2003-03-25 09:02:41 +00:00
phk
639a37daa0 Premptively change initializations of struct g_class to use C99
sparse struct initializations before we extend the struct with
new OAM related member functions.
2003-03-24 19:30:15 +00:00
phk
e059b79437 Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.
2003-03-18 08:45:25 +00:00
phk
6471cae560 Limit our requests to DFLTPHYS, this is generally a good idea for
memory-allocation purposes.  Right now it is also a very good idea
because we hit a Giant assertion in the free(9) processing if we
free something larger than 64k.
2003-03-07 19:09:46 +00:00
imp
cf874b345d Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00