]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.11-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Mar 2021 09:49:16 +0000 (10:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Mar 2021 09:49:16 +0000 (10:49 +0100)
added patches:
static_call-fix-static_call_update-sanity-check.patch

queue-5.11/series
queue-5.11/static_call-fix-static_call_update-sanity-check.patch [new file with mode: 0644]

index 8b1662708012dfef3326ec19b088d240d1dd0f97..d59d31d5b67231b13ee69ee14882a81fd746d4ed 100644 (file)
@@ -113,3 +113,4 @@ ext4-fix-timer-use-after-free-on-failed-mount.patch
 ext4-fix-rename-whiteout-with-fast-commit.patch
 maintainers-move-some-real-subsystems-off-of-the-staging-mailing-list.patch
 maintainers-move-the-staging-subsystem-to-lists.linux.dev.patch
+static_call-fix-static_call_update-sanity-check.patch
diff --git a/queue-5.11/static_call-fix-static_call_update-sanity-check.patch b/queue-5.11/static_call-fix-static_call_update-sanity-check.patch
new file mode 100644 (file)
index 0000000..313c42e
--- /dev/null
@@ -0,0 +1,67 @@
+From 38c93587375053c5b9ef093f4a5ea754538cba32 Mon Sep 17 00:00:00 2001
+From: Peter Zijlstra <peterz@infradead.org>
+Date: Thu, 18 Mar 2021 11:31:51 +0100
+Subject: static_call: Fix static_call_update() sanity check
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+commit 38c93587375053c5b9ef093f4a5ea754538cba32 upstream.
+
+Sites that match init_section_contains() get marked as INIT. For
+built-in code init_sections contains both __init and __exit text. OTOH
+kernel_text_address() only explicitly includes __init text (and there
+are no __exit text markers).
+
+Match what jump_label already does and ignore the warning for INIT
+sites. Also see the excellent changelog for commit: 8f35eaa5f2de
+("jump_label: Don't warn on __exit jump entries")
+
+Fixes: 9183c3f9ed710 ("static_call: Add inline static call infrastructure")
+Reported-by: Sumit Garg <sumit.garg@linaro.org>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
+Tested-by: Sumit Garg <sumit.garg@linaro.org>
+Link: https://lkml.kernel.org/r/20210318113610.739542434@infradead.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/jump_label.c  |    8 ++++++++
+ kernel/static_call.c |   11 ++++++++++-
+ 2 files changed, 18 insertions(+), 1 deletion(-)
+
+--- a/kernel/jump_label.c
++++ b/kernel/jump_label.c
+@@ -407,6 +407,14 @@ static bool jump_label_can_update(struct
+               return false;
+       if (!kernel_text_address(jump_entry_code(entry))) {
++              /*
++               * This skips patching built-in __exit, which
++               * is part of init_section_contains() but is
++               * not part of kernel_text_address().
++               *
++               * Skipping built-in __exit is fine since it
++               * will never be executed.
++               */
+               WARN_ONCE(!jump_entry_is_init(entry),
+                         "can't patch jump_label at %pS",
+                         (void *)jump_entry_code(entry));
+--- a/kernel/static_call.c
++++ b/kernel/static_call.c
+@@ -182,7 +182,16 @@ void __static_call_update(struct static_
+                       }
+                       if (!kernel_text_address((unsigned long)site_addr)) {
+-                              WARN_ONCE(1, "can't patch static call site at %pS",
++                              /*
++                               * This skips patching built-in __exit, which
++                               * is part of init_section_contains() but is
++                               * not part of kernel_text_address().
++                               *
++                               * Skipping built-in __exit is fine since it
++                               * will never be executed.
++                               */
++                              WARN_ONCE(!static_call_is_init(site),
++                                        "can't patch static call site at %pS",
+                                         site_addr);
+                               continue;
+                       }