summaryrefslogtreecommitdiffstats
path: root/sys/geom/eli/g_eli.c
Commit message (Collapse)AuthorAgeFilesLines
* Free opencrypto sessions on suspend, as they also might keep encryption keys.pjd2010-10-211-35/+80
|
* Fix a bug introduced in r213067 where we use authentication key beforepjd2010-10-211-9/+10
| | | | initializing it.
* Bring in geli suspend/resume functionality (finally).pjd2010-10-201-26/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change if you wanted to suspend your laptop and be sure that your encryption keys are safe, you had to stop all processes that use file system stored on encrypted device, unmount the file system and detach geli provider. This isn't very handy. If you are a lucky user of a laptop where suspend/resume actually works with FreeBSD (I'm not!) you most likely want to suspend your laptop, because you don't want to start everything over again when you turn your laptop back on. And this is where geli suspend/resume steps in. When you execute: # geli suspend -a geli will wait for all in-flight I/O requests, suspend new I/O requests, remove all geli sensitive data from the kernel memory (like encryption keys) and will wait for either 'geli resume' or 'geli detach'. Now with no keys in memory you can suspend your laptop without stopping any processes or unmounting any file systems. When you resume your laptop you have to resume geli devices using 'geli resume' command. You need to provide your passphrase, etc. again so the keys can be restored and suspended I/O requests released. Of course you need to remember that 'geli suspend' won't clear file system cache and other places where data from your geli-encrypted file system might be present. But to get rid of those stopping processes and unmounting file system won't help either - you have to turn your laptop off. Be warned. Also note, that suspending geli device which contains file system with geli utility (or anything used by 'geli resume') is not very good idea, as you won't be able to resume it - when you execute geli(8), the kernel will try to read it and this read I/O request will be suspended.
* - Add missing comments.pjd2010-10-201-2/+4
| | | | - Make a comment consistent with others.
* Change g_eli_debug to int, so one can turn off any GELI output by settingpjd2010-09-251-2/+2
| | | | | | kern.geom.eli.debug sysctl to -1. MFC after: 2 weeks
* Update copyright years.pjd2010-09-231-1/+1
| | | | MFC after: 1 week
* Add support for AES-XTS. This will be the default now.pjd2010-09-231-9/+31
| | | | MFC after: 1 week
* Implement switching of data encryption key every 2^20 blocks.pjd2010-09-231-24/+67
| | | | | | | This ensures the same encryption key won't be used for more than 2^20 blocks (sectors). This will be the default now. MFC after: 1 week
* Define default overwrite count, so that userland can use it.pjd2010-09-231-1/+1
| | | | MFC after: 1 week
* Correct offset conversion to little endian. It was implemented in version 2,pjd2010-08-281-3/+5
| | | | | | | | but because of a bug it was a no-op, so we were still using offsets in native byte order for the host. Do it properly this time, bump version to 4 and set the G_ELI_FLAG_NATIVE_BYTE_ORDER flag when version is under 4. MFC after: 2 weeks
* Use lower priority for GELI worker threads. This improves systempjd2010-04-151-3/+2
| | | | | | responsiveness under heavy GELI load. MFC after: 3 days
* Detach GELI providers on shutdown/reboot, which will allow providers underneathpjd2009-03-161-1/+55
| | | | | | | to close properly. Reported, reviewed and tested by: guido MFC after: 1 week
* Backout this commit whil a better solution is developedguido2009-03-131-1/+0
|
* When attaching a geli on boot make sure that it is detachedguido2009-03-101-0/+1
| | | | | upon last close. (needed for a gmirror to properly shutdown upon reboot when a geli is on top the gmirror)
* Style(9).pjd2008-08-121-3/+4
|
* Clear passphrase buffer after use.pjd2008-07-201-0/+2
| | | | Submitted by: Fabian Keil <fk@fabiankeil.de> (a bit different version)
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-2/+2
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* Commit 14/14 of sched_lock decomposition.jeff2007-06-051-2/+2
| | | | | | | | | | | - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* Use root_mounted().pjd2007-04-081-1/+1
|
* Overhaul driver/subsystem api's:sam2007-03-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o make all crypto drivers have a device_t; pseudo drivers like the s/w crypto driver synthesize one o change the api between the crypto subsystem and drivers to use kobj; cryptodev_if.m defines this api o use the fact that all crypto drivers now have a device_t to add support for specifying which of several potential devices to use when doing crypto operations o add new ioctls that allow user apps to select a specific crypto device to use (previous ioctls maintained for compatibility) o overhaul crypto subsystem code to eliminate lots of cruft and hide implementation details from drivers o bring in numerous fixes from Michale Richardson/hifn; mostly for 795x parts o add an optional mechanism for mmap'ing the hifn 795x public key h/w to user space for use by openssl (not enabled by default) o update crypto test tools to use new ioctl's and add cmd line options to specify a device to use for tests These changes will also enable much future work on improving the core crypto subsystem; including proper load balancing and interposing code between the core and drivers to dispatch small operations to the s/w driver as appropriate. These changes were instigated by the work of Michael Richardson. Reviewed by: pjd Approved by: re
* Fix geli after last commit for UP systems that are running SMP kernel.pjd2007-03-021-1/+2
| | | | | Submitted by: Hyo geol, Lee <hyogeollee@gmail.com> MFC after: 1 week
* It is possible that GEOM taste provider before SMP is started.pjd2007-01-281-0/+7
| | | | | | | | We can't bind to a CPU which is not yet on-line, so add code that wait for CPUs to go on-line before binding to them. Reported by: Alin-Adrian Anton <aanton@spintech.ro> MFC after: 2 weeks
* I want CPU number here.pjd2006-11-021-1/+1
| | | | Noticed by: ru
* Skip disabled CPU, because after we sched_bind() to a disabled CPU,pjd2006-11-011-1/+16
| | | | | | | | | | we won't be able to exit from the thread. Function g_eli_cpu_is_disabled() stoled from kern_pmc.c. PR: 104669 Reported by: Nikolay Mirin <nik@optim.com.ru> MFC after: 1 week
* Implement BIO_FLUSH handling by simply passing it down to the components.pjd2006-10-311-0/+2
| | | | Sponsored by: home.pl
* Remove trailing spaces.pjd2006-09-301-1/+1
|
* Before using byte offset for IV creation, covert it to little endian.pjd2006-08-111-2/+8
| | | | | | | | | | This way one will be able to use provider encrypted on eg. i386 on eg. sparc64. This doesn't really buy us much today, because UFS isn't endian agnostic. We retain backward compatibility by setting G_ELI_FLAG_NATIVE_BYTE_ORDER flag on devices with version number less than 2 and not converting the offset.
* Allow geli to operate on read-only providers.pjd2006-08-091-6/+16
| | | | | Initial patch from: vd MFC after: 2 weeks
* Fix what looks like a typo: MODULE_DEPEND() takes module names,yar2006-07-271-1/+1
| | | | | | | not KLD file names; and GELI module's name is g_eli, not geom_eli. Approved by: pjd (silence) MFC after: 5 days
* Implement data integrity verification (data authentication) for geli(8).pjd2006-06-051-250/+121
| | | | Supported by: Wheel Sp. z o.o. (http://www.wheel.pl)
* Make kern.geom.eli.overwrites sysctl a tunable as well.pjd2006-06-051-0/+1
|
* geli(8) provides keys on newsession time, so remove CRD_F_KEY_EXPLICIT flagpjd2006-04-201-2/+1
| | | | as HW crypto drivers don't support it.
* Correct debug: we are sending child bio here, not parent bio.pjd2006-04-151-2/+2
| | | | MFC after: 1 week
* Pass BIO_GETATTR requests down.pjd2006-04-121-5/+14
| | | | MFC after: 1 week
* Typos.pjd2006-04-051-1/+1
|
* Teach geli how to load keyfiles before root file system is mounted.pjd2006-02-111-19/+106
| | | | | | | | | | | | | | | | | | | | | | An example entries for loader.conf to make it possible: geli_da0_keyfile0_load="YES" geli_da0_keyfile0_type="da0:geli_keyfile0" geli_da0_keyfile0_name="/boot/keys/da0.key0" geli_da0_keyfile1_load="YES" geli_da0_keyfile1_type="da0:geli_keyfile1" geli_da0_keyfile1_name="/boot/keys/da0.key1" geli_da0_keyfile2_load="YES" geli_da0_keyfile2_type="da0:geli_keyfile2" geli_da0_keyfile2_name="/boot/keys/da0.key2" geli_da1s3a_keyfile0_load="YES" geli_da1s3a_keyfile0_type="da1s3a:geli_keyfile0" geli_da1s3a_keyfile0_name="/boot/keys/da1s3a.key" Thanks for jhb and kan who showed me the right direction. MFC after: 3 days
* Check rootvnode variable to see if we still want to ask for passphrase onpjd2006-02-111-28/+2
| | | | | | boot. Other methods just don't work properly. MFC after: 3 days
* Clean up some sysctl descriptions, debug messages etc.brueffer2006-02-071-7/+7
| | | | | Approved by: pjd MFC after: 3 days
* Remove trailing spaces.pjd2006-02-011-4/+4
|
* Remove dead code.pjd2006-01-171-2/+0
| | | | | Found by: Coverity Prevent(tm) MFC after: 3 days
* Remove unused value.pjd2006-01-171-2/+1
| | | | | Found by: Coverity Prevent(tm) MFC after: 3 days
* Check for g_read_data(9) errors properly:sobomax2005-11-301-1/+1
| | | | | | | | | | o The only indication of error condition is NULL value returned by the function; o value pointed to by error argument is undefined in the case when operation completes successfully. Discussed with: phk
* Fix copy&paste typo.pjd2005-09-101-1/+1
| | | | MFC after: 3 days
* Don't forget to initialize crp_etype field.pjd2005-09-101-0/+1
| | | | | Reported by: Nick Evans <nevans@syphen.net> MFC after: 3 days
* By default, when doing crypto work in software, start as many threadspjd2005-08-211-5/+10
| | | | | | as we have active CPUs and bind each thread to its own CPU. MFC after: 3 days
* Remove stale comment (we now always start worker thread).pjd2005-08-211-5/+0
| | | | MFC after: 3 days
* Always run dedicated kernel thread (even when we have hardware support).pjd2005-08-171-114/+37
| | | | | | | | There is no performance impact, but allows to allocate memory with M_WAITOK flag. As a side effect this simplify code a bit. MFC after: 3 days
* We should now return 0.pjd2005-08-171-1/+1
|
* Even if crypto_dispatch() return an error, request is not canceled andpjd2005-08-171-12/+2
| | | | | | | | our callback will still be called, just to tell us that requested failed... Reported by: Mike Tancsa <mike@sentex.net> MFC after: 3 days
* We don't need to clear allocated memory. This will speed-up things a bit.pjd2005-08-171-1/+1
| | | | MFC after: 3 days
OpenPOWER on IntegriCloud