[GIT PULL] locking fix
From: Ingo Molnar
Date: Sun Nov 26 2023 - 04:47:10 EST
Linus,
Please pull the latest locking/urgent git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-2023-11-26
# HEAD: bca4104b00fec60be330cd32818dd5c70db3d469 lockdep: Fix block chain corruption
Fix lockdep block chain corruption resulting in KASAN warnings.
Thanks,
Ingo
------------------>
Peter Zijlstra (1):
lockdep: Fix block chain corruption
kernel/locking/lockdep.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index e85b5ad3e206..151bd3de5936 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -3497,7 +3497,8 @@ static int alloc_chain_hlocks(int req)
size = chain_block_size(curr);
if (likely(size >= req)) {
del_chain_block(0, size, chain_block_next(curr));
- add_chain_block(curr + req, size - req);
+ if (size > req)
+ add_chain_block(curr + req, size - req);
return curr;
}
}