]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
static_call: Align static_call_is_init() patching condition
authorPeter Zijlstra <peterz@infradead.org>
Thu, 18 Mar 2021 10:29:56 +0000 (11:29 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:46 +0000 (15:42 -0500)
commit3a52c129cac463be8d969bc5a7ac7ab32096d6c2
treed94ec1e5b49147da60f73c8b3f1e28b7db56b0be
parent4785166b39314522baba619e8eceacd754a72203
static_call: Align static_call_is_init() patching condition

BugLink: https://bugs.launchpad.net/bugs/1923069
[ Upstream commit 698bacefe993ad2922c9d3b1380591ad489355e9 ]

The intent is to avoid writing init code after init (because the text
might have been freed). The code is needlessly different between
jump_label and static_call and not obviously correct.

The existing code relies on the fact that the module loader clears the
init layout, such that within_module_init() always fails, while
jump_label relies on the module state which is more obvious and
matches the kernel logic.

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.636651340@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kernel/static_call.c