NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-arm32/52933: earmv7hfeb kernel modules are fragile and CTF doesn't help



>Number:         52933
>Category:       port-arm32
>Synopsis:       earmv7hfeb kernel modules are fragile and CTF doesn't help
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-arm32-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 18 18:05:00 +0000 2018
>Originator:     Jonathan Kollasch
>Release:        -current circa 8.99.12
>Organization:
>Environment:
NetBSD  8.99.12 NetBSD 8.99.12 (SUNXI) #336: Thu Jan 18 11:02:40 CST 2018  jakllsch@terminus:/local/jakllsch/netbsd/obj/evbarm-earmv7hfeb/sys/arch/evbarm/compile/SUNXI evbarm earmv7hfeb
>Description:
Kernel modules for BE8 ARMv[67] are currently built as BE32 objects, the kernel bswaps .text on load.  If ctfconvert is run the kmod, the BE8 symbols ($a, $t, $d) become corrupted, and much of the .text is left with big endian wordcode, which is incorrect and often invalid in a BE8 kernel.

`objdump --special-syms -t modules/examples/hello/hello.o` before ctfconvert:
...
00000000 l       .text  00000000 $a
...
00000010 l       .debug_frame   00000000 $d
...

after ctfconvert:
...
00000000 l       .text  00000000 $a
...
00000010 l       .text  00000000 $d
...

this now-stray $d inhibits the previous $a which was expected to cover the rest of the .text.

It might also be argued that BE8 .kmods should be built for ARMv[67]-EB BE8 kernels.
>How-To-Repeat:
modload ./hello.kmod;
observe crash due to undefined instructions or failure to load due to opposite-endian relocations.
>Fix:



Home | Main Index | Thread Index | Old Index