From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Masahiro Yamada <masahiroy@kernel.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Thomas Backlund <tmb@tmb.nu>
Subject: [PATCH 5.18 1/6] tick/nohz: unexport __init-annotated tick_nohz_full_setup()
Date: Thu, 30 Jun 2022 15:47:27 +0200 [thread overview]
Message-ID: <20220630133230.285309399@linuxfoundation.org> (raw)
In-Reply-To: <20220630133230.239507521@linuxfoundation.org>
From: Masahiro Yamada <masahiroy@kernel.org>
commit 2390095113e98fc52fffe35c5206d30d9efe3f78 upstream.
EXPORT_SYMBOL and __init is a bad combination because the .init.text
section is freed up after the initialization. Hence, modules cannot
use symbols annotated __init. The access to a freed symbol may end up
with kernel panic.
modpost used to detect it, but it had been broken for a decade.
Commit 28438794aba4 ("modpost: fix section mismatch check for exported
init/exit sections") fixed it so modpost started to warn it again, then
this showed up:
MODPOST vmlinux.symvers
WARNING: modpost: vmlinux.o(___ksymtab_gpl+tick_nohz_full_setup+0x0): Section mismatch in reference from the variable __ksymtab_tick_nohz_full_setup to the function .init.text:tick_nohz_full_setup()
The symbol tick_nohz_full_setup is exported and annotated __init
Fix this by removing the __init annotation of tick_nohz_full_setup or drop the export.
Drop the export because tick_nohz_full_setup() is only called from the
built-in code in kernel/sched/isolation.c.
Fixes: ae9e557b5be2 ("time: Export tick start/stop functions for rcutorture")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Backlund <tmb@tmb.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/time/tick-sched.c | 1 -
1 file changed, 1 deletion(-)
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -526,7 +526,6 @@ void __init tick_nohz_full_setup(cpumask
cpumask_copy(tick_nohz_full_mask, cpumask);
tick_nohz_full_running = true;
}
-EXPORT_SYMBOL_GPL(tick_nohz_full_setup);
static int tick_nohz_cpu_down(unsigned int cpu)
{
next prev parent reply other threads:[~2022-06-30 14:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 13:47 [PATCH 5.18 0/6] 5.18.9-rc1 review Greg Kroah-Hartman
2022-06-30 13:47 ` Greg Kroah-Hartman [this message]
2022-06-30 13:47 ` [PATCH 5.18 2/6] clocksource/drivers/ixp4xx: Drop boardfile probe path Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.18 3/6] bcache: memset on stack variables in bch_btree_check() and bch_sectors_dirty_init() Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.18 4/6] hinic: Replace memcpy() with direct assignment Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.18 5/6] powerpc/ftrace: Remove ftrace init tramp once kernel init is complete Greg Kroah-Hartman
2022-06-30 13:47 ` [PATCH 5.18 6/6] io_uring: fix not locked access to fixed buf table Greg Kroah-Hartman
2022-06-30 17:09 ` [PATCH 5.18 0/6] 5.18.9-rc1 review Jon Hunter
2022-06-30 22:35 ` Zan Aziz
2022-06-30 23:19 ` Shuah Khan
2022-06-30 23:46 ` Florian Fainelli
2022-07-01 0:58 ` Guenter Roeck
2022-07-01 4:17 ` Ron Economos
2022-07-01 5:59 ` Naresh Kamboju
2022-07-01 7:59 ` Bagas Sanjaya
2022-07-01 8:24 ` Greg Kroah-Hartman
2022-07-01 9:00 ` Bagas Sanjaya
2022-07-01 10:31 ` Sudip Mukherjee
2022-07-04 14:40 ` Greg Kroah-Hartman
2022-07-01 10:25 ` Sudip Mukherjee
2022-07-01 11:53 ` Rudi Heitbaum
2022-07-01 11:56 ` Rudi Heitbaum
2022-07-01 17:45 ` Justin Forbes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220630133230.285309399@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=paulmck@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tmb@tmb.nu \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.