mirror-linux/crypto
Linus Torvalds 0923fd0419 Locking updates for v6.20:
Lock debugging:
 
  - Implement compiler-driven static analysis locking context
    checking, using the upcoming Clang 22 compiler's context
    analysis features. (Marco Elver)
 
    We removed Sparse context analysis support, because prior to
    removal even a defconfig kernel produced 1,700+ context
    tracking Sparse warnings, the overwhelming majority of which
    are false positives. On an allmodconfig kernel the number of
    false positive context tracking Sparse warnings grows to
    over 5,200... On the plus side of the balance actual locking
    bugs found by Sparse context analysis is also rather ... sparse:
    I found only 3 such commits in the last 3 years. So the
    rate of false positives and the maintenance overhead is
    rather high and there appears to be no active policy in
    place to achieve a zero-warnings baseline to move the
    annotations & fixers to developers who introduce new code.
 
    Clang context analysis is more complete and more aggressive
    in trying to find bugs, at least in principle. Plus it has
    a different model to enabling it: it's enabled subsystem by
    subsystem, which results in zero warnings on all relevant
    kernel builds (as far as our testing managed to cover it).
    Which allowed us to enable it by default, similar to other
    compiler warnings, with the expectation that there are no
    warnings going forward. This enforces a zero-warnings baseline
    on clang-22+ builds. (Which are still limited in distribution,
    admittedly.)
 
    Hopefully the Clang approach can lead to a more maintainable
    zero-warnings status quo and policy, with more and more
    subsystems and drivers enabling the feature. Context tracking
    can be enabled for all kernel code via WARN_CONTEXT_ANALYSIS_ALL=y
    (default disabled), but this will generate a lot of false positives.
 
    ( Having said that, Sparse support could still be added back,
      if anyone is interested - the removal patch is still
      relatively straightforward to revert at this stage. )
 
 Rust integration updates: (Alice Ryhl, Fujita Tomonori, Boqun Feng)
 
   - Add support for Atomic<i8/i16/bool> and replace most Rust native
     AtomicBool usages with Atomic<bool>
 
   - Clean up LockClassKey and improve its documentation
 
   - Add missing Send and Sync trait implementation for SetOnce
 
   - Make ARef Unpin as it is supposed to be
 
   - Add __rust_helper to a few Rust helpers as a preparation for
     helper LTO
 
   - Inline various lock related functions to avoid additional
     function calls.
 
 WW mutexes:
 
   - Extend ww_mutex tests and other test-ww_mutex updates (John Stultz)
 
 Misc fixes and cleanups:
 
   - rcu: Mark lockdep_assert_rcu_helper() __always_inline
     (Arnd Bergmann)
 
   - locking/local_lock: Include more missing headers (Peter Zijlstra)
 
   - seqlock: fix scoped_seqlock_read kernel-doc (Randy Dunlap)
 
   - rust: sync: Replace `kernel::c_str!` with C-Strings
     (Tamir Duberstein)
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmmIXiURHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1gH+A/9GX5UmU6+HuDfDrCtXm9GDve6wkwahvcW
 jLDxOYjs764I2BhyjZnjKjyF5zw60hbykem7Wcf5EV2YH30nM4XRgEWVJfkr1UAI
 Pra415X4DdOzZ6qYQIpO8Udt1LtR7BMSaXITVLJaLicxEoOVtq3SKxjqyhCFs7UW
 MfJdqleB+RMLqq3LlzgB4l43eKk1xyeHh+oQwI0RSxuIpVZme3p4TObnCKjIWnK7
 Ihd+dkgC852WBjANgNL7F/sd5UsF5QX3wjtOrLhMKvkIgTPdXln0g398pivjN/G/
 Kpnw18SFeb159JfJu8eMotsYvVnQ0D5aOcTBfL4qvOHCImhpcu2s6ik9BcXqt2yT
 8IiuWk9xEM3Ok+I/I4ClT5cf5GYpyigV2QsXxn+IjDX5Na8v4zlHh0r8SElP8fOt
 7dpQx7iw8UghAib3AzA3suN78Oh39m8l5BNobj7LAjnqOQcVvoPo4o7/48ntuH7A
 38EucFrXfxQBMfGbMwvxEmgYuX7MyVfQLaPE06MHy1BkZkffT8Um38TB0iNtZmtf
 WUx01yLKWYspehlwFi319uVI4/Zp7FnTfqa5uKv1oSXVdL9vZojSXUzrgDV7FVqT
 Z4xAAw/kwNHpUG7y0zNOqd6PukovG1t+CjbLvK+eHPwc5c0vEGG2oTRAfEvvP1z/
 kesYDmCyJnk=
 =N1gA
 -----END PGP SIGNATURE-----

Merge tag 'locking-core-2026-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking updates from Ingo Molnar:
 "Lock debugging:

   - Implement compiler-driven static analysis locking context checking,
     using the upcoming Clang 22 compiler's context analysis features
     (Marco Elver)

     We removed Sparse context analysis support, because prior to
     removal even a defconfig kernel produced 1,700+ context tracking
     Sparse warnings, the overwhelming majority of which are false
     positives. On an allmodconfig kernel the number of false positive
     context tracking Sparse warnings grows to over 5,200... On the plus
     side of the balance actual locking bugs found by Sparse context
     analysis is also rather ... sparse: I found only 3 such commits in
     the last 3 years. So the rate of false positives and the
     maintenance overhead is rather high and there appears to be no
     active policy in place to achieve a zero-warnings baseline to move
     the annotations & fixers to developers who introduce new code.

     Clang context analysis is more complete and more aggressive in
     trying to find bugs, at least in principle. Plus it has a different
     model to enabling it: it's enabled subsystem by subsystem, which
     results in zero warnings on all relevant kernel builds (as far as
     our testing managed to cover it). Which allowed us to enable it by
     default, similar to other compiler warnings, with the expectation
     that there are no warnings going forward. This enforces a
     zero-warnings baseline on clang-22+ builds (Which are still limited
     in distribution, admittedly)

     Hopefully the Clang approach can lead to a more maintainable
     zero-warnings status quo and policy, with more and more subsystems
     and drivers enabling the feature. Context tracking can be enabled
     for all kernel code via WARN_CONTEXT_ANALYSIS_ALL=y (default
     disabled), but this will generate a lot of false positives.

     ( Having said that, Sparse support could still be added back,
       if anyone is interested - the removal patch is still
       relatively straightforward to revert at this stage. )

  Rust integration updates: (Alice Ryhl, Fujita Tomonori, Boqun Feng)

    - Add support for Atomic<i8/i16/bool> and replace most Rust native
      AtomicBool usages with Atomic<bool>

    - Clean up LockClassKey and improve its documentation

    - Add missing Send and Sync trait implementation for SetOnce

    - Make ARef Unpin as it is supposed to be

    - Add __rust_helper to a few Rust helpers as a preparation for
      helper LTO

    - Inline various lock related functions to avoid additional function
      calls

  WW mutexes:

    - Extend ww_mutex tests and other test-ww_mutex updates (John
      Stultz)

  Misc fixes and cleanups:

    - rcu: Mark lockdep_assert_rcu_helper() __always_inline (Arnd
      Bergmann)

    - locking/local_lock: Include more missing headers (Peter Zijlstra)

    - seqlock: fix scoped_seqlock_read kernel-doc (Randy Dunlap)

    - rust: sync: Replace `kernel::c_str!` with C-Strings (Tamir
      Duberstein)"

* tag 'locking-core-2026-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (90 commits)
  locking/rwlock: Fix write_trylock_irqsave() with CONFIG_INLINE_WRITE_TRYLOCK
  rcu: Mark lockdep_assert_rcu_helper() __always_inline
  compiler-context-analysis: Remove __assume_ctx_lock from initializers
  tomoyo: Use scoped init guard
  crypto: Use scoped init guard
  kcov: Use scoped init guard
  compiler-context-analysis: Introduce scoped init guards
  cleanup: Make __DEFINE_LOCK_GUARD handle commas in initializers
  seqlock: fix scoped_seqlock_read kernel-doc
  tools: Update context analysis macros in compiler_types.h
  rust: sync: Replace `kernel::c_str!` with C-Strings
  rust: sync: Inline various lock related methods
  rust: helpers: Move #define __rust_helper out of atomic.c
  rust: wait: Add __rust_helper to helpers
  rust: time: Add __rust_helper to helpers
  rust: task: Add __rust_helper to helpers
  rust: sync: Add __rust_helper to helpers
  rust: refcount: Add __rust_helper to helpers
  rust: rcu: Add __rust_helper to helpers
  rust: processor: Add __rust_helper to helpers
  ...
2026-02-10 12:28:44 -08:00
..
asymmetric_keys pkcs7: Change a pr_warn() to pr_warn_once() 2026-02-05 15:44:00 +00:00
async_tx lib/raid6: replace custom zero page with ZERO_PAGE 2025-07-09 22:57:54 -07:00
krb5 crypto: krb5 - Fix memory leak in krb5_test_one_prf() 2025-07-18 20:52:00 +10:00
842.c crypto: comp - Use same definition of context alloc and free ops 2025-09-20 20:21:03 +08:00
Kconfig keys: Support for ML-DSA module signing 2026-02-10 09:32:30 -08:00
Makefile Locking updates for v6.20: 2026-02-10 12:28:44 -08:00
acompress.c Locking updates for v6.20: 2026-02-10 12:28:44 -08:00
adiantum.c crypto: adiantum - Drop support for asynchronous xchacha ciphers 2026-01-12 11:07:50 -08:00
aead.c crypto: api - remove unnecessary forward declarations 2026-01-23 13:48:43 +08:00
aegis-neon.h
aegis.h crypto: aegis - Switch from crypto_ft_tab[] to aes_enc_tab[] 2026-01-12 11:39:58 -08:00
aegis128-core.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
aegis128-neon-inner.c
aegis128-neon.c crypto: aegis128-neon - Move to more abstract 'ksimd' guard API 2025-11-12 09:52:01 +01:00
aes.c crypto: aes - Replace aes-generic with wrapper around lib 2026-01-12 11:39:58 -08:00
af_alg.c Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
ahash.c crypto: api - remove unnecessary forward declarations 2026-01-23 13:48:43 +08:00
akcipher.c crypto: api - remove unnecessary forward declarations 2026-01-23 13:48:43 +08:00
algapi.c Locking updates for v6.20: 2026-02-10 12:28:44 -08:00
algboss.c crypto: testmgr - replace CRYPTO_MANAGER_DISABLE_TESTS with CRYPTO_SELFTESTS 2025-05-12 13:33:14 +08:00
algif_aead.c crypto: algif_aead - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
algif_hash.c crypto: af_alg - zero initialize memory allocated via sock_kmalloc 2025-10-17 16:03:57 +08:00
algif_rng.c crypto: af_alg - zero initialize memory allocated via sock_kmalloc 2025-10-17 16:03:57 +08:00
algif_skcipher.c
anubis.c crypto: anubis - simplify return statement in anubis_mod_init 2025-09-20 20:21:04 +08:00
api.c crypto: Enable context analysis 2026-01-05 16:43:36 +01:00
arc4.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
aria_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
authenc.c crypto: authenc - Correctly pass EINPROGRESS back up to the caller 2025-10-17 16:03:58 +08:00
authencesn.c crypto: authencesn - reject too-short AAD (assoclen<8) to match ESP/ESN spec 2026-01-20 14:38:48 +08:00
blake2b.c crypto: blake2b - Reimplement using library API 2025-10-29 22:04:24 -07:00
blowfish_common.c crypto: blowfish - fix typo in comment 2026-01-23 13:48:44 +08:00
blowfish_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
bpf_crypto_skcipher.c crypto: bpf - Add MODULE_DESCRIPTION for skcipher 2025-03-02 15:19:43 +08:00
camellia_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cast5_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cast6_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cast_common.c
cbc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ccm.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
chacha.c crypto: chacha - register only "-lib" drivers 2025-08-29 09:50:19 -07:00
chacha20poly1305.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cipher.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
cmac.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
compress.h crypto: acomp - Move stream management into scomp layer 2025-03-15 16:21:22 +08:00
crc32.c crypto/crc32[c]: register only "-lib" drivers 2025-06-30 09:31:56 -07:00
crc32c.c crypto/crc32[c]: register only "-lib" drivers 2025-06-30 09:31:56 -07:00
cryptd.c crypto: cryptd - WQ_PERCPU added to alloc_workqueue users 2025-09-13 12:11:06 +08:00
crypto_engine.c Locking updates for v6.20: 2026-02-10 12:28:44 -08:00
crypto_null.c crypto: null - use memcpy_sglist() 2025-05-12 13:32:53 +08:00
crypto_user.c crypto: aes - Replace aes-generic with wrapper around lib 2026-01-12 11:39:58 -08:00
ctr.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cts.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
deflate.c crypto: deflate - Use struct_size to improve deflate_alloc_stream 2025-11-06 14:31:08 +08:00
des_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
df_sp80090a.c crypto: drbg - Use new AES library API 2026-01-15 14:09:08 -08:00
dh.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
dh_helper.c
drbg.c Locking updates for v6.20: 2026-02-10 12:28:44 -08:00
ecb.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ecc.c crypto: ecc - Streamline alloc_point and remove {alloc,free}_digits_space 2026-01-23 13:48:44 +08:00
ecc_curve_defs.h
ecdh.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ecdh_helper.c
ecdsa-p1363.c crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
ecdsa-x962.c crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
ecdsa.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ecdsasignature.asn1
echainiv.c crypto: geniv - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
ecrdsa.c crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
ecrdsa_defs.h
ecrdsa_params.asn1
ecrdsa_pub_key.asn1
essiv.c crypto: essiv - Check ssize for decryption and in-place encryption 2025-10-09 15:02:35 +08:00
fcrypt.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
fips.c crypto: fips - annotate fips_enable() with __init to free init memory after boot 2025-12-19 14:47:47 +08:00
gcm.c crypto: gcm - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
geniv.c crypto: geniv - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
ghash-generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
hash.h
hctr2.c crypto: hctr2 - Convert to use POLYVAL library 2025-11-11 11:03:38 -08:00
hkdf.c crypto: hkdf - move to late_initcall 2025-06-11 10:59:45 +08:00
hmac.c crypto: hmac - Add ahash support 2025-05-19 13:48:20 +08:00
internal.h crypto: Enable context analysis 2026-01-05 16:43:36 +01:00
jitterentropy-kcapi.c crypto: jitterentropy - Use default sha3 implementation 2025-11-05 20:30:51 -08:00
jitterentropy-testing.c crypto: jitter - output full sample from test interface 2024-10-19 08:44:30 +08:00
jitterentropy.c crypto: jitter - replace ARRAY_SIZE definition with header include 2025-07-18 20:52:01 +10:00
jitterentropy.h crypto: jitter - output full sample from test interface 2024-10-19 08:44:30 +08:00
kdf_sp800108.c crypto: testmgr - replace CRYPTO_MANAGER_DISABLE_TESTS with CRYPTO_SELFTESTS 2025-05-12 13:33:14 +08:00
khazad.c crypto: khazad - simplify return statement in khazad_mod_init 2025-12-29 08:48:35 +08:00
kpp.c crypto: api - remove unnecessary forward declarations 2026-01-23 13:48:43 +08:00
krb5enc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
lrw.c crypto: lrw - Only add ecb if it is not already there 2025-05-19 13:48:20 +08:00
lskcipher.c crypto: lskcipher - Use unregister_lskciphers in register_lskciphers 2026-01-23 13:48:42 +08:00
lz4.c crypto: comp - Use same definition of context alloc and free ops 2025-09-20 20:21:03 +08:00
lz4hc.c crypto: comp - Use same definition of context alloc and free ops 2025-09-20 20:21:03 +08:00
lzo-rle.c crypto: comp - Use same definition of context alloc and free ops 2025-09-20 20:21:03 +08:00
lzo.c crypto: comp - Use same definition of context alloc and free ops 2025-09-20 20:21:03 +08:00
md4.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
md5.c crypto: md5 - Implement export_core() and import_core() 2025-09-08 09:47:38 -07:00
michael_mic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
mldsa.c crypto: Add ML-DSA crypto_sig support 2026-01-21 22:32:50 +00:00
pcbc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
pcrypt.c crypto: pcrypt - Optimize pcrypt_aead_init_tfm() 2025-06-13 17:26:17 +08:00
proc.c crypto: Enable context analysis 2026-01-05 16:43:36 +01:00
ripemd.h
rmd160.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
rng.c crypto: rng - Use unregister_rngs in register_rngs 2026-02-06 18:52:22 +08:00
rsa-pkcs1pad.c crypto: rsassa-pkcs1 - Migrate to sig_alg backend 2024-10-05 13:22:04 +08:00
rsa.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
rsa_helper.c
rsaprivkey.asn1
rsapubkey.asn1
rsassa-pkcs1.c crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
scatterwalk.c Revert "crypto: scatterwalk - Move skcipher walk and use it for memcpy_sglist" 2025-11-22 10:04:50 +08:00
scompress.c Locking updates for v6.20: 2026-02-10 12:28:44 -08:00
seed.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
seqiv.c crypto: seqiv - Do not use req->iv after crypto_aead_encrypt 2025-12-19 14:47:06 +08:00
serpent_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
sha1.c crypto: sha1 - Implement export_core() and import_core() 2025-09-02 19:02:35 -07:00
sha3.c crypto: sha3 - Reimplement using library API 2025-11-05 20:30:51 -08:00
sha256.c crypto: sha256 - Implement export_core() and import_core() 2025-09-02 19:02:37 -07:00
sha512.c crypto: sha512 - Implement export_core() and import_core() 2025-09-02 19:02:39 -07:00
shash.c crypto: api - remove unnecessary forward declarations 2026-01-23 13:48:43 +08:00
sig.c crypto: api - Add support for duplicating algorithms before registration 2025-04-16 15:36:24 +08:00
simd.c crypto: simd - Simplify request size calculation in simd_aead_init 2026-01-23 13:48:43 +08:00
skcipher.c crypto: api - remove unnecessary forward declarations 2026-01-23 13:48:43 +08:00
skcipher.h
sm3_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
sm4.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
sm4_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
streebog_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
tcrypt.c This update includes the following changes: 2025-12-03 11:28:38 -08:00
tcrypt.h crypto: tcrypt - Remove unused poly1305 support 2025-11-22 10:04:50 +08:00
tea.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
testmgr.c This update includes the following changes: 2026-02-10 08:36:42 -08:00
testmgr.h This update includes the following changes: 2026-02-10 08:36:42 -08:00
twofish_common.c
twofish_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
wp512.c crypto: wp512 - Use API partial block handling 2025-06-23 16:56:56 +08:00
xcbc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
xctr.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
xor.c crypto: xor - fix template benchmarking 2024-08-02 20:53:25 +08:00
xts.c crypto: xts - Only add ecb if it is not already there 2025-05-19 13:48:20 +08:00
xxhash_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
zstd.c crypto: zstd - fix double-free in per-CPU stream cleanup 2025-12-01 18:05:07 +08:00