Skip to content

Commit 740a8de

Browse files
Akiyama, Nobuyukiaegl
authored andcommitted
[IA64] adding parameter check to module_free()
module_free() refers the first parameter before checking. But it is called like below(in kernel/kprobes). The first parameter is always NULL. This happens when many probe points(>1024) are set by kprobes. I encountered this with using SystemTap. It can set many probes easily. static int __kprobes collect_one_slot(struct kprobe_insn_page *kip, int idx) { ... if (kip->nused == 0) { hlist_del(&kip->hlist); if (hlist_empty(&kprobe_insn_pages)) { ... } else { module_free(NULL, kip->insns); //<<< 1st param always NULL kfree(kip); } return 1; } return 0; } Signed-off-by: Akiyama, Nobuyuki <akiyama.nobuyuk@jp.fujitsu.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
1 parent 60192db commit 740a8de

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/ia64/kernel/module.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ module_alloc (unsigned long size)
321321
void
322322
module_free (struct module *mod, void *module_region)
323323
{
324-
if (mod->arch.init_unw_table && module_region == mod->module_init) {
324+
if (mod && mod->arch.init_unw_table &&
325+
module_region == mod->module_init) {
325326
unw_remove_unwind_table(mod->arch.init_unw_table);
326327
mod->arch.init_unw_table = NULL;
327328
}

0 commit comments

Comments
 (0)