mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'v6.19-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu: "API: - Rewrite memcpy_sglist from scratch - Add on-stack AEAD request allocation - Fix partial block processing in ahash Algorithms: - Remove ansi_cprng - Remove tcrypt tests for poly1305 - Fix EINPROGRESS processing in authenc - Fix double-free in zstd Drivers: - Use drbg ctr helper when reseeding xilinx-trng - Add support for PCI device 0x115A to ccp - Add support of paes in caam - Add support for aes-xts in dthev2 Others: - Use likely in rhashtable lookup - Fix lockdep false-positive in padata by removing a helper" * tag 'v6.19-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (71 commits) crypto: zstd - fix double-free in per-CPU stream cleanup crypto: ahash - Zero positive err value in ahash_update_finish crypto: ahash - Fix crypto_ahash_import with partial block data crypto: lib/mpi - use min() instead of min_t() crypto: ccp - use min() instead of min_t() hwrng: core - use min3() instead of nested min_t() crypto: aesni - ctr_crypt() use min() instead of min_t() crypto: drbg - Delete unused ctx from struct sdesc crypto: testmgr - Add missing DES weak and semi-weak key tests Revert "crypto: scatterwalk - Move skcipher walk and use it for memcpy_sglist" crypto: scatterwalk - Fix memcpy_sglist() to always succeed crypto: iaa - Request to add Kanchana P Sridhar to Maintainers. crypto: tcrypt - Remove unused poly1305 support crypto: ansi_cprng - Remove unused ansi_cprng algorithm crypto: asymmetric_keys - fix uninitialized pointers with free attribute KEYS: Avoid -Wflex-array-member-not-at-end warning crypto: ccree - Correctly handle return of sg_nents_for_len crypto: starfive - Correctly handle return of sg_nents_for_len crypto: iaa - Fix incorrect return value in save_iaa_wq() crypto: zstd - Remove unnecessary size_t cast ...
This commit is contained in:
@@ -302,10 +302,9 @@ follows:
|
||||
|
||||
|
||||
Depending on the RNG type, the RNG must be seeded. The seed is provided
|
||||
using the setsockopt interface to set the key. For example, the
|
||||
ansi_cprng requires a seed. The DRBGs do not require a seed, but may be
|
||||
seeded. The seed is also known as a *Personalization String* in NIST SP 800-90A
|
||||
standard.
|
||||
using the setsockopt interface to set the key. The SP800-90A DRBGs do
|
||||
not require a seed, but may be seeded. The seed is also known as a
|
||||
*Personalization String* in NIST SP 800-90A standard.
|
||||
|
||||
Using the read()/recvmsg() system calls, random numbers can be obtained.
|
||||
The kernel generates at most 128 bytes in one call. If user space
|
||||
|
||||
@@ -21,6 +21,9 @@ properties:
|
||||
|
||||
dma-coherent: true
|
||||
|
||||
iommus:
|
||||
maxItems: 4
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
@@ -13,6 +13,7 @@ properties:
|
||||
compatible:
|
||||
items:
|
||||
- enum:
|
||||
- qcom,kaanapali-inline-crypto-engine
|
||||
- qcom,qcs8300-inline-crypto-engine
|
||||
- qcom,sa8775p-inline-crypto-engine
|
||||
- qcom,sc7180-inline-crypto-engine
|
||||
|
||||
@@ -20,6 +20,7 @@ properties:
|
||||
- qcom,ipq5332-trng
|
||||
- qcom,ipq5424-trng
|
||||
- qcom,ipq9574-trng
|
||||
- qcom,kaanapali-trng
|
||||
- qcom,qcs615-trng
|
||||
- qcom,qcs8300-trng
|
||||
- qcom,sa8255p-trng
|
||||
|
||||
@@ -45,6 +45,7 @@ properties:
|
||||
|
||||
- items:
|
||||
- enum:
|
||||
- qcom,kaanapali-qce
|
||||
- qcom,qcs615-qce
|
||||
- qcom,qcs8300-qce
|
||||
- qcom,sa8775p-qce
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
* Microchip PIC32 Random Number Generator
|
||||
|
||||
The PIC32 RNG provides a pseudo random number generator which can be seeded by
|
||||
another true random number generator.
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "microchip,pic32mzda-rng"
|
||||
- reg : Specifies base physical address and size of the registers.
|
||||
- clocks: clock phandle.
|
||||
|
||||
Example:
|
||||
|
||||
rng: rng@1f8e6000 {
|
||||
compatible = "microchip,pic32mzda-rng";
|
||||
reg = <0x1f8e6000 0x1000>;
|
||||
clocks = <&PBCLK5>;
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/rng/microchip,pic32-rng.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Microchip PIC32 Random Number Generator
|
||||
|
||||
description: |
|
||||
The PIC32 RNG provides a pseudo random number generator which can be seeded
|
||||
by another true random number generator.
|
||||
|
||||
maintainers:
|
||||
- Joshua Henderson <joshua.henderson@microchip.com>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- microchip,pic32mzda-rng
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
rng: rng@1f8e6000 {
|
||||
compatible = "microchip,pic32mzda-rng";
|
||||
reg = <0x1f8e6000 0x1000>;
|
||||
clocks = <&PBCLK5>;
|
||||
};
|
||||
@@ -10,6 +10,37 @@ of a Trust Source for greater security, while Encrypted Keys can be used on any
|
||||
system. All user level blobs, are displayed and loaded in hex ASCII for
|
||||
convenience, and are integrity verified.
|
||||
|
||||
Trusted Keys as Protected key
|
||||
=============================
|
||||
It is the secure way of keeping the keys in the kernel key-ring as Trusted-Key,
|
||||
such that:
|
||||
|
||||
- Key-blob, an encrypted key-data, created to be stored, loaded and seen by
|
||||
userspace.
|
||||
- Key-data, the plain-key text in the system memory, to be used by
|
||||
kernel space only.
|
||||
|
||||
Though key-data is not accessible to the user-space in plain-text, but it is in
|
||||
plain-text in system memory, when used in kernel space. Even though kernel-space
|
||||
attracts small surface attack, but with compromised kernel or side-channel
|
||||
attack accessing the system memory can lead to a chance of the key getting
|
||||
compromised/leaked.
|
||||
|
||||
In order to protect the key in kernel space, the concept of "protected-keys" is
|
||||
introduced which will act as an added layer of protection. The key-data of the
|
||||
protected keys is encrypted with Key-Encryption-Key(KEK), and decrypted inside
|
||||
the trust source boundary. The plain-key text never available out-side in the
|
||||
system memory. Thus, any crypto operation that is to be executed using the
|
||||
protected key, can only be done by the trust source, which generated the
|
||||
key blob.
|
||||
|
||||
Hence, if the protected-key is leaked or compromised, it is of no use to the
|
||||
hacker.
|
||||
|
||||
Trusted keys as protected keys, with trust source having the capability of
|
||||
generating:
|
||||
|
||||
- Key-Blob, to be loaded, stored and seen by user-space.
|
||||
|
||||
Trust Source
|
||||
============
|
||||
@@ -252,7 +283,7 @@ in bytes. Trusted Keys can be 32 - 128 bytes (256 - 1024 bits).
|
||||
Trusted Keys usage: CAAM
|
||||
------------------------
|
||||
|
||||
Usage::
|
||||
Trusted Keys Usage::
|
||||
|
||||
keyctl add trusted name "new keylen" ring
|
||||
keyctl add trusted name "load hex_blob" ring
|
||||
@@ -262,6 +293,21 @@ Usage::
|
||||
CAAM-specific format. The key length for new keys is always in bytes.
|
||||
Trusted Keys can be 32 - 128 bytes (256 - 1024 bits).
|
||||
|
||||
Trusted Keys as Protected Keys Usage::
|
||||
|
||||
keyctl add trusted name "new keylen pk [options]" ring
|
||||
keyctl add trusted name "load hex_blob [options]" ring
|
||||
keyctl print keyid
|
||||
|
||||
where, 'pk' is used to direct trust source to generate protected key.
|
||||
|
||||
options:
|
||||
key_enc_algo = For CAAM, supported enc algo are ECB(2), CCM(1).
|
||||
|
||||
"keyctl print" returns an ASCII hex copy of the sealed key, which is in a
|
||||
CAAM-specific format. The key length for new keys is always in bytes.
|
||||
Trusted Keys can be 32 - 128 bytes (256 - 1024 bits).
|
||||
|
||||
Trusted Keys usage: DCP
|
||||
-----------------------
|
||||
|
||||
@@ -343,6 +389,46 @@ Load a trusted key from the saved blob::
|
||||
f1f8fff03ad0acb083725535636addb08d73dedb9832da198081e5deae84bfaf0409c22b
|
||||
e4a8aea2b607ec96931e6f4d4fe563ba
|
||||
|
||||
Create and save a trusted key as protected key named "kmk" of length 32 bytes.
|
||||
|
||||
::
|
||||
|
||||
$ keyctl add trusted kmk "new 32 pk key_enc_algo=1" @u
|
||||
440502848
|
||||
|
||||
$ keyctl show
|
||||
Session Keyring
|
||||
-3 --alswrv 500 500 keyring: _ses
|
||||
97833714 --alswrv 500 -1 \_ keyring: _uid.500
|
||||
440502848 --alswrv 500 500 \_ trusted: kmk
|
||||
|
||||
$ keyctl print 440502848
|
||||
0101000000000000000001005d01b7e3f4a6be5709930f3b70a743cbb42e0cc95e18e915
|
||||
3f60da455bbf1144ad12e4f92b452f966929f6105fd29ca28e4d4d5a031d068478bacb0b
|
||||
27351119f822911b0a11ba3d3498ba6a32e50dac7f32894dd890eb9ad578e4e292c83722
|
||||
a52e56a097e6a68b3f56f7a52ece0cdccba1eb62cad7d817f6dc58898b3ac15f36026fec
|
||||
d568bd4a706cb60bb37be6d8f1240661199d640b66fb0fe3b079f97f450b9ef9c22c6d5d
|
||||
dd379f0facd1cd020281dfa3c70ba21a3fa6fc2471dc6d13ecf8298b946f65345faa5ef0
|
||||
f1f8fff03ad0acb083725535636addb08d73dedb9832da198081e5deae84bfaf0409c22b
|
||||
e4a8aea2b607ec96931e6f4d4fe563ba
|
||||
|
||||
$ keyctl pipe 440502848 > kmk.blob
|
||||
|
||||
Load a trusted key from the saved blob::
|
||||
|
||||
$ keyctl add trusted kmk "load `cat kmk.blob` key_enc_algo=1" @u
|
||||
268728824
|
||||
|
||||
$ keyctl print 268728824
|
||||
0101000000000000000001005d01b7e3f4a6be5709930f3b70a743cbb42e0cc95e18e915
|
||||
3f60da455bbf1144ad12e4f92b452f966929f6105fd29ca28e4d4d5a031d068478bacb0b
|
||||
27351119f822911b0a11ba3d3498ba6a32e50dac7f32894dd890eb9ad578e4e292c83722
|
||||
a52e56a097e6a68b3f56f7a52ece0cdccba1eb62cad7d817f6dc58898b3ac15f36026fec
|
||||
d568bd4a706cb60bb37be6d8f1240661199d640b66fb0fe3b079f97f450b9ef9c22c6d5d
|
||||
dd379f0facd1cd020281dfa3c70ba21a3fa6fc2471dc6d13ecf8298b946f65345faa5ef0
|
||||
f1f8fff03ad0acb083725535636addb08d73dedb9832da198081e5deae84bfaf0409c22b
|
||||
e4a8aea2b607ec96931e6f4d4fe563ba
|
||||
|
||||
Reseal (TPM specific) a trusted key under new PCR values::
|
||||
|
||||
$ keyctl update 268728824 "update pcrinfo=`cat pcr.blob`"
|
||||
|
||||
+1
-1
@@ -6613,7 +6613,6 @@ CRYPTOGRAPHIC RANDOM NUMBER GENERATOR
|
||||
M: Neil Horman <nhorman@tuxdriver.com>
|
||||
L: linux-crypto@vger.kernel.org
|
||||
S: Maintained
|
||||
F: crypto/ansi_cprng.c
|
||||
F: crypto/rng.c
|
||||
|
||||
CS3308 MEDIA DRIVER
|
||||
@@ -12573,6 +12572,7 @@ F: drivers/dma/ioat*
|
||||
INTEL IAA CRYPTO DRIVER
|
||||
M: Kristen Accardi <kristen.c.accardi@intel.com>
|
||||
M: Vinicius Costa Gomes <vinicius.gomes@intel.com>
|
||||
M: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
|
||||
L: linux-crypto@vger.kernel.org
|
||||
S: Supported
|
||||
F: Documentation/driver-api/crypto/iaa/iaa-crypto.rst
|
||||
|
||||
@@ -232,4 +232,3 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60
|
||||
CONFIG_DEBUG_USER=y
|
||||
CONFIG_CRYPTO_GCM=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
|
||||
@@ -75,5 +75,4 @@ CONFIG_MINIX_FS=y
|
||||
CONFIG_DEBUG_USER=y
|
||||
CONFIG_DEBUG_LL=y
|
||||
CONFIG_EARLY_PRINTK=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
|
||||
@@ -126,7 +126,6 @@ CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_CRYPTO_SHA512=y
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
CONFIG_CRYPTO_DEV_MARVELL_CESA=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
# CONFIG_DEBUG_BUGVERBOSE is not set
|
||||
|
||||
@@ -119,4 +119,3 @@ CONFIG_DEBUG_SPINLOCK=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_DEBUG_USER=y
|
||||
CONFIG_DEBUG_LL=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
|
||||
@@ -92,4 +92,3 @@ CONFIG_NLS_UTF8=m
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
# CONFIG_FTRACE is not set
|
||||
CONFIG_DEBUG_LL=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
|
||||
@@ -228,7 +228,6 @@ CONFIG_CRYPTO_DES=y
|
||||
CONFIG_CRYPTO_CBC=y
|
||||
CONFIG_CRYPTO_CTR=y
|
||||
CONFIG_CRYPTO_XCBC=y
|
||||
CONFIG_CRYPTO_ANSI_CPRNG=y
|
||||
CONFIG_CRYPTO_USER_API_HASH=y
|
||||
CONFIG_CRYPTO_USER_API_SKCIPHER=y
|
||||
CONFIG_DMA_CMA=y
|
||||
|
||||
@@ -177,7 +177,6 @@ CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_UTF8=y
|
||||
CONFIG_CRYPTO_ANSI_CPRNG=y
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_DYNAMIC_DEBUG=y
|
||||
|
||||
@@ -78,4 +78,3 @@ CONFIG_DEBUG_USER=y
|
||||
CONFIG_DEBUG_LL=y
|
||||
CONFIG_DEBUG_MMP_UART3=y
|
||||
CONFIG_EARLY_PRINTK=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
|
||||
@@ -121,4 +121,3 @@ CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_SCHEDSTATS=y
|
||||
CONFIG_DEBUG_USER=y
|
||||
CONFIG_DEBUG_LL=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
|
||||
@@ -220,7 +220,6 @@ CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_PCBC=y
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
CONFIG_FONTS=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_8x16=y
|
||||
|
||||
@@ -145,4 +145,3 @@ CONFIG_LATENCYTOP=y
|
||||
# CONFIG_FTRACE is not set
|
||||
CONFIG_DEBUG_USER=y
|
||||
CONFIG_DEBUG_LL=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user