Skip to content

Commit 3164a3c

Browse files
hbruecknerMartin Schwidefsky
authored andcommitted
[S390] kprobes: add parameter check to module_free()
When unregistering kprobes, kprobes calls module_free() and always passes NULL for the mod parameter. Add a check to prevent NULL pointer dereferences. See commit 740a8de for more details. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent c2f0e8c commit 3164a3c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎arch/s390/kernel/module.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ void *module_alloc(unsigned long size)
5555
/* Free memory returned from module_alloc */
5656
void module_free(struct module *mod, void *module_region)
5757
{
58-
vfree(mod->arch.syminfo);
59-
mod->arch.syminfo = NULL;
58+
if (mod) {
59+
vfree(mod->arch.syminfo);
60+
mod->arch.syminfo = NULL;
61+
}
6062
vfree(module_region);
6163
}
6264

0 commit comments

Comments
 (0)