Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar:
"Three fixes:

- Fix an rwsem spin-on-owner crash, introduced in v5.4

- Fix a lockdep bug when running out of stack_trace entries,
introduced in v5.4

- Docbook fix"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
locking/rwsem: Fix kernel crash when spinning on RWSEM_OWNER_UNKNOWN
futex: Fix kernel-doc notation warning
locking/lockdep: Fix buffer overrun problem in stack_trace[]

+6 -6
+1
kernel/futex.c
··· 1178 1178 1179 1179 /** 1180 1180 * wait_for_owner_exiting - Block until the owner has exited 1181 + * @ret: owner's current futex lock status 1181 1182 * @exiting: Pointer to the exiting task 1182 1183 * 1183 1184 * Caller must hold a refcount on @exiting.
+3 -4
kernel/locking/lockdep.c
··· 482 482 struct lock_trace *trace, *t2; 483 483 struct hlist_head *hash_head; 484 484 u32 hash; 485 - unsigned int max_entries; 485 + int max_entries; 486 486 487 487 BUILD_BUG_ON_NOT_POWER_OF_2(STACK_TRACE_HASH_SIZE); 488 488 BUILD_BUG_ON(LOCK_TRACE_SIZE_IN_LONGS >= MAX_STACK_TRACE_ENTRIES); ··· 490 490 trace = (struct lock_trace *)(stack_trace + nr_stack_trace_entries); 491 491 max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries - 492 492 LOCK_TRACE_SIZE_IN_LONGS; 493 - trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3); 494 493 495 - if (nr_stack_trace_entries >= MAX_STACK_TRACE_ENTRIES - 496 - LOCK_TRACE_SIZE_IN_LONGS - 1) { 494 + if (max_entries <= 0) { 497 495 if (!debug_locks_off_graph_unlock()) 498 496 return NULL; 499 497 ··· 500 502 501 503 return NULL; 502 504 } 505 + trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3); 503 506 504 507 hash = jhash(trace->entries, trace->nr_entries * 505 508 sizeof(trace->entries[0]), 0);
+2 -2
kernel/locking/rwsem.c
··· 1226 1226 * In this case, we attempt to acquire the lock again 1227 1227 * without sleeping. 1228 1228 */ 1229 - if ((wstate == WRITER_HANDOFF) && 1230 - (rwsem_spin_on_owner(sem, 0) == OWNER_NULL)) 1229 + if (wstate == WRITER_HANDOFF && 1230 + rwsem_spin_on_owner(sem, RWSEM_NONSPINNABLE) == OWNER_NULL) 1231 1231 goto trylock_again; 1232 1232 1233 1233 /* Block until there are no active lockers. */