From 27d3313807296c3943a96ceef8c2b7279cb56962 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 19:39:59 +0200 Subject: Adding debian version 6.7.7-1. Signed-off-by: Daniel Baumann --- ...k-Check-printk_deferred_enter-_exit-usage.patch | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 debian/patches-rt/0018-printk-Check-printk_deferred_enter-_exit-usage.patch (limited to 'debian/patches-rt/0018-printk-Check-printk_deferred_enter-_exit-usage.patch') diff --git a/debian/patches-rt/0018-printk-Check-printk_deferred_enter-_exit-usage.patch b/debian/patches-rt/0018-printk-Check-printk_deferred_enter-_exit-usage.patch new file mode 100644 index 0000000000..55ecab4cd5 --- /dev/null +++ b/debian/patches-rt/0018-printk-Check-printk_deferred_enter-_exit-usage.patch @@ -0,0 +1,58 @@ +From: Sebastian Andrzej Siewior +Date: Fri, 22 Sep 2023 14:58:18 +0000 +Subject: [PATCH 18/50] printk: Check printk_deferred_enter()/_exit() usage +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.7/older/patches-6.7-rt6.tar.xz + +Add validation that printk_deferred_enter()/_exit() are called in +non-migration contexts. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: John Ogness +Signed-off-by: Sebastian Andrzej Siewior +--- + include/linux/printk.h | 7 +++++-- + kernel/printk/printk_safe.c | 12 ++++++++++++ + 2 files changed, 17 insertions(+), 2 deletions(-) + +--- a/include/linux/printk.h ++++ b/include/linux/printk.h +@@ -159,13 +159,16 @@ int _printk(const char *fmt, ...); + + extern void __printk_safe_enter(void); + extern void __printk_safe_exit(void); ++extern void __printk_deferred_enter(void); ++extern void __printk_deferred_exit(void); ++ + /* + * The printk_deferred_enter/exit macros are available only as a hack for + * some code paths that need to defer all printk console printing. Interrupts + * must be disabled for the deferred duration. + */ +-#define printk_deferred_enter __printk_safe_enter +-#define printk_deferred_exit __printk_safe_exit ++#define printk_deferred_enter() __printk_deferred_enter() ++#define printk_deferred_exit() __printk_deferred_exit() + + /* + * Please don't use printk_ratelimit(), because it shares ratelimiting state +--- a/kernel/printk/printk_safe.c ++++ b/kernel/printk/printk_safe.c +@@ -26,6 +26,18 @@ void __printk_safe_exit(void) + this_cpu_dec(printk_context); + } + ++void __printk_deferred_enter(void) ++{ ++ cant_migrate(); ++ this_cpu_inc(printk_context); ++} ++ ++void __printk_deferred_exit(void) ++{ ++ cant_migrate(); ++ this_cpu_dec(printk_context); ++} ++ + asmlinkage int vprintk(const char *fmt, va_list args) + { + #ifdef CONFIG_KGDB_KDB -- cgit v1.2.3