summaryrefslogtreecommitdiff
path: root/kernel/module.c
diff options
context:
space:
mode:
authorSrinivasarao P <spathi@codeaurora.org>2018-01-24 12:19:03 +0530
committerSrinivasarao P <spathi@codeaurora.org>2018-01-24 12:20:03 +0530
commit1f4bd7c8ff243f52e0a23e3b9b981b59ec288d90 (patch)
tree08bc508546470164cf08b1ecd4f7bc25d834cb42 /kernel/module.c
parenta5cabe9334b684f828dab1d28167d2b154536851 (diff)
parentf8518889ffe879b6266657e83b6cf6ace8111cdc (diff)
Merge android-4.4.111 (f851888) into msm-4.4
* refs/heads/tmp-f851888 Linux 4.4.111 Fix build error in vma.c Map the vsyscall page with _PAGE_USER proc: much faster /proc/vmstat module: Issue warnings when tainting kernel module: keep percpu symbols in module's symtab genksyms: Handle string literals with spaces in reference files x86/tlb: Drop the _GPL from the cpu_tlbstate export parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel x86/microcode/AMD: Add support for fam17h microcode loading Input: elantech - add new icbody type 15 ARC: uaccess: dont use "l" gcc inline asm constraint modifier kernel/signal.c: remove the no longer needed SIGNAL_UNKILLABLE check in complete_signal() kernel/signal.c: protect the SIGNAL_UNKILLABLE tasks from !sig_kernel_only() signals kernel/signal.c: protect the traced SIGNAL_UNKILLABLE tasks from SIGKILL kernel: make groups_sort calling a responsibility group_info allocators fscache: Fix the default for fscache_maybe_release_page() sunxi-rsb: Include OF based modalias in device uevent crypto: pcrypt - fix freeing pcrypt instances crypto: chacha20poly1305 - validate the digest size crypto: n2 - cure use after free kernel/acct.c: fix the acct->needcheck check in check_free_space() x86/kasan: Write protect kasan zero shadow clocksource: arch_timer: make virtual counter access configurable arm64: issue isb when trapping CNTVCT_EL0 access BACKPORT: arm64: Add CNTFRQ_EL0 trap handler BACKPORT: arm64: Add CNTVCT_EL0 trap handler ANDROID: sdcardfs: Fix missing break on default_normal ANDROID: usb: f_fs: Prevent gadget unbind if it is already unbound arm64: Kconfig: Reword UNMAP_KERNEL_AT_EL0 kconfig entry arm64: use RET instruction for exiting the trampoline FROMLIST: arm64: kaslr: Put kernel vectors address in separate data page FROMLIST: arm64: mm: Introduce TTBR_ASID_MASK for getting at the ASID in the TTBR FROMLIST: arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0 FROMLIST: arm64: entry: Add fake CPU feature for unmapping the kernel at EL0 FROMLIST: arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks FROMLIST: arm64: erratum: Work around Falkor erratum #E1003 in trampoline code FROMLIST: arm64: entry: Hook up entry trampoline to exception vectors FROMLIST: arm64: entry: Explicitly pass exception level to kernel_ventry macro FROMLIST: arm64: mm: Map entry trampoline into trampoline and kernel page tables FROMLIST: arm64: entry: Add exception trampoline page for exceptions from EL0 FROMLIST: arm64: mm: Invalidate both kernel and user ASIDs when performing TLBI FROMLIST: arm64: mm: Add arm64_kernel_unmapped_at_el0 helper FROMLIST: arm64: mm: Allocate ASIDs in pairs FROMLIST: arm64: mm: Fix and re-enable ARM64_SW_TTBR0_PAN FROMLIST: arm64: mm: Move ASID from TTBR0 to TTBR1 FROMLIST: arm64: mm: Temporarily disable ARM64_SW_TTBR0_PAN FROMLIST: arm64: mm: Use non-global mappings for kernel space UPSTREAM: arm64: factor out entry stack manipulation UPSTREAM: arm64: tlbflush.h: add __tlbi() macro Conflicts: arch/arm64/include/asm/cpufeature.h arch/arm64/kernel/asm-offsets.c arch/arm64/kernel/cpufeature.c arch/arm64/kernel/entry.S arch/arm64/kernel/vmlinux.lds.S drivers/clocksource/Kconfig drivers/clocksource/arm_arch_timer.c drivers/usb/gadget/function/f_fs.c Change-Id: I41e84762e30c9a7b1e283850c3f780f3dbe86f44 Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/kernel/module.c b/kernel/module.c
index ea5ba3e8d472..71e277d72d37 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2404,7 +2404,7 @@ static char elf_type(const Elf_Sym *sym, const struct load_info *info)
}
if (sym->st_shndx == SHN_UNDEF)
return 'U';
- if (sym->st_shndx == SHN_ABS)
+ if (sym->st_shndx == SHN_ABS || sym->st_shndx == info->index.pcpu)
return 'a';
if (sym->st_shndx >= SHN_LORESERVE)
return '?';
@@ -2433,7 +2433,7 @@ static char elf_type(const Elf_Sym *sym, const struct load_info *info)
}
static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs,
- unsigned int shnum)
+ unsigned int shnum, unsigned int pcpundx)
{
const Elf_Shdr *sec;
@@ -2442,6 +2442,11 @@ static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs,
|| !src->st_name)
return false;
+#ifdef CONFIG_KALLSYMS_ALL
+ if (src->st_shndx == pcpundx)
+ return true;
+#endif
+
sec = sechdrs + src->st_shndx;
if (!(sec->sh_flags & SHF_ALLOC)
#ifndef CONFIG_KALLSYMS_ALL
@@ -2479,7 +2484,8 @@ static void layout_symtab(struct module *mod, struct load_info *info)
/* Compute total space required for the core symbols' strtab. */
for (ndst = i = 0; i < nsrc; i++) {
if (i == 0 ||
- is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum)) {
+ is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum,
+ info->index.pcpu)) {
strtab_size += strlen(&info->strtab[src[i].st_name])+1;
ndst++;
}
@@ -2537,7 +2543,8 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
src = mod->kallsyms->symtab;
for (ndst = i = 0; i < mod->kallsyms->num_symtab; i++) {
if (i == 0 ||
- is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum)) {
+ is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum,
+ info->index.pcpu)) {
dst[ndst] = src[i];
dst[ndst++].st_name = s - mod->core_kallsyms.strtab;
s += strlcpy(s, &mod->kallsyms->strtab[src[i].st_name],
@@ -2887,8 +2894,12 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
return -ENOEXEC;
}
- if (!get_modinfo(info, "intree"))
+ if (!get_modinfo(info, "intree")) {
+ if (!test_taint(TAINT_OOT_MODULE))
+ pr_warn("%s: loading out-of-tree module taints kernel.\n",
+ mod->name);
add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
+ }
if (get_modinfo(info, "staging")) {
add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
@@ -3053,6 +3064,8 @@ static int move_module(struct module *mod, struct load_info *info)
static int check_module_license_and_versions(struct module *mod)
{
+ int prev_taint = test_taint(TAINT_PROPRIETARY_MODULE);
+
/*
* ndiswrapper is under GPL by itself, but loads proprietary modules.
* Don't use add_taint_module(), as it would prevent ndiswrapper from
@@ -3071,6 +3084,9 @@ static int check_module_license_and_versions(struct module *mod)
add_taint_module(mod, TAINT_PROPRIETARY_MODULE,
LOCKDEP_NOW_UNRELIABLE);
+ if (!prev_taint && test_taint(TAINT_PROPRIETARY_MODULE))
+ pr_warn("%s: module license taints kernel.\n", mod->name);
+
#ifdef CONFIG_MODVERSIONS
if ((mod->num_syms && !mod->crcs)
|| (mod->num_gpl_syms && !mod->gpl_crcs)