Ubuntu-focal-kernel/kernel
Roland Xu 6a86cbe5ce rtmutex: Drop rt_mutex::wait_lock before scheduling
BugLink: https://bugs.launchpad.net/bugs/2081278

commit d33d26036a0274b472299d7dcdaa5fb34329f91b upstream.

rt_mutex_handle_deadlock() is called with rt_mutex::wait_lock held.  In the
good case it returns with the lock held and in the deadlock case it emits a
warning and goes into an endless scheduling loop with the lock held, which
triggers the 'scheduling in atomic' warning.

Unlock rt_mutex::wait_lock in the dead lock case before issuing the warning
and dropping into the schedule for ever loop.

[ tglx: Moved unlock before the WARN(), removed the pointless comment,
  	massaged changelog, added Fixes tag ]

Fixes: 3d5c9340d1 ("rtmutex: Handle deadlock detection smarter")
Signed-off-by: Roland Xu <mu001999@outlook.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/ME0P300MB063599BEF0743B8FA339C2CECC802@ME0P300MB0635.AUSP300.PROD.OUTLOOK.COM
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-09-27 10:50:35 +02:00
..
bpf bpf: Fix DEVMAP_HASH overflow check on 32-bit arches 2024-09-27 10:50:10 +02:00
cgroup cgroup: Protect css->cgroup write under css_set_lock 2024-09-27 10:50:32 +02:00
configs
debug kdb: Use the passed prompt in kdb_position_cursor() 2024-09-27 10:50:16 +02:00
dma dma: fix call order in dmam_free_coherent 2024-09-27 10:50:16 +02:00
events uprobes: Use kzalloc to allocate xol area 2024-09-27 10:50:34 +02:00
gcov gcov: add support for GCC 14 2024-08-02 16:16:19 +02:00
irq genirq/irqdesc: Honor caller provided affinity in alloc_desc() 2024-09-27 10:50:21 +02:00
livepatch livepatch: fix race between fork and KLP transition 2023-01-06 08:43:53 -08:00
locking rtmutex: Drop rt_mutex::wait_lock before scheduling 2024-09-27 10:50:35 +02:00
power PM: suspend: Set mem_sleep_current during kernel command line setup 2024-06-07 15:01:33 +02:00
printk printk: Update @console_may_schedule in console_trylock_spinning() 2024-06-07 15:01:36 +02:00
rcu rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment 2024-08-02 16:16:17 +02:00
sched sched/fair: Allow disabling sched_balance_newidle with sched_relax_domain_level 2024-07-05 10:51:59 +02:00
time hrtimer: Prevent queuing of hrtimer without a function callback 2024-09-27 10:50:25 +02:00
trace tracing: Avoid possible softlockup in tracing_iter_reset() 2024-09-27 10:50:34 +02:00
.gitignore kbuild: update config_data.gz only when the content of .config is changed 2021-05-19 10:59:49 +02:00
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
Makefile kbuild: update config_data.gz only when the content of .config is changed 2021-05-19 10:59:49 +02:00
acct.c acct: fix potential integer overflow in encode_comp_t() 2023-02-01 15:23:09 +01:00
async.c treewide: Remove uninitialized_var() usage 2023-08-09 12:25:41 +02:00
audit.c audit: Send netlink ACK before setting connection in auditd_set 2024-03-28 15:18:33 +01:00
audit.h audit: log AUDIT_TIME_* records only from rules 2022-05-20 15:18:33 +02:00
audit_fsnotify.c audit: fix potential double free on error path from fsnotify_add_inode_mark 2022-10-17 15:02:07 +02:00
audit_tree.c audit: move put_tree() to avoid trim_trees refcount underflow and UAF 2021-10-01 11:31:10 +02:00
audit_watch.c audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() 2024-02-02 14:13:10 +01:00
auditfilter.c
auditsc.c audit: fix possible soft lockup in __audit_inode_child() 2023-10-30 11:42:11 +01:00
backtracetest.c treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() 2023-07-10 17:22:08 +02:00
bounds.c bounds: Use the right number of bits for power-of-two CONFIG_NR_CPUS 2024-06-07 15:01:47 +02:00
capability.c
compat.c sched_getaffinity: don't assume 'cpumask_size()' is fully initialized 2023-07-10 17:22:05 +02:00
configs.c
context_tracking.c
cpu.c hrtimers: Push pending hrtimers away from outgoing CPU earlier 2024-02-02 14:13:17 +01:00
cpu_pm.c
crash_core.c
crash_dump.c
cred.c cred: switch to using atomic_long_t 2024-02-02 14:13:21 +01:00
delayacct.c
dma.c
exec_domain.c
exit.c mm: optimize the redundant loop of mm_update_owner_next() 2024-08-02 16:16:30 +02:00
extable.c kernel/extable.c: use address-of operator on section symbols 2023-08-09 12:25:40 +02:00
fail_function.c kernel/fail_function: fix memory leak with using debugfs_lookup() 2023-05-12 17:15:15 +02:00
fork.c kernel/fork: beware of __put_task_struct() calling context 2023-10-30 11:42:22 +01:00
freezer.c
futex.c treewide: Remove uninitialized_var() usage 2023-08-09 12:25:41 +02:00
gen_kheaders.sh kheaders: explicitly define file modes for archived headers 2024-08-02 16:16:20 +02:00
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c jump_label: Fix usage in module __init 2021-11-25 12:09:02 +01:00
kallsyms.c
kcmp.c exec: Transform exec_update_mutex into a rw_semaphore 2021-02-19 16:43:34 +01:00
kcov.c
kexec.c
kexec_core.c kexec: fix a memory leak in crash_shrink_memory() 2023-10-02 12:12:02 +02:00
kexec_elf.c
kexec_file.c kexec: support purgatories with .text.hot sections 2023-09-01 14:48:44 +02:00
kexec_internal.h
kheaders.c kheaders: Use array declaration instead of char 2023-08-09 12:25:14 +02:00
kmod.c
kprobes.c kprobes: Fix possible use-after-free issue on kprobe registration 2024-06-07 15:01:43 +02:00
ksysfs.c
kthread.c kthread: Fix PF_KTHREAD vs to_kthread() race 2021-10-01 11:33:59 +02:00
latencytop.c
module-internal.h
module.c UBUNTU: SAUCE: Revert "modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules" 2023-10-30 11:42:04 +01:00
module_signature.c module: harden ELF info handling 2021-04-23 11:58:31 +02:00
module_signing.c module: harden ELF info handling 2021-04-23 11:58:31 +02:00
notifier.c
nsproxy.c
padata.c crypto: pcrypt - Fix hungtask for PADATA_RESET 2024-02-02 14:13:07 +01:00
panic.c panic: Flush kernel log buffer at the end 2024-06-07 15:01:40 +02:00
params.c params: lift param_set_uint_minmax to common code 2024-07-05 10:52:01 +02:00
pid.c
pid_namespace.c memcg: enable accounting for pids in nested pid namespaces 2021-10-12 16:31:40 -06:00
profile.c profiling: fix shift too large makes kernel panic 2022-10-17 15:01:11 +02:00
ptrace.c ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 2022-08-26 11:07:09 +02:00
range.c
reboot.c kernel/reboot: emergency_restart: Set correct system_state 2024-02-02 14:13:10 +01:00
relay.c relayfs: fix out-of-bounds access in relay_file_read 2023-08-09 12:25:10 +02:00
resource.c
rseq.c
seccomp.c seccomp: Invalidate seccomp mode to catch death failures 2022-04-14 11:32:10 +02:00
signal.c signal handling: don't use BUG_ON() for debugging 2022-09-16 10:59:30 +02:00
smp.c smp: Add missing destroy_work_on_stack() call in smp_call_on_cpu() 2024-09-27 10:50:33 +02:00
smpboot.c kthread: Extract KTHREAD_IS_PER_CPU 2021-03-24 11:11:35 +01:00
smpboot.h
softirq.c
stackleak.c
stacktrace.c
stop_machine.c
sys.c getrusage: use sig->stats_lock rather than lock_task_sighand() 2024-06-07 15:01:22 +02:00
sys_ni.c kernel/sys_ni: add compat entry for fadvise64_64 2022-10-17 15:02:07 +02:00
sysctl-test.c
sysctl.c sched/rt: Disallow writing invalid values to sched_rt_period_us 2024-04-26 10:54:05 +02:00
sysctl_binary.c
task_work.c
taskstats.c
test_kprobes.c
torture.c
tracepoint.c tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing 2021-08-13 09:44:55 +02:00
tsacct.c taskstats: Cleanup the use of task->exit_code 2022-04-14 11:32:19 +02:00
ucount.c
uid16.c
uid16.h
umh.c usermodehelper: reset umask to default before executing user process 2020-11-09 14:48:17 +01:00
up.c smp: Fix smp_call_function_single_async prototype 2021-05-26 15:39:25 +02:00
user-return-notifier.c
user.c
user_namespace.c
utsname.c
utsname_sysctl.c
watchdog.c watchdog: export lockup_detector_reconfigure 2022-10-17 15:02:02 +02:00
watchdog_hld.c watchdog/perf: properly initialize the turbo mode timestamp and rearm counter 2024-09-27 10:50:15 +02:00
workqueue.c workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask() 2024-01-05 14:29:54 +01:00
workqueue_internal.h