Revision tags: release/14.0.0 |
|
#
95ee2897 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0 |
|
#
2dbc9a38 |
| 28-Sep-2021 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Fix memory deadlock when GELI partition is used for swap.
When we get low on memory, the VM system tries to free some by swapping pages. However, if we are so low on free pages that GELI allocations
Fix memory deadlock when GELI partition is used for swap.
When we get low on memory, the VM system tries to free some by swapping pages. However, if we are so low on free pages that GELI allocations block, then the swapout operation cannot complete. This keeps the VM system from being able to free enough memory so the allocation can complete.
To alleviate this, keep a UMA pool at the GELI layer which is used for data buffer allocation in the fast path, and reserve some of that memory for swap operations. If an IO operation is a swap, then use the reserved memory. If the allocation still fails, return ENOMEM instead of blocking.
For non-swap allocations, change the default to using M_NOWAIT. In general, this *should* be better, since it gives upper layers a signal of the memory pressure and a chance to manage their failure strategy appropriately. However, a user can set the kern.geom.eli.blocking_malloc sysctl/tunable to restore the previous M_WAITOK strategy.
Submitted by: jtl Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24400
show more ...
|
Revision tags: release/13.0.0, release/12.2.0 |
|
#
0c97af56 |
| 15-Sep-2020 |
Warner Losh <imp@FreeBSD.org> |
We don't need the sc_ekeys_lock in standalone environment.
When we bring in geli into the boot loader, we are single threaded so we don't have to worry about locking. We have no mutexes, and don't n
We don't need the sc_ekeys_lock in standalone environment.
When we bring in geli into the boot loader, we are single threaded so we don't have to worry about locking. We have no mutexes, and don't need to use them, so comment it out.
MFC After: 3 days
show more ...
|
Revision tags: release/11.4.0 |
|
#
a3d565a1 |
| 10-Jun-2020 |
John Baldwin <jhb@FreeBSD.org> |
Add a crypto capability flag for accelerated software drivers.
Use this in GELI to print out a different message when accelerated software such as AESNI is used vs plain software crypto.
While here
Add a crypto capability flag for accelerated software drivers.
Use this in GELI to print out a different message when accelerated software such as AESNI is used vs plain software crypto.
While here, simplify the logic in GELI a bit for determing which type of crypto driver was chosen the first time by examining the capabilities of the matched driver after a single call to crypto_newsession rather than making separate calls with different flags.
Reviewed by: delphij Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25126
show more ...
|
#
bfe26b97 |
| 15-Apr-2020 |
John Baldwin <jhb@FreeBSD.org> |
Mark eli_metadata_crypto_supported inline.
This quiets warnings about it not being always used.
Reported by: kevans
|
#
e2b99193 |
| 15-Apr-2020 |
John Baldwin <jhb@FreeBSD.org> |
Remove support for geli(4) algorithms deprecated in r348206.
This removes support for reading and writing volumes using the following algorithms:
- Triple DES - Blowfish - MD5 HMAC integrity
In ad
Remove support for geli(4) algorithms deprecated in r348206.
This removes support for reading and writing volumes using the following algorithms:
- Triple DES - Blowfish - MD5 HMAC integrity
In addition, this commit adds an explicit whitelist of supported algorithms to give a better error message when an invalid or unsupported algorithm is used by an existing volume.
Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24343
show more ...
|
#
c0341432 |
| 27-Mar-2020 |
John Baldwin <jhb@FreeBSD.org> |
Refactor driver and consumer interfaces for OCF (in-kernel crypto).
- The linked list of cryptoini structures used in session initialization is replaced with a new flat structure: struct crypto_
Refactor driver and consumer interfaces for OCF (in-kernel crypto).
- The linked list of cryptoini structures used in session initialization is replaced with a new flat structure: struct crypto_session_params. This session includes a new mode to define how the other fields should be interpreted. Available modes include:
- COMPRESS (for compression/decompression) - CIPHER (for simply encryption/decryption) - DIGEST (computing and verifying digests) - AEAD (combined auth and encryption such as AES-GCM and AES-CCM) - ETA (combined auth and encryption using encrypt-then-authenticate)
Additional modes could be added in the future (e.g. if we wanted to support TLS MtE for AES-CBC in the kernel we could add a new mode for that. TLS modes might also affect how AAD is interpreted, etc.)
The flat structure also includes the key lengths and algorithms as before. However, code doesn't have to walk the linked list and switch on the algorithm to determine which key is the auth key vs encryption key. The 'csp_auth_*' fields are always used for auth keys and settings and 'csp_cipher_*' for cipher. (Compression algorithms are stored in csp_cipher_alg.)
- Drivers no longer register a list of supported algorithms. This doesn't quite work when you factor in modes (e.g. a driver might support both AES-CBC and SHA2-256-HMAC separately but not combined for ETA). Instead, a new 'crypto_probesession' method has been added to the kobj interface for symmteric crypto drivers. This method returns a negative value on success (similar to how device_probe works) and the crypto framework uses this value to pick the "best" driver. There are three constants for hardware (e.g. ccr), accelerated software (e.g. aesni), and plain software (cryptosoft) that give preference in that order. One effect of this is that if you request only hardware when creating a new session, you will no longer get a session using accelerated software. Another effect is that the default setting to disallow software crypto via /dev/crypto now disables accelerated software.
Once a driver is chosen, 'crypto_newsession' is invoked as before.
- Crypto operations are now solely described by the flat 'cryptop' structure. The linked list of descriptors has been removed.
A separate enum has been added to describe the type of data buffer in use instead of using CRYPTO_F_* flags to make it easier to add more types in the future if needed (e.g. wired userspace buffers for zero-copy). It will also make it easier to re-introduce separate input and output buffers (in-kernel TLS would benefit from this).
Try to make the flags related to IV handling less insane:
- CRYPTO_F_IV_SEPARATE means that the IV is stored in the 'crp_iv' member of the operation structure. If this flag is not set, the IV is stored in the data buffer at the 'crp_iv_start' offset.
- CRYPTO_F_IV_GENERATE means that a random IV should be generated and stored into the data buffer. This cannot be used with CRYPTO_F_IV_SEPARATE.
If a consumer wants to deal with explicit vs implicit IVs, etc. it can always generate the IV however it needs and store partial IVs in the buffer and the full IV/nonce in crp_iv and set CRYPTO_F_IV_SEPARATE.
The layout of the buffer is now described via fields in cryptop. crp_aad_start and crp_aad_length define the boundaries of any AAD. Previously with GCM and CCM you defined an auth crd with this range, but for ETA your auth crd had to span both the AAD and plaintext (and they had to be adjacent).
crp_payload_start and crp_payload_length define the boundaries of the plaintext/ciphertext. Modes that only do a single operation (COMPRESS, CIPHER, DIGEST) should only use this region and leave the AAD region empty.
If a digest is present (or should be generated), it's starting location is marked by crp_digest_start.
Instead of using the CRD_F_ENCRYPT flag to determine the direction of the operation, cryptop now includes an 'op' field defining the operation to perform. For digests I've added a new VERIFY digest mode which assumes a digest is present in the input and fails the request with EBADMSG if it doesn't match the internally-computed digest. GCM and CCM already assumed this, and the new AEAD mode requires this for decryption. The new ETA mode now also requires this for decryption, so IPsec and GELI no longer do their own authentication verification. Simple DIGEST operations can also do this, though there are no in-tree consumers.
To eventually support some refcounting to close races, the session cookie is now passed to crypto_getop() and clients should no longer set crp_sesssion directly.
- Assymteric crypto operation structures should be allocated via crypto_getkreq() and freed via crypto_freekreq(). This permits the crypto layer to track open asym requests and close races with a driver trying to unregister while asym requests are in flight.
- crypto_copyback, crypto_copydata, crypto_apply, and crypto_contiguous_subsegment now accept the 'crp' object as the first parameter instead of individual members. This makes it easier to deal with different buffer types in the future as well as separate input and output buffers. It's also simpler for driver writers to use.
- bus_dmamap_load_crp() loads a DMA mapping for a crypto buffer. This understands the various types of buffers so that drivers that use DMA do not have to be aware of different buffer types.
- Helper routines now exist to build an auth context for HMAC IPAD and OPAD. This reduces some duplicated work among drivers.
- Key buffers are now treated as const throughout the framework and in device drivers. However, session key buffers provided when a session is created are expected to remain alive for the duration of the session.
- GCM and CCM sessions now only specify a cipher algorithm and a cipher key. The redundant auth information is not needed or used.
- For cryptosoft, split up the code a bit such that the 'process' callback now invokes a function pointer in the session. This function pointer is set based on the mode (in effect) though it simplifies a few edge cases that would otherwise be in the switch in 'process'.
It does split up GCM vs CCM which I think is more readable even if there is some duplication.
- I changed /dev/crypto to support GMAC requests using CRYPTO_AES_NIST_GMAC as an auth algorithm and updated cryptocheck to work with it.
- Combined cipher and auth sessions via /dev/crypto now always use ETA mode. The COP_F_CIPHER_FIRST flag is now a no-op that is ignored. This was actually documented as being true in crypto(4) before, but the code had not implemented this before I added the CIPHER_FIRST flag.
- I have not yet updated /dev/crypto to be aware of explicit modes for sessions. I will probably do that at some point in the future as well as teach it about IV/nonce and tag lengths for AEAD so we can support all of the NIST KAT tests for GCM and CCM.
- I've split up the exising crypto.9 manpage into several pages of which many are written from scratch.
- I have converted all drivers and consumers in the tree and verified that they compile, but I have not tested all of them. I have tested the following drivers:
- cryptosoft - aesni (AES only) - blake2 - ccr
and the following consumers:
- cryptodev - IPsec - ktls_ocf - GELI (lightly)
I have not tested the following:
- ccp - aesni with sha - hifn - kgssapi_krb5 - ubsec - padlock - safe - armv8_crypto (aarch64) - glxsb (i386) - sec (ppc) - cesa (armv7) - cryptocteon (mips64) - nlmsec (mips64)
Discussed with: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D23677
show more ...
|
Revision tags: release/12.1.0 |
|
#
ac03832e |
| 07-Aug-2019 |
Conrad Meyer <cem@FreeBSD.org> |
GEOM: Reduce unnecessary log interleaving with sbufs
Similar to what was done for device_printfs in r347229.
Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an sbuf; docum
GEOM: Reduce unnecessary log interleaving with sbufs
Similar to what was done for device_printfs in r347229.
Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an sbuf; documented in g_bio.9.
Reviewed by: markj Discussed with: rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21165
show more ...
|
Revision tags: release/11.3.0 |
|
#
e532a999 |
| 20-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @349234
Sponsored by: The FreeBSD Foundation
|
#
e7630efb |
| 12-Jun-2019 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
geli: partially revert r348709
Let's change the unsigned arguments to the signed one, but let's don't change pointers to the array notation.
Requested by: pjd
|
#
0269ae4c |
| 06-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @348740
Sponsored by: The FreeBSD Foundation
|
#
1808673c |
| 06-Jun-2019 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
geli: build warning fixes
Submitted by: Aaron Prieger <aprieger@llnw.com> Reviewed by: sbruno Differential Revision: https://reviews.freebsd.org/D11068
|
#
9a696dc6 |
| 04-Apr-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead@r345880
|
#
2f07cdf8 |
| 04-Apr-2019 |
Pawel Jakub Dawidek <pjd@FreeBSD.org> |
Implement automatic online expansion of GELI providers - if the underlying provider grows, GELI will expand automatically and will move the metadata to the new location of the last sector.
This func
Implement automatic online expansion of GELI providers - if the underlying provider grows, GELI will expand automatically and will move the metadata to the new location of the last sector.
This functionality is turned on by default. It can be turned off with the -R flag, but it is not recommended - if the underlying provider grows and automatic expansion is turned off, it won't be possible to attach this provider again, as the metadata is no longer located in the last sector.
If the automatic expansion is turned off and the underlying provider grows, GELI will only log a message with the previous size of the provider, so recovery can be easier.
Obtained from: Fudo Security
show more ...
|
Revision tags: release/12.0.0 |
|
#
1df7f415 |
| 16-Jul-2018 |
Conrad Meyer <cem@FreeBSD.org> |
OCF: Convert consumers to the session id typedef
These were missed in the earlier r336269.
No functional change.
Sponsored by: Dell EMC Isilon
|
Revision tags: release/11.2.0 |
|
#
31f7586d |
| 09-May-2018 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
Introduce the 'n' flag for the geli attach command.
If the 'n' flag is provided the provided key number will be used to decrypt device. This can be used combined with dryrun to verify if the key is
Introduce the 'n' flag for the geli attach command.
If the 'n' flag is provided the provided key number will be used to decrypt device. This can be used combined with dryrun to verify if the key is set correctly. This can be also used to determine which key slot we want to change on already attached device.
Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D15309
show more ...
|
#
3728855a |
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys/geom: adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone
sys/geom: adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
show more ...
|
Revision tags: release/10.4.0 |
|
#
b754c279 |
| 13-Sep-2017 |
Navdeep Parhar <np@FreeBSD.org> |
MFH @ r323558.
|
#
3934d280 |
| 28-Aug-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r322957
|
#
3453dc72 |
| 26-Aug-2017 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
Hide length of geli passphrase during boot.
Introduce additional flag to the geli which allows to restore previous behavior.
Reviewed by: AllanJude@, cem@ (previous version) MFC: 1 month Relnotes:
Hide length of geli passphrase during boot.
Introduce additional flag to the geli which allows to restore previous behavior.
Reviewed by: AllanJude@, cem@ (previous version) MFC: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11751
show more ...
|
Revision tags: release/11.1.0 |
|
#
d0338a29 |
| 22-Apr-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r317216 through r317280.
|
#
d109d8ad |
| 21-Apr-2017 |
Alexander Motin <mav@FreeBSD.org> |
Dump md_iterations as signed, which it really is.
PR: 208305 PR: 196834 MFC after: 2 weeks
|
#
ec5c0e5b |
| 01-Apr-2017 |
Allan Jude <allanjude@FreeBSD.org> |
Implement boot-time encryption key passing (keybuf)
This patch adds a general mechanism for providing encryption keys to the kernel from the boot loader. This is intended to enable GELI support at b
Implement boot-time encryption key passing (keybuf)
This patch adds a general mechanism for providing encryption keys to the kernel from the boot loader. This is intended to enable GELI support at boot time, providing a better mechanism for passing keys to the kernel than environment variables. It is designed to be extensible to other applications, and can easily handle multiple encrypted volumes with different keys.
This mechanism is currently used by the pending GELI EFI work. Additionally, this mechanism can potentially be used to interface with GRUB, opening up options for coreboot+GRUB configurations with completely encrypted disks.
Another benefit over the existing system is that it does not require re-deriving the user key from the password at each boot stage.
Most of this patch was written by Eric McCorkle. It was extended by Allan Jude with a number of minor enhancements and extending the keybuf feature into boot2.
GELI user keys are now derived once, in boot2, then passed to the loader, which reuses the key, then passes it to the kernel, where the GELI module destroys the keybuf after decrypting the volumes.
Submitted by: Eric McCorkle <eric@metricspace.net> (Original Version) Reviewed by: oshogbo (earlier version), cem (earlier version) MFC after: 3 weeks Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D9575
show more ...
|
#
6ae9acde |
| 23-Feb-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r313896 through r314128.
|