From 882b7ca14175eb4436d0ca33798e1cb9170cc723 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 14 Jul 2020 19:11:20 +0200 Subject: [PATCH] ANDROID: GKI: do not export symbol_get/put() People keep trying to use these in Android kernels, and they should not be used, use the correct, real, symbol name instead. Turn off a number of things in the allmodconfig builds that were using these symbols to not break the build. That was for build-testing only, no functional changes. Bug: 157965270 Signed-off-by: Greg Kroah-Hartman Change-Id: I13bf351b3ae59fa6dfed7bd41dfff8c8d521e3a4 --- build.config.allmodconfig | 32 ++++++++++++++++++++++++++++++++ kernel/module.c | 2 -- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/build.config.allmodconfig b/build.config.allmodconfig index 4ce14e5a7c5a..4ff50774a9b4 100644 --- a/build.config.allmodconfig +++ b/build.config.allmodconfig @@ -1,5 +1,36 @@ DEFCONFIG=allmodconfig +# When trying to prevent others from using symbol_get/put we need to exclude a +# number of in-kernel modules that use those functions. +SYMBOL_GET_USERS=" \ + -d CAIF \ + -d DELL_LAPTOP \ + -d DRM_I915 \ + -d DVB_USB \ + -d DVB_USB_V2 \ + -d FSL_ENETC \ + -d FSL_ENETC_VF \ + -d INTEL_IPS \ + -d KVM \ + -d MEDIA_DIGITAL_TV_SUPPORT \ + -d MEDIA_PCI_SUPPORT \ + -d MEDIA_RADIO_SUPPORT \ + -d MTD_CFI \ + -d MTD_GEN_PROBE \ + -d MTD_HYPERBUS \ + -d MTD_JEDECPROBE \ + -d MTD_TS5500 \ + -d NFS_V4 \ + -d SAMPLE_HW_BREAKPOINT \ + -d VFIO \ + -d VIDEO_CX231XX \ + -d VIDEO_EM28XX \ + -d VIDEO_GO7007 \ + -d VIDEO_PVRUSB2 \ + -d VIDEO_TM6000 \ + -d VIDEO_USBVISION \ +" + POST_DEFCONFIG_CMDS="update_config" function update_config() { ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ @@ -7,6 +38,7 @@ function update_config() { -d CPU_BIG_ENDIAN \ -d STM \ -d TEST_MEMCAT_P \ + ${SYMBOL_GET_USERS} \ -e UNWINDER_FRAME_POINTER \ (cd ${OUT_DIR} && \ diff --git a/kernel/module.c b/kernel/module.c index b9ba1ea8a517..47a5d06b1a5e 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1079,7 +1079,6 @@ void __symbol_put(const char *symbol) module_put(owner); preempt_enable(); } -EXPORT_SYMBOL(__symbol_put); /* Note this assumes addr is a function, which it currently always is. */ void symbol_put_addr(void *addr) @@ -2259,7 +2258,6 @@ void *__symbol_get(const char *symbol) return sym ? (void *)kernel_symbol_value(sym) : NULL; } -EXPORT_SYMBOL_GPL(__symbol_get); /* * Ensure that an exported symbol [global namespace] does not already exist