Thread (5 messages) 5 messages, 3 authors, 2020-09-01

[ARM64][GCC10] Kernel can't load any module due to RWX check

From: Qu Wenruo <hidden>
Date: 2020-08-29 07:51:50
Also in: linux-arm-kernel

Hi,

Recently built a v5.9-rc2 kernel, it boots fine, but unable to load any
kernel module.

After some debugging, it shows that it's due to RWX check failure:

  load_module: start
  module_enforce_rwx_sections: index=22 sh_flags=0x7 shf_wx=0x5
  layout_and_allocate: module enforce rwx sections
  load_module: failed to alloc layout and allocate
  load_module: end

Futhermore, it's unable to disable the RWX check through "make
menuconfig", since the ARCH_OPTIONAL_KERNEL_RWX is no for arm64.

The offending section 22 looks like this: (the kernel reports 38
sectors, while we only have 37, thus near-by sections are also shown here).

 20 .data         00000aa0  0000000000000000  0000000000000000  00086d08
 2**3
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
 21 __bug_table   000000cc  0000000000000000  0000000000000000  000877a8
 2**2
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
 22 __dyndbg      0000b9b8  0000000000000000  0000000000000000  00087878
 2**3
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
 23 .data.unlikely 00000012  0000000000000000  0000000000000000
00093230  2**0
                  CONTENTS, ALLOC, LOAD, DATA

I'm using GCC 10.2.0, could this be the cause?

Thanks,
Qu


Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help