summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-01-25 18:26:50 +0300
committerIngo Molnar <mingo@kernel.org>2021-02-17 16:12:42 +0300
commitef72661e28c64ad610f89acc2832ec67b27ba438 (patch)
treea68805ca80c0cc424cda83ae3100fd016f7a8793 /include
parent73f44fe19d359635a607e8e8daa0da4001c1cfc2 (diff)
downloadlinux-ef72661e28c64ad610f89acc2832ec67b27ba438.tar.xz
sched: Harden PREEMPT_DYNAMIC
Use the new EXPORT_STATIC_CALL_TRAMP() / static_call_mod() to unexport the static_call_key for the PREEMPT_DYNAMIC calls such that modules can no longer update these calls. Having modules change/hi-jack the preemption calls would be horrible. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/sched.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index cfd3d349f905..5b7ed6dc99ac 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -93,7 +93,7 @@ DECLARE_STATIC_CALL(might_resched, __cond_resched);
static __always_inline void might_resched(void)
{
- static_call(might_resched)();
+ static_call_mod(might_resched)();
}
#else
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2f35594b8b53..4d568288abf9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1880,7 +1880,7 @@ DECLARE_STATIC_CALL(cond_resched, __cond_resched);
static __always_inline int _cond_resched(void)
{
- return static_call(cond_resched)();
+ return static_call_mod(cond_resched)();
}
#else