x86: jump_label: arch_jump_label_text_poke_early: add missing __init
Subsystems (2)
PATCH 1/1 x86: jump_label: arch_jump_label_text_poke_early: add missing __init
arch_jump_label_text_poke_early calls text_poke_early, which is an __init function. Thus arch_jump_label_text_poke_early should be the same.
--- arch/x86/kernel/jump_label.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/jump_label.c +1 -1
@@ -42,7 +42,7 @@ void arch_jump_label_transform(struct jump_entry *entry,put_online_cpus (); } -void arch_jump_label_text_poke_early (jump_label_t addr) +void __init arch_jump_label_text_poke_early (jump_label_t addr) {text_poke_early ((void *)addr, ideal_nops[NOP_ATOMIC5 ],JUMP_LABEL_NOP_SIZE );
Signature · 1 line
1.7.6
Steven Rostedt
reviewerQuoted 3 lines · Kevin Winchester
arch_jump_label_text_poke_earlycallstext_poke_early, which is an__initfunction. Thusarch_jump_label_text_poke_earlyshould be the same.
but text_poke_early is not __init but instead __init_or_module. Your patch just caused this bug:
Welcome to Fedora
Press 'I' to enter interactive startup.^M
Starting udev: kernel tried to execute NX-protected page - exploit attempt? (uid: 0)
BUG: unable to handle kernel paging request at ffffffff81de7b5d IP: [<ffffffff81de7b5d>] native_init_IRQ+0x352/0x352 PGD 1c06067 PUD 1c0a063 PMD 78520063 PTE 8000000001de7163 Oops: 0011 [#1] PREEMPT SMP CPU 0 Modules linked in: snd_page_alloc
Pid: 943, comm: modprobe Not tainted 3.1.0-rc1-test+ #3 /DG965MQ
RIP: 0010:[<ffffffff81de7b5d>] [<ffffffff81de7b5d>] native_init_IRQ+0x352/0x352^M RSP: 0018:ffff880077187dd0 EFLAGS: 00010296 RAX: 0000000000000000 RBX: ffffffffa0012700 RCX: ffff88007e200000 RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffffffa00080e1 RBP: ffff880077187de8 R08: 0000000000000005 R09: 0000000000000008 R10: 0000000000000002 R11: ffffc90019853060 R12: ffffffffa0012748 R13: ffffc90019800000 R14: ffffc900198530e0 R15: ffffc900198524a0 FS: 00007fb2d8111700(0000) GS:ffff88007e200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffff81de7b5d CR3: 0000000077154000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process modprobe (pid: 943, threadinfo ffff880077186000, task ffff880077188000) Stack: ffffffff81076a25 ffffc900198527e0 ffffc90019852420 ffff880077187e58 ffffffff8102d76f 00001fffe0000000 0000000000000000 ffffc900198529e0 ffffc90019852247 ffffffffa0012750 ffffc90019852250 ffffffffa0012768 Call Trace: [<ffffffff81076a25>] ? jump_label_apply_nops+0x34/0x3e [<ffffffff8102d76f>] module_finalize+0x14c/0x15d [<ffffffff8108dd8c>] load_module+0xf92/0x183a [<ffffffff8108e684>] sys_init_module+0x50/0x1f0 [<ffffffff817f3d02>] system_call_fastpath+0x16/0x1b Code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bf 82 dd 92 00 00 00 00 00 00 00 00 00 00 ^M RIP [<ffffffff81de7b5d>] native_init_IRQ+0x352/0x352
I'll update it to __init_or_module and see if that fixes things.
Thanks,
-- Steve
Quoted 19 lines
Signed-off-by Kevin Winchester <[email protected]>--- arch/x86/kernel/jump_label.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kernel/jump_label.c +1
-1@@ -42,7 +42,7 @@ void arch_jump_label_transform(struct jump_entry *entry,put_online_cpus (); } -void arch_jump_label_text_poke_early (jump_label_t addr) +void __init arch_jump_label_text_poke_early (jump_label_t addr) {text_poke_early ((void *)addr, ideal_nops[NOP_ATOMIC5 ],JUMP_LABEL_NOP_SIZE );
Quoted 8 lines · Steven Rostedt
Quoted 3 lines · Kevin Winchester
arch_jump_label_text_poke_earlycallstext_poke_early, which is an__initfunction. Thusarch_jump_label_text_poke_earlyshould be the same.but
text_poke_earlyis not__initbut instead__init_or_module. Your patch just caused this bug:
Sorry about that. I have:
# CONFIG_MODULES is not set
which makes __init_or_module equivalent to __init for me. Thus the patch was fine for my case, but I expect your modification is the right thing to do overall.
Signature · 1 line
Kevin Winchester
Steven Rostedt
reviewerQuoted 10 lines · Kevin Winchester
Quoted 8 lines · Steven Rostedt
Quoted 3 lines · Kevin Winchester
arch_jump_label_text_poke_earlycallstext_poke_early, which is an__initfunction. Thusarch_jump_label_text_poke_earlyshould be the same.but
text_poke_earlyis not__initbut instead__init_or_module. Your patch just caused this bug:
Quoted 7 lines
Sorry about that. I have:
#
CONFIG_MODULESis not setwhich makes
__init_or_moduleequivalent to__initfor me. Thus the patch was fine for my case, but I expect your modification is the right thing to do overall.
Um yeah.
I guess you're another one just like Peter Zijlstra ...
"Modules? Modules? We don't need no stinking modules!"
-- Steve