linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Possible regression: module insertion, relocation misalignement
@ 2015-08-29 20:12 Robert Jarzmik
  2015-08-31 23:00 ` Robert Jarzmik
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Jarzmik @ 2015-08-29 20:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

I have a strange regression with linux-next on module insertion. The stack I get
when inserting a module is in [3]. I'm using the gcc in [1], and added a small
print in [2]. This happens on a pxa310 cm-x300 platform.

As far as I understand the Oops, this is an unaligned access on the following
relocation (0xbf009a26):
	*(u32 *)loc += sym->st_value;

This happens regardless of the module I try, by that fat.ko, pxa3xx-nand.ko, etc
.. I add that I have not changed my toolchain for quite some time.

Is there anyone also affected by this bug ?

Cheers.

-- 
Robert

[1] gcc version
===============
rj at belgarion:~/mio_linux/kernel$ arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.9/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion=' 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,go,fortran,objc --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv4t --with-float=soft --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabi --program-prefix=arm-linux-gnueabi-
Thread model: posix
gcc version 4.9.2 ( 4.9.2-10) 

[2] Debug patch in arch/arm/kernel/module.c
===========================================
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index efdddcb97dd1..aed935c55d63 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -88,6 +88,9 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
                        return -ENOEXEC;
                }
 
+               pr_info("%s():%d dstsec=%p dstsec->sh_addr=%p rel=%p rel->r_offset=%u\n",
+                       __func__, __LINE__, dstsec, dstsec,
+                       dstsec->sh_addr, rel, rel->r_offset);
                loc = dstsec->sh_addr + rel->r_offset;
 
                switch (ELF32_R_TYPE(rel->r_info)) {

[3] Backtrace
=============
apply_relocate():93 dstsec=e4aa4e74 dstsec->sh_addr=e4aa4e74 rel=bf009420 rel->r_offset=3836194428
apply_relocate():93 dstsec=e4aa4eec dstsec->sh_addr=e4aa4eec rel=bf009a26 rel->r_offset=3836194436
Unable to handle kernel paging request at virtual address bf009a26
pgd = e1e28000
[bf009a26] *pgd=c1f0e851, *pte=c1f0a04f, *ppte=c1f0a01f
Internal error: Oops: 23 [#1] ARM
Modules linked in:
CPU: 0 PID: 607 Comm: insmod Not tainted 4.2.0-rc8-next-20150828-cm-x300+ #876
Hardware name: CM-X300 module
task: e222e700 ti: e1d6c000 task.ti: e1d6c000
PC is at apply_relocate+0x294/0x37c
LR is at 0xbf009a26
pc : [<c000e9a8>]    lr : [<bf009a26>]    psr: 80000013
sp : e1d6de40  ip : 60000013  fp : e4aa4f14
r10: e4a7ae84  r9 : e4a77ed8  r8 : e4aa552c
r7 : 00000000  r6 : e4a7ae84  r5 : e4aa4eec  r4 : bf00e0d4
r3 : bf009a26  r2 : 00000002  r1 : 00000000  r0 : bf000000
Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 0000397f  Table: c1e28018  DAC: 00000051
Process insmod (pid: 607, stack limit = 0xe1d6c198)
Stack: (0xe1d6de40 to 0xe1d6e000)
de40: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
de60: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
de80: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
dea0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
dec0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
dee0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
df00: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
df20: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
df40: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
df60: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
df80: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
dfa0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
dfc0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
dfe0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
[<c000e9a8>] (apply_relocate) from [<c005c8bc>] (load_module+0x1150/0x1d8c)
[<c005c8bc>] (load_module) from [<c005d5d4>] (SyS_init_module+0xdc/0x140)
[<c005d5d4>] (SyS_init_module) from [<c000a420>] (ret_fast_syscall+0x0/0x38)
Code: bad PC value
---[ end trace 6006e5b4059a4901 ]---
Segmentation fault

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Possible regression: module insertion, relocation misalignement
  2015-08-29 20:12 Possible regression: module insertion, relocation misalignement Robert Jarzmik
@ 2015-08-31 23:00 ` Robert Jarzmik
  2015-08-31 23:46   ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Jarzmik @ 2015-08-31 23:00 UTC (permalink / raw)
  To: linux-arm-kernel

Robert Jarzmik <robert.jarzmik@free.fr> writes:
> Hello,
>
> I have a strange regression with linux-next on module insertion. The stack I get
> when inserting a module is in [3]. I'm using the gcc in [1], and added a small
> print in [2]. This happens on a pxa310 cm-x300 platform.
>
> As far as I understand the Oops, this is an unaligned access on the following
> relocation (0xbf009a26):
> 	*(u32 *)loc += sym->st_value;
>
> This happens regardless of the module I try, by that fat.ko, pxa3xx-nand.ko, etc
> .. I add that I have not changed my toolchain for quite some time.
Hi Russell,

After digging a bit in the problem, and even if I don't understand why this
happens, I know at least _what_ happens. I'd like to know if this is specific to
xscale or a wider problem, hence this mail to you.

The summary of my problem :
 - on linux-next (20150828), module insertion Oopses (see [3])
 - the Oops is as far as I understand an unaligned access (message above)
   It is in arch/arm/kernel/module.h, the line:
		*(u32 *)loc += sym->st_value;
 - the unalignement comes from a relocation in section __bug_table (see [1])
   The address is 0xbf0021ea.
 - the module readelf in [2] shows the relocation in __bug_table

Do you know if other ARM platform are affected, and if an alignement of "1" is
normal for a __bug_table section (as opposed to an alignement of 4) ? And I'm
wondering how it is I have never seen that before also ...

If I have omitted some data, please tell me so that I can complete this report.

Cheers.

-- 
Robert

[1] module.c kernel debug messages
==================================
init_module: umod=000b5018, len=28664, uargs=000b5008
Core section allocation order:
	.text
	.exit.text
	.note.gnu.build-id
	.ARM.extab
	.ARM.exidx
	.rodata.str
	__bug_table
	.ARM.extab.init.text
	.ARM.exidx.init.text
	.ARM.extab.exit.text
	.ARM.exidx.exit.text
	.rodata
	__param
	.rodata.str1.8
	.data
	.gnu.linkonce.this_module
	.bss
Init section allocation order:
	.init.text
	.symtab
	.strtab
final section addresses:
	0xbf0020d0 .note.gnu.build-id
	0xbf000000 .text
	0xbf007000 .init.text
	0xbf0020c4 .exit.text
	0xbf0020f4 .ARM.extab
	0xbf0020f4 .ARM.exidx
	0xbf0021ac .rodata.str
	0xbf0021ea __bug_table
	0xbf002202 .ARM.extab.init.text
	0xbf002204 .ARM.exidx.init.text
	0xbf00220c .ARM.extab.exit.text
	0xbf00220c .ARM.exidx.exit.text
	0xbf002218 .rodata
	0xbf002490 __param
	0xbf0024a8 .rodata.str1.8
	0xbf002938 .data
	0xbf004d00 .gnu.linkonce.this_module
	0xbf004e80 .bss
	0xbf007014 .symtab
	0xbf007aa4 .strtab
Absolute symbol: 0x00000000
Absolute symbol: 0x00000000
...

[2] readelf -Sr pxa3xx_nand.ko
==============================
There are 36 section headers, starting at offset 0x6a58:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .note.gnu.build-i NOTE            00000000 000034 000024 00   A  0   0  4
  [ 2] .text             PROGBITS        00000000 000058 0020c4 00  AX  0   0  4
  [ 3] .rel.text         REL             00000000 006378 0004b8 08   I 34   2  4
  [ 4] .init.text        PROGBITS        00000000 00211c 000014 00  AX  0   0  4
  [ 5] .rel.init.text    REL             00000000 006830 000018 08   I 34   4  4
  [ 6] .exit.text        PROGBITS        00000000 002130 00000c 00  AX  0   0  4
  [ 7] .rel.exit.text    REL             00000000 006848 000010 08   I 34   6  4
  [ 8] .ARM.extab        PROGBITS        00000000 00213c 000000 00   A  0   0  1
  [ 9] .ARM.exidx        ARM_EXIDX       00000000 00213c 0000b8 00  AL  2   0  4
  [10] .rel.ARM.exidx    REL             00000000 006858 0000c0 08   I 34   9  4
  [11] .rodata.str       PROGBITS        00000000 0021f4 00003e 01 AMS  0   0  1
  [12] __bug_table       PROGBITS        00000000 002232 000018 00   A  0   0  1
  [13] .rel__bug_table   REL             00000000 006918 000020 08   I 34  12  4
  [14] .ARM.extab.init.t PROGBITS        00000000 00224a 000000 00   A  0   0  1
  [15] .ARM.exidx.init.t ARM_EXIDX       00000000 00224c 000008 00  AL  4   0  4
  [16] .rel.ARM.exidx.in REL             00000000 006938 000010 08   I 34  15  4
  [17] .ARM.extab.exit.t PROGBITS        00000000 002254 000000 00   A  0   0  1
  [18] .ARM.exidx.exit.t ARM_EXIDX       00000000 002254 000008 00  AL  6   0  4
  [19] .rel.ARM.exidx.ex REL             00000000 006948 000010 08   I 34  18  4
  [20] .rodata           PROGBITS        00000000 002260 000278 00   A  0   0  8
  [21] .modinfo          PROGBITS        00000000 0024d8 000138 00   A  0   0  8
  [22] __param           PROGBITS        00000000 002610 000014 00   A  0   0  4
  [23] .rel__param       REL             00000000 006958 000020 08   I 34  22  4
  [24] .rodata.str1.8    PROGBITS        00000000 002628 000490 01 AMS  0   0  8
  [25] .data             PROGBITS        00000000 002ab8 0023c0 00  WA  0   0  4
  [26] .rel.data         REL             00000000 006978 0000d0 08   I 34  25  4
  [27] .gnu.linkonce.thi PROGBITS        00000000 004e80 000180 00  WA  0   0 32
  [28] .rel.gnu.linkonce REL             00000000 006a48 000010 08   I 34  27  4
  [29] .bss              NOBITS          00000000 005000 000000 00  WA  0   0  4
  [30] .comment          PROGBITS        00000000 005000 000030 01  MS  0   0  1
  [31] .note.GNU-stack   PROGBITS        00000000 005030 000000 00      0   0  1
  [32] .ARM.attributes   ARM_ATTRIBUTES  00000000 005030 00002b 00      0   0  1
  [33] .shstrtab         STRTAB          00000000 00505b 00016a 00      0   0  1
  [34] .symtab           SYMTAB          00000000 0051c8 000a90 10     35 121  4
  [35] .strtab           STRTAB          00000000 005c58 000720 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)
...
Relocation section '.rel__bug_table' at offset 0x6918 contains 4 entries:
 Offset     Info    Type            Sym.Value  Sym. Name
00000000  00000202 R_ARM_ABS32       00000000   .text
00000004  00000702 R_ARM_ABS32       00000000   .rodata.str
0000000c  00000202 R_ARM_ABS32       00000000   .text
00000010  00000702 R_ARM_ABS32       00000000   .rodata.str


[3] Backtrace
=============
apply_relocate(): pxa3xx_nand: section 13 reloc 0 sym ''
RJK: apply_relocate():97 dstsec=e49e8c38 dstsec->sh_addr=bf0021ea rel=e49e8918 rel->r_offset=0x0 sec_shdr={addr=0x0 off=0x0 size=0x0 flags=0x0}
Unable to handle kernel paging request at virtual address bf0021ea
pgd = e1cd0000
[bf0021ea] *pgd=c1cce851, *pte=c1cde04f, *ppte=c1cde01f
Internal error: Oops: 23 [#1] ARM
Modules linked in:
CPU: 0 PID: 606 Comm: insmod Not tainted 4.2.0-rc8-next-20150828-cm-x300+ #887
Hardware name: CM-X300 module
task: e1c68700 ti: e1c3e000 task.ti: e1c3e000
PC is at apply_relocate+0x2f4/0x3d4
LR is at 0xbf0021ea
pc : [<c000e7c8>]    lr : [<bf0021ea>]    psr: 80000013
sp : e1c3fe30  ip : 60000013  fp : e49e8c60
r10: e49e8fa8  r9 : 00000000  r8 : e49e7c58
r7 : e49e8c38  r6 : e49e8a58  r5 : e49e8920  r4 : e49e8918
r3 : bf0021ea  r2 : bf007034  r1 : 00000000  r0 : bf000000
Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 0000397f  Table: c1cd0018  DAC: 00000051
Process insmod (pid: 606, stack limit = 0xe1c3e198)
Stack: (0xe1c3fe30 to 0xe1c40000)
fe20:                                     ???????? ???????? ???????? ????????
fe40: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
fe60: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
fe80: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
fea0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
fec0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
fee0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
ff00: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
ff20: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
ff40: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
ff60: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
ff80: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
ffa0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
ffc0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
ffe0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
[<c000e7c8>] (apply_relocate) from [<c005ce5c>] (load_module+0x1248/0x1f5c)
[<c005ce5c>] (load_module) from [<c005dc54>] (SyS_init_module+0xe4/0x170)
[<c005dc54>] (SyS_init_module) from [<c000a420>] (ret_fast_syscall+0x0/0x38)
Code: bad PC value
---[ end trace 53a5b8d1316bd52d ]---

[4] gcc version
===============
rj at belgarion:~/mio_linux/kernel$ arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.9/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion=' 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,go,fortran,objc --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv4t --with-float=soft --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabi --program-prefix=arm-linux-gnueabi-
Thread model: posix
gcc version 4.9.2 ( 4.9.2-10) 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Possible regression: module insertion, relocation misalignement
  2015-08-31 23:00 ` Robert Jarzmik
@ 2015-08-31 23:46   ` Russell King - ARM Linux
  2015-09-01 17:30     ` Robert Jarzmik
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2015-08-31 23:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 01, 2015 at 01:00:39AM +0200, Robert Jarzmik wrote:
> [2] readelf -Sr pxa3xx_nand.ko
> ==============================
> There are 36 section headers, starting at offset 0x6a58:
> 
> Section Headers:
>   [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
>   [ 0]                   NULL            00000000 000000 000000 00      0   0  0
>   [ 1] .note.gnu.build-i NOTE            00000000 000034 000024 00   A  0   0  4
>   [ 2] .text             PROGBITS        00000000 000058 0020c4 00  AX  0   0  4
>   [ 3] .rel.text         REL             00000000 006378 0004b8 08   I 34   2  4
>   [ 4] .init.text        PROGBITS        00000000 00211c 000014 00  AX  0   0  4
>   [ 5] .rel.init.text    REL             00000000 006830 000018 08   I 34   4  4
>   [ 6] .exit.text        PROGBITS        00000000 002130 00000c 00  AX  0   0  4
>   [ 7] .rel.exit.text    REL             00000000 006848 000010 08   I 34   6  4
>   [ 8] .ARM.extab        PROGBITS        00000000 00213c 000000 00   A  0   0  1
>   [ 9] .ARM.exidx        ARM_EXIDX       00000000 00213c 0000b8 00  AL  2   0  4
>   [10] .rel.ARM.exidx    REL             00000000 006858 0000c0 08   I 34   9  4
>   [11] .rodata.str       PROGBITS        00000000 0021f4 00003e 01 AMS  0   0  1
>   [12] __bug_table       PROGBITS        00000000 002232 000018 00   A  0   0  1

This shows that the bug table has an alignment of 1, which is silly as
it contains 32-bit values - this really ought to be indicating an
alignment of 4.

I notice that a bunch of my modules are the same as well.  Try adding
".align 2" into arch/arm/include/asm/bug.h, __BUG() macro, just after
".pushsection __bug_table" which should have the effect of increasing
the alignment of the section.

It probably hasn't been noticed on ARMv6 and later because they'll
always fix up these relocations transparently.

For ARMv5 and older, you really ought to have the alignment handler
enabled - IP networking pretty much relies on this being present to
catch corner cases (eg, with TCP options mis-aligning subsequent data.)

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Possible regression: module insertion, relocation misalignement
  2015-08-31 23:46   ` Russell King - ARM Linux
@ 2015-09-01 17:30     ` Robert Jarzmik
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Jarzmik @ 2015-09-01 17:30 UTC (permalink / raw)
  To: linux-arm-kernel

Russell King - ARM Linux <linux@arm.linux.org.uk> writes:

> On Tue, Sep 01, 2015 at 01:00:39AM +0200, Robert Jarzmik wrote:
>> [2] readelf -Sr pxa3xx_nand.ko
>> ==============================
>>   [12] __bug_table       PROGBITS        00000000 002232 000018 00   A  0   0  1
>
> This shows that the bug table has an alignment of 1, which is silly as
> it contains 32-bit values - this really ought to be indicating an
> alignment of 4.
>
> I notice that a bunch of my modules are the same as well.  Try adding
> ".align 2" into arch/arm/include/asm/bug.h, __BUG() macro, just after
> ".pushsection __bug_table" which should have the effect of increasing
> the alignment of the section.
Okay, I made the change, and tested it now I'm after work. Your fix does indeed
remove the problem.

> It probably hasn't been noticed on ARMv6 and later because they'll
> always fix up these relocations transparently.
>
> For ARMv5 and older, you really ought to have the alignment handler
> enabled - IP networking pretty much relies on this being present to
> catch corner cases (eg, with TCP options mis-aligning subsequent data.)
That is curious, because I have this in my configuration :
  #define CONFIG_ALIGNMENT_TRAP 1.
And yet it happens ... I will remove the fix and try to follow the data abort
path to understand why the alignment fault is not dealt with.

-- 
Robert

PS: This is the patch I have prepared, and which I'll send to the mailing list
once my testing tells me it fixes my issue.

--->8---
>From afc8eeab3cdedb749f4903385840f3b48e7dd75e Mon Sep 17 00:00:00 2001
From: Robert Jarzmik <robert.jarzmik@free.fr>
Date: Tue, 1 Sep 2015 11:03:04 +0200
Subject: [PATCH] ARM: fix alignement of __bug_table section entries

On old ARM chips, unaligned accesses to memory are not trapped and
fixed.  On module load, symbols are relocated, and the relocation of
__bug_table symbols is done on a u32 basis. Yet the section is not
aligned to a multiple of 4 address, but to a multiple of 2.

This triggers an Oops on pxa architecture, where address 0xbf0021ea
is the first relocation in the __bug_table section :
  apply_relocate(): pxa3xx_nand: section 13 reloc 0 sym ''
  Unable to handle kernel paging request at virtual address bf0021ea
  pgd = e1cd0000
  [bf0021ea] *pgd=c1cce851, *pte=c1cde04f, *ppte=c1cde01f
  Internal error: Oops: 23 [#1] ARM
  Modules linked in:
  CPU: 0 PID: 606 Comm: insmod Not tainted 4.2.0-rc8-next-20150828-cm-x300+ #887
  Hardware name: CM-X300 module
  task: e1c68700 ti: e1c3e000 task.ti: e1c3e000
  PC is at apply_relocate+0x2f4/0x3d4
  LR is at 0xbf0021ea
  pc : [<c000e7c8>]    lr : [<bf0021ea>]    psr: 80000013
  sp : e1c3fe30  ip : 60000013  fp : e49e8c60
  r10: e49e8fa8  r9 : 00000000  r8 : e49e7c58
  r7 : e49e8c38  r6 : e49e8a58  r5 : e49e8920  r4 : e49e8918
  r3 : bf0021ea  r2 : bf007034  r1 : 00000000  r0 : bf000000
  Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
  Control: 0000397f  Table: c1cd0018  DAC: 00000051
  Process insmod (pid: 606, stack limit = 0xe1c3e198)
  [<c000e7c8>] (apply_relocate) from [<c005ce5c>] (load_module+0x1248/0x1f5c)
  [<c005ce5c>] (load_module) from [<c005dc54>] (SyS_init_module+0xe4/0x170)
  [<c005dc54>] (SyS_init_module) from [<c000a420>] (ret_fast_syscall+0x0/0x38)

Fix this by ensuring entries in __bug_table are all aligned to at least
of multiple of 4. This transforms a module section  __bug_table as :
-   [12] __bug_table       PROGBITS        00000000 002232 000018 00   A  0   0  1
+   [12] __bug_table       PROGBITS        00000000 002232 000018 00   A  0   0  4

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 arch/arm/include/asm/bug.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index b274bde24905..e7335a92144e 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -40,6 +40,7 @@ do {								\
 		"2:\t.asciz " #__file "\n" 			\
 		".popsection\n" 				\
 		".pushsection __bug_table,\"a\"\n"		\
+		".align 2\n"					\
 		"3:\t.word 1b, 2b\n"				\
 		"\t.hword " #__line ", 0\n"			\
 		".popsection");					\
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-01 17:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-29 20:12 Possible regression: module insertion, relocation misalignement Robert Jarzmik
2015-08-31 23:00 ` Robert Jarzmik
2015-08-31 23:46   ` Russell King - ARM Linux
2015-09-01 17:30     ` Robert Jarzmik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).