]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'locking-core-2026-02-08' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Feb 2026 20:28:44 +0000 (12:28 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Feb 2026 20:28:44 +0000 (12:28 -0800)
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
  ...

23 files changed:
1  2 
Documentation/dev-tools/index.rst
MAINTAINERS
Makefile
crypto/Makefile
crypto/acompress.c
crypto/algapi.c
crypto/crypto_engine.c
crypto/drbg.c
crypto/scompress.c
drivers/android/binder/thread.rs
fs/dlm/lock.c
include/linux/compiler_types.h
include/linux/mm.h
include/linux/rcupdate.h
include/linux/sched.h
kernel/sched/core.c
kernel/sched/fair.c
kernel/sched/sched.h
lib/Kconfig.debug
mm/kfence/core.c
mm/memory.c
rust/kernel/sync/atomic/predefine.rs
scripts/checkpatch.pl

Simple merge
diff --cc MAINTAINERS
Simple merge
diff --cc Makefile
Simple merge
diff --cc crypto/Makefile
Simple merge
Simple merge
diff --cc crypto/algapi.c
Simple merge
Simple merge
diff --cc crypto/drbg.c
index dab7880e47f0f5587ee58ce11423bebd4b3a38b6,21b339c76cca3c78d0ea9abccdf8a665486ebcdd..5e7ed5f5c192c77a7fd5334a770dc2fc01ed0020
@@@ -226,16 -226,19 +226,17 @@@ static inline unsigned short drbg_sec_s
   * @entropy buffer of seed data to be checked
   *
   * return:
 - *    0 on success
 - *    -EAGAIN on when the CTRNG is not yet primed
 - *    < 0 on error
 + *    %true on success
 + *    %false when the CTRNG is not yet primed
   */
 -static int drbg_fips_continuous_test(struct drbg_state *drbg,
 -                                   const unsigned char *entropy)
 +static bool drbg_fips_continuous_test(struct drbg_state *drbg,
 +                                    const unsigned char *entropy)
+       __must_hold(&drbg->drbg_mutex)
  {
        unsigned short entropylen = drbg_sec_strength(drbg->core->flags);
 -      int ret = 0;
  
        if (!IS_ENABLED(CONFIG_CRYPTO_FIPS))
 -              return 0;
 +              return true;
  
        /* skip test if we test the overall system */
        if (list_empty(&drbg->test_data.list))
@@@ -842,13 -846,21 +843,14 @@@ static inline int __drbg_seed(struct dr
        return ret;
  }
  
 -static inline int drbg_get_random_bytes(struct drbg_state *drbg,
 -                                      unsigned char *entropy,
 -                                      unsigned int entropylen)
 +static inline void drbg_get_random_bytes(struct drbg_state *drbg,
 +                                       unsigned char *entropy,
 +                                       unsigned int entropylen)
+       __must_hold(&drbg->drbg_mutex)
  {
 -      int ret;
 -
 -      do {
 +      do
                get_random_bytes(entropy, entropylen);
 -              ret = drbg_fips_continuous_test(drbg, entropy);
 -              if (ret && ret != -EAGAIN)
 -                      return ret;
 -      } while (ret);
 -
 -      return 0;
 +      while (!drbg_fips_continuous_test(drbg, entropy));
  }
  
  static int drbg_seed_from_random(struct drbg_state *drbg)
Simple merge
index e0ea33ccfe58bdf311ef5db9fea39fda8858ee2c,82264db06507d4641b60cbed96af482a9d36e7b2..1f1709a6a77abc1c865cc9387e7ba7493448c71d
@@@ -34,15 -35,8 +35,12 @@@ use crate::
      BinderReturnWriter, DArc, DLArc, DTRWrap, DeliverCode, DeliverToRead,
  };
  
- use core::{
-     mem::size_of,
-     sync::atomic::{AtomicU32, Ordering},
- };
+ use core::mem::size_of;
  
 +fn is_aligned(value: usize, to: usize) -> bool {
 +    value % to == 0
 +}
 +
  /// Stores the layout of the scatter-gather entries. This is used during the `translate_objects`
  /// call and is discarded when it returns.
  struct ScatterGatherState {
diff --cc fs/dlm/lock.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 4f79ec72075254666bf0e0d34798b1f4bef3e2b7,ebf442fb2c2ba35d916ac867cb5e73081949247e..653e162fa494f934ec30f537624dcffcb05894ab
@@@ -594,9 -598,10 +598,10 @@@ static void rcu_guarded_free(struct rcu
   * which partial initialization succeeded.
   */
  static unsigned long kfence_init_pool(void)
+       __context_unsafe(/* constructor */)
  {
        unsigned long addr, start_pfn;
 -      int i;
 +      int i, rand;
  
        if (!arch_kfence_init_pool())
                return (unsigned long)__kfence_pool;
diff --cc mm/memory.c
Simple merge
Simple merge
Simple merge