Skip to contentSkip to conversation

arm: add missing exports for asm functions required by get_user macro

PATCH New Victor Kamensky 2 participants 4 messages Sep 13, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: add missing exports for asm functions required by get_user macro

Hi Russell,

Patch following this cover latter fixes issue that you reported [1] with '[PATCH V3] arm: fix get_user BE behavior for target variable with size of 8 bytes' patch:

ERROR: "__get_user_64t_4" [fs/ext4/ext4.ko] undefined!
ERROR: "__get_user_64t_4" [fs/cifs/cifs.ko] undefined!

The issue is that newly introduced get_user macro helper asm functions were not exported. So in case of ext4 and cifs compiled as kernel modules in BE image the issue got exposed.

While looking at this I realized that __get_user_8 helper function added by other commit is not exported too. It would affect LE image as well but fortunately currently there is no module that use get_user in such combination.

The proposed patch adds export for all recently added asm helper functions used by get_user macro.

I've tested all combinations of target variable types (1, 2, 4, 8 bytes), value pointer type (1, 2, 4, 8 bytes), kernel/module, and BE/LE with test patch provided below. It all looks good now abd it addresses reported issue.

Thanks,
Victor

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-September/287167.html

Appendix 1
----------

Patch that was used for testing of get_user macro export fix. It is provided just for reference only.

Quoted 1 line

From d34a035769fae6a6dff9f407daa7f0e65bfe55a9 Mon Sep 17 00:00:00 2001

From: Victor Kamensky <[email protected]>
Date: Wed, 20 Aug 2014 19:31:28 -0700
Subject: [PATCH] arm: get_user tests

Test different combinations of value and pointers passed to get_user macro.

---
 arch/arm/kernel/Makefile         |   3 +
 arch/arm/kernel/get_user_test.h  |  54 ++++++++++++++
 arch/arm/kernel/get_user_test1.c |  77 ++++++++++++++++++++
 arch/arm/kernel/get_user_test2.c | 151 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 285 insertions(+)
 create mode 100644 arch/arm/kernel/get_user_test.h
 create mode 100644 arch/arm/kernel/get_user_test1.c
 create mode 100644 arch/arm/kernel/get_user_test2.c
arch/arm/kernel/Makefile +3 -0
index 38ddd9f..193e581 100644
@@ -30,6 +30,9 @@ else
 obj-y		+= entry-armv.o
 endif
 
+obj-m		+= test-get_user.o
+test-get_user-objs += get_user_test1.o get_user_test2.o
+
 obj-$(CONFIG_OC_ETM)		+= etm.o
 obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
 obj-$(CONFIG_ISA_DMA_API)	+= dma.o
arch/arm/kernel/get_user_test.h new file +54 -0

54 lines not on this page · raw message

arch/arm/kernel/get_user_test1.c new file +77 -0

77 lines not on this page · raw message

arch/arm/kernel/get_user_test2.c new file +151 -0

151 lines not on this page · raw message

Signature · 11 lines
1.8.1.4


Victor Kamensky (1):
  arm: add missing exports for asm functions required by get_user macro

 arch/arm/kernel/armksyms.c | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
1.8.1.4
#1 lore raw

PATCH 1/1 arm: add missing exports for asm functions required by get_user macro

Previous commits that dealt with get_user for 64bit type missed to export proper functions, so if get_user macro with particular target/value types are used by kernel module modpost would produce 'undefined!' error. Solution is to export all required functions.

---
 arch/arm/kernel/armksyms.c | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/kernel/armksyms.c +8 -0
index f7b450f..a88671c 100644
@@ -98,6 +98,14 @@ EXPORT_SYMBOL(__clear_user);
 EXPORT_SYMBOL(__get_user_1);
 EXPORT_SYMBOL(__get_user_2);
 EXPORT_SYMBOL(__get_user_4);
+EXPORT_SYMBOL(__get_user_8);
+
+#ifdef __ARMEB__
+EXPORT_SYMBOL(__get_user_64t_1);
+EXPORT_SYMBOL(__get_user_64t_2);
+EXPORT_SYMBOL(__get_user_64t_4);
+EXPORT_SYMBOL(__get_user_32t_8);
+#endif
 
 EXPORT_SYMBOL(__put_user_1);
 EXPORT_SYMBOL(__put_user_2);
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 1/1 arm: add missing exports for asm functions required by get_user macro

Quoted 6 lines · Victor Kamensky

Previous commits that dealt with get_user for 64bit type missed to export proper functions, so if get_user macro with particular target/value types are used by kernel module modpost would produce 'undefined!' error. Solution is to export all required functions.

Patch looks good on its own, please send to the patch system.

I can either apply it as a follow on patch, or I can merge it into your original patch. Which would you prefer?

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
#3 lore raw

PATCH 1/1 arm: add missing exports for asm functions required by get_user macro

Quoted 9 lines · Russell King - ARM Linux
Quoted 6 lines · Victor Kamensky

Previous commits that dealt with get_user for 64bit type missed to export proper functions, so if get_user macro with particular target/value types are used by kernel module modpost would produce 'undefined!' error. Solution is to export all required functions.

Patch looks good on its own, please send to the patch system.

Submitted as
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=8151/1

Quoted 2 lines

I can either apply it as a follow on patch, or I can merge it into your original patch. Which would you prefer?

Either way is fine with me, whatever easier for you.

Thanks,
Victor

Quoted 3 lines

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net.