diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-05-24 19:28:07 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-30 16:46:02 +0200 |
commit | b5108aaf36105894a1412f73788afc3bfedd3071 (patch) | |
tree | 085f8285c0407fe7cd5307c8cbd6f0947ffd5e17 | |
parent | x86: mshyperv: don't touch kexec symbols without CONFIG_KEXEC_CORE (diff) | |
download | rhel7-kernel-misery-b5108aaf36105894a1412f73788afc3bfedd3071.tar.xz rhel7-kernel-misery-b5108aaf36105894a1412f73788afc3bfedd3071.zip |
rh_taint: don't dereference struct module without CONFIG_MODULE
This structure isn't defined for !CONFIG_MODULE, so don't try to use it.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | include/linux/moduleloader.h | 2 | ||||
-rw-r--r-- | kernel/rh_taint.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index 560ca53a75f..3425b352eac 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h @@ -45,7 +45,9 @@ static inline int apply_relocate(Elf_Shdr *sechdrs, unsigned int relsec, struct module *me) { +#ifdef CONFIG_MODULE printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name); +#endif return -ENOEXEC; } #endif diff --git a/kernel/rh_taint.c b/kernel/rh_taint.c index 22f032431c9..bbd7f8a1ab2 100644 --- a/kernel/rh_taint.c +++ b/kernel/rh_taint.c @@ -61,14 +61,18 @@ void mark_tech_preview(const char *msg, struct module *mod) if (msg) str = msg; +#ifdef CONFIG_MODULE else if (mod && mod->name) str = mod->name; +#endif pr_warn("TECH PREVIEW: %s may not be fully supported.\n" "Please review provided documentation for limitations.\n", (str ? str : "kernel")); add_taint(TAINT_TECH_PREVIEW, LOCKDEP_STILL_OK); +#ifdef CONFIG_MODULE if (mod) mod->taints |= (1U << TAINT_TECH_PREVIEW); +#endif } EXPORT_SYMBOL(mark_tech_preview); |