summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2022-11-23 21:18:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-13 12:50:02 +0200
commitf0b422a04f823faec0aa7d5b6e9cdbffbbe1e7bd (patch)
tree031423b9800d9ca5658bdc7b0075e8144d052f17 /include/linux
parent26e9278a773c95b25376c95406fbf81d969c1e74 (diff)
downloadlinux-stable-f0b422a04f823faec0aa7d5b6e9cdbffbbe1e7bd.tar.gz
linux-stable-f0b422a04f823faec0aa7d5b6e9cdbffbbe1e7bd.tar.bz2
linux-stable-f0b422a04f823faec0aa7d5b6e9cdbffbbe1e7bd.zip
timers: Use del_timer_sync() even on UP
[ Upstream commit 168f6b6ffbeec0b9333f3582e4cf637300858db5 ] del_timer_sync() is assumed to be pointless on uniprocessor systems and can be mapped to del_timer() because in theory del_timer() can never be invoked while the timer callback function is executed. This is not entirely true because del_timer() can be invoked from interrupt context and therefore hit in the middle of a running timer callback. Contrary to that del_timer_sync() is not allowed to be invoked from interrupt context unless the affected timer is marked with TIMER_IRQSAFE. del_timer_sync() has proper checks in place to detect such a situation. Give up on the UP optimization and make del_timer_sync() unconditionally available. Co-developed-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home Link: https://lore.kernel.org/all/20221110064101.429013735@goodmis.org Link: https://lore.kernel.org/r/20221123201624.888306160@linutronix.de Stable-dep-of: 0f7352557a35 ("wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/timer.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 8e027cb10df0..a9c20a7ead30 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -171,12 +171,7 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires);
extern void add_timer(struct timer_list *timer);
extern int try_to_del_timer_sync(struct timer_list *timer);
-
-#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)
- extern int del_timer_sync(struct timer_list *timer);
-#else
-# define del_timer_sync(t) del_timer(t)
-#endif
+extern int del_timer_sync(struct timer_list *timer);
#define del_singleshot_timer_sync(t) del_timer_sync(t)