Skip to content

Commit a619fe3

Browse files
committed
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 ...
2 parents c832183 + 48bc9da commit a619fe3

170 files changed

Lines changed: 2028 additions & 1682 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/crypto/userspace-if.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,9 @@ follows:
302302

303303

304304
Depending on the RNG type, the RNG must be seeded. The seed is provided
305-
using the setsockopt interface to set the key. For example, the
306-
ansi_cprng requires a seed. The DRBGs do not require a seed, but may be
307-
seeded. The seed is also known as a *Personalization String* in NIST SP 800-90A
308-
standard.
305+
using the setsockopt interface to set the key. The SP800-90A DRBGs do
306+
not require a seed, but may be seeded. The seed is also known as a
307+
*Personalization String* in NIST SP 800-90A standard.
309308

310309
Using the read()/recvmsg() system calls, random numbers can be obtained.
311310
The kernel generates at most 128 bytes in one call. If user space

Documentation/devicetree/bindings/crypto/amd,ccp-seattle-v1a.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ properties:
2121

2222
dma-coherent: true
2323

24+
iommus:
25+
maxItems: 4
26+
2427
required:
2528
- compatible
2629
- reg

Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ properties:
1313
compatible:
1414
items:
1515
- enum:
16+
- qcom,kaanapali-inline-crypto-engine
1617
- qcom,qcs8300-inline-crypto-engine
1718
- qcom,sa8775p-inline-crypto-engine
1819
- qcom,sc7180-inline-crypto-engine

Documentation/devicetree/bindings/crypto/qcom,prng.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ properties:
2020
- qcom,ipq5332-trng
2121
- qcom,ipq5424-trng
2222
- qcom,ipq9574-trng
23+
- qcom,kaanapali-trng
2324
- qcom,qcs615-trng
2425
- qcom,qcs8300-trng
2526
- qcom,sa8255p-trng

Documentation/devicetree/bindings/crypto/qcom-qce.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ properties:
4545

4646
- items:
4747
- enum:
48+
- qcom,kaanapali-qce
4849
- qcom,qcs615-qce
4950
- qcom,qcs8300-qce
5051
- qcom,sa8775p-qce

Documentation/devicetree/bindings/rng/microchip,pic32-rng.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/rng/microchip,pic32-rng.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Microchip PIC32 Random Number Generator
8+
9+
description: |
10+
The PIC32 RNG provides a pseudo random number generator which can be seeded
11+
by another true random number generator.
12+
13+
maintainers:
14+
- Joshua Henderson <joshua.henderson@microchip.com>
15+
16+
properties:
17+
compatible:
18+
enum:
19+
- microchip,pic32mzda-rng
20+
21+
reg:
22+
maxItems: 1
23+
24+
clocks:
25+
maxItems: 1
26+
27+
required:
28+
- compatible
29+
- reg
30+
- clocks
31+
32+
additionalProperties: false
33+
34+
examples:
35+
- |
36+
rng: rng@1f8e6000 {
37+
compatible = "microchip,pic32mzda-rng";
38+
reg = <0x1f8e6000 0x1000>;
39+
clocks = <&PBCLK5>;
40+
};

Documentation/security/keys/trusted-encrypted.rst

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,37 @@ of a Trust Source for greater security, while Encrypted Keys can be used on any
1010
system. All user level blobs, are displayed and loaded in hex ASCII for
1111
convenience, and are integrity verified.
1212

13+
Trusted Keys as Protected key
14+
=============================
15+
It is the secure way of keeping the keys in the kernel key-ring as Trusted-Key,
16+
such that:
17+
18+
- Key-blob, an encrypted key-data, created to be stored, loaded and seen by
19+
userspace.
20+
- Key-data, the plain-key text in the system memory, to be used by
21+
kernel space only.
22+
23+
Though key-data is not accessible to the user-space in plain-text, but it is in
24+
plain-text in system memory, when used in kernel space. Even though kernel-space
25+
attracts small surface attack, but with compromised kernel or side-channel
26+
attack accessing the system memory can lead to a chance of the key getting
27+
compromised/leaked.
28+
29+
In order to protect the key in kernel space, the concept of "protected-keys" is
30+
introduced which will act as an added layer of protection. The key-data of the
31+
protected keys is encrypted with Key-Encryption-Key(KEK), and decrypted inside
32+
the trust source boundary. The plain-key text never available out-side in the
33+
system memory. Thus, any crypto operation that is to be executed using the
34+
protected key, can only be done by the trust source, which generated the
35+
key blob.
36+
37+
Hence, if the protected-key is leaked or compromised, it is of no use to the
38+
hacker.
39+
40+
Trusted keys as protected keys, with trust source having the capability of
41+
generating:
42+
43+
- Key-Blob, to be loaded, stored and seen by user-space.
1344

1445
Trust Source
1546
============
@@ -252,7 +283,7 @@ in bytes. Trusted Keys can be 32 - 128 bytes (256 - 1024 bits).
252283
Trusted Keys usage: CAAM
253284
------------------------
254285

255-
Usage::
286+
Trusted Keys Usage::
256287

257288
keyctl add trusted name "new keylen" ring
258289
keyctl add trusted name "load hex_blob" ring
@@ -262,6 +293,21 @@ Usage::
262293
CAAM-specific format. The key length for new keys is always in bytes.
263294
Trusted Keys can be 32 - 128 bytes (256 - 1024 bits).
264295

296+
Trusted Keys as Protected Keys Usage::
297+
298+
keyctl add trusted name "new keylen pk [options]" ring
299+
keyctl add trusted name "load hex_blob [options]" ring
300+
keyctl print keyid
301+
302+
where, 'pk' is used to direct trust source to generate protected key.
303+
304+
options:
305+
key_enc_algo = For CAAM, supported enc algo are ECB(2), CCM(1).
306+
307+
"keyctl print" returns an ASCII hex copy of the sealed key, which is in a
308+
CAAM-specific format. The key length for new keys is always in bytes.
309+
Trusted Keys can be 32 - 128 bytes (256 - 1024 bits).
310+
265311
Trusted Keys usage: DCP
266312
-----------------------
267313

@@ -343,6 +389,46 @@ Load a trusted key from the saved blob::
343389
f1f8fff03ad0acb083725535636addb08d73dedb9832da198081e5deae84bfaf0409c22b
344390
e4a8aea2b607ec96931e6f4d4fe563ba
345391

392+
Create and save a trusted key as protected key named "kmk" of length 32 bytes.
393+
394+
::
395+
396+
$ keyctl add trusted kmk "new 32 pk key_enc_algo=1" @u
397+
440502848
398+
399+
$ keyctl show
400+
Session Keyring
401+
-3 --alswrv 500 500 keyring: _ses
402+
97833714 --alswrv 500 -1 \_ keyring: _uid.500
403+
440502848 --alswrv 500 500 \_ trusted: kmk
404+
405+
$ keyctl print 440502848
406+
0101000000000000000001005d01b7e3f4a6be5709930f3b70a743cbb42e0cc95e18e915
407+
3f60da455bbf1144ad12e4f92b452f966929f6105fd29ca28e4d4d5a031d068478bacb0b
408+
27351119f822911b0a11ba3d3498ba6a32e50dac7f32894dd890eb9ad578e4e292c83722
409+
a52e56a097e6a68b3f56f7a52ece0cdccba1eb62cad7d817f6dc58898b3ac15f36026fec
410+
d568bd4a706cb60bb37be6d8f1240661199d640b66fb0fe3b079f97f450b9ef9c22c6d5d
411+
dd379f0facd1cd020281dfa3c70ba21a3fa6fc2471dc6d13ecf8298b946f65345faa5ef0
412+
f1f8fff03ad0acb083725535636addb08d73dedb9832da198081e5deae84bfaf0409c22b
413+
e4a8aea2b607ec96931e6f4d4fe563ba
414+
415+
$ keyctl pipe 440502848 > kmk.blob
416+
417+
Load a trusted key from the saved blob::
418+
419+
$ keyctl add trusted kmk "load `cat kmk.blob` key_enc_algo=1" @u
420+
268728824
421+
422+
$ keyctl print 268728824
423+
0101000000000000000001005d01b7e3f4a6be5709930f3b70a743cbb42e0cc95e18e915
424+
3f60da455bbf1144ad12e4f92b452f966929f6105fd29ca28e4d4d5a031d068478bacb0b
425+
27351119f822911b0a11ba3d3498ba6a32e50dac7f32894dd890eb9ad578e4e292c83722
426+
a52e56a097e6a68b3f56f7a52ece0cdccba1eb62cad7d817f6dc58898b3ac15f36026fec
427+
d568bd4a706cb60bb37be6d8f1240661199d640b66fb0fe3b079f97f450b9ef9c22c6d5d
428+
dd379f0facd1cd020281dfa3c70ba21a3fa6fc2471dc6d13ecf8298b946f65345faa5ef0
429+
f1f8fff03ad0acb083725535636addb08d73dedb9832da198081e5deae84bfaf0409c22b
430+
e4a8aea2b607ec96931e6f4d4fe563ba
431+
346432
Reseal (TPM specific) a trusted key under new PCR values::
347433

348434
$ keyctl update 268728824 "update pcrinfo=`cat pcr.blob`"

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6613,7 +6613,6 @@ CRYPTOGRAPHIC RANDOM NUMBER GENERATOR
66136613
M: Neil Horman <nhorman@tuxdriver.com>
66146614
L: linux-crypto@vger.kernel.org
66156615
S: Maintained
6616-
F: crypto/ansi_cprng.c
66176616
F: crypto/rng.c
66186617

66196618
CS3308 MEDIA DRIVER
@@ -12573,6 +12572,7 @@ F: drivers/dma/ioat*
1257312572
INTEL IAA CRYPTO DRIVER
1257412573
M: Kristen Accardi <kristen.c.accardi@intel.com>
1257512574
M: Vinicius Costa Gomes <vinicius.gomes@intel.com>
12575+
M: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
1257612576
L: linux-crypto@vger.kernel.org
1257712577
S: Supported
1257812578
F: Documentation/driver-api/crypto/iaa/iaa-crypto.rst

arch/arm/configs/axm55xx_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,3 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60
232232
CONFIG_DEBUG_USER=y
233233
CONFIG_CRYPTO_GCM=y
234234
CONFIG_CRYPTO_SHA256=y
235-
# CONFIG_CRYPTO_ANSI_CPRNG is not set

0 commit comments

Comments
 (0)