-
Notifications
You must be signed in to change notification settings - Fork 336
Description
Hi,
While testing kpatch on a KASAN‑enabled kernel (data-new.patch), I encountered errors related to KASAN generated sections:
-
Error log:
ERROR: changed section .data.rel.local..LASAN0 not selected for inclusion
ERROR: changed section .rela.data.rel.local..LASAN0 not selected for inclusion
ERROR: changed section .text.exit._sub_D_65535_0 not selected for inclusion
ERROR: changed section .text.startup._sub_I_65535_1 not selected for inclusion
ERROR: fs/proc/meminfo.o: 4 unsupported section change(s) -
Debug data:
Relocation section '.rela.data.rel.local..LASAN0' at offset 0x2af90 contains 150 entries:
Offset Info Type Symbol's Value Symbol's Name + Addend
0000000000000000 0000000500000016 R_390_64 0000000000000000 .rodata + 600
0000000000000018 0000001000000016 R_390_64 0000000000000000 .rodata.str1.2 + 0
0000000000000020 0000001000000016 R_390_64 0000000000000000 .rodata.str1.2 + 8
0000000000000040 0000000500000016 R_390_64 0000000000000000 .rodata + 3c0
0000000000000058 0000001000000016 R_390_64 0000000000000000 .rodata.str1.2 + 1a
0000000000000060 0000001000000016 R_390_64 0000000000000000 .rodata.str1.2 + 8
0000000000000080 0000000500000016 R_390_64 0000000000000000 .rodata + 180
...
Disassembly of section .text.startup._sub_I_65535_1:
0000000000000000 <_sub_I_65535_1>:
0: a7 39 00 32 lghi %r3,50
4: c0 20 00 00 00 00 larl %r2,4 <_sub_I_65535_1+0x4>
6: R_390_PC32DBL .data.rel.local..LASAN0+0x2
a: c0 f4 00 00 00 00 jg a <_sub_I_65535_1+0xa>
c: R_390_PLT32DBL __asan_register_globals+0x2
readelf -p .rodata meminfo.o | grep 600
[ 600] Shmem:
readelf -p .rodata.str1.2
String dump of section '.rodata.str1.2':
[ 0] *.LC25
[ 8] fs/proc/meminfo.c
[ 1a] *.LC16
...
Question
Since every change to a const string modifies .data.rel.local..LASAN0, and patching data section is not valid, does this mean:
- Is KASAN incompatible with kpatch due to KASAN’s data‑section instrumentation?
- Given that KASAN kernels are not typically used in production,
is it fine to exclude kpatch support for KASAN builds?
Thank you