Porting kasan for arm v2 to kernel 4.14, appear crash on kasan_pte_populate

5 views
Skip to first unread message

hyo...@126.com

unread,
Jul 13, 2020, 2:16:43 AM7/13/20
to kasan-dev
Hi admin:
     I plan to port kasan for arm v2 patch to arm kernel 4.14. But appear crash, fellow is the crash log:

     0.000000] c0 kasan: base end 80000000, bffc0000
[    0.000000] c0 kasan: populating shadow for b7000000, bc200000
[    0.000000] c0 kasan:  create_mapping addr b7000000,
[    0.000000] c0 Unable to handle kernel paging request at virtual address a86f7000
[    0.000000] c0 pgd = (ptrval)
[    0.000000] c0 [a86f7000] *pgd=00000000
[    0.000000] c0 Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[    0.000000] c0 Modules linked in:
[    0.000000] c0 CPU: 0 PID: 0 Comm: swapper Not tainted 4.14.133+ #83
[    0.000000] c0 Hardware name: Generic DT based system
[    0.000000] c0 task: (ptrval) task.stack: (ptrval)
[    0.000000] c0 PC is at kasan_pte_populate+0x2c/0xcc
[    0.000000] c0 LR is at kasan_init+0x258/0x2b0
[    0.000000] c0 pc : [<c170b8cc>]    lr : [<c170bc7c>]    psr: a00000d3
[    0.000000] c0 sp : c1803d88  ip : c170b8b4  fp : c1803da4
[    0.000000] c0 r10: c14c2354  r9 : b7000000  r8 : c18b3280
[    0.000000] c0 r7 : c18b3e00  r6 : b7000000  r5 : c1545034  r4 : bc200000
[    0.000000] c0 r3 : a86f7000  r2 : ffffffff  r1 : 00000000  r0 : c0006dc0
[    0.000000] c0 Flags: NzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none
[    0.000000] c0 Control: 10c5383d  Table: 817a4000  DAC: 00000051
[    0.000000] c0 Process swapper (pid: 0, stack limit = 0x(ptrval))
[    0.000000] c0 Stack: (0xc1803d88 to 0xc1804000)
[    0.000000] c0 3d80:                   bc200000 c1545034 c1c60ee0 c18b3e00 c1803ddc c1803da8
[    0.000000] c0 3da0: c170bc7c c170b8ac c15452ec 8000406a 00000000 c1790ec0 c1803ec0 c1bc08c0
[    0.000000] c0 3dc0: c1803f40 c179d23c 80008000 c20e43a0 c1803eec c1803de0 c1706020 c170ba30
[    0.000000] c0 3de0: 0000006c 10c5383d c1803e0c c1803df8 c01c7a3c c01c759c 00000024 b73007c4
[    0.000000] c0 3e00: c1803e44 c1803e10 c01c94f4 c01c7a18 00000001 00000030 c1803e44 b73007cc
[    0.000000] c0 3e20: 41b58ab3 c14c01b0 c1705990 00040e85 c180b200 00000000 c1803edc c1803e48
[    0.000000] c0 3e40: c01c89c8 c01c92bc c1803e6c c1803e58 c0f08478 c0358a94 c1817348 c1856440
[    0.000000] c0 3e60: 41b58ab3 c14c30bd c01c894c c0f08458 00000001 c18564e0 c1803e9c c1803e88
[    0.000000] c0 3e80: c1803ee4 c03588c4 c1879240 00000005 c1803eec c1803ea0 c1803eec c1803ea8
[    0.000000] c0 3ea0: c0275760 c0358b34 c1803eec c1803ec8 c1705578 c01c895c c1879284 00000000
[    0.000000] c0 3ec0: c1803eec b73007e4 c180b21c c1803fc0 c180b208 00040e85 c180b200 00000000
[    0.000000] c0 3ee0: c1803ff4 c1803ef0 c1700c18 c170599c 00000000 00000000 00000000 00000000
[    0.000000] c0 3f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3f20: 41b58ab3 c14bf229 c1700b64 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3f40: c179d23c 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3f60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3f80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3fa0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c170b894
[    0.000000] c0 3fc0: c1bc0ba0 00000000 c179d238 c1bc0ba0 c180b21c c179d238 c181c344 8000406a
[    0.000000] c0 3fe0: 410fd034 00000000 00000000 c1803ff8 c0006fc0 c1700b70 00000000 00000000
[    0.000000] c0 [<c170b8cc>] (kasan_pte_populate) from [<c170bc7c>] (kasan_init+0x258/0x2b0)
[    0.000000] c0 [<c170bc7c>] (kasan_init) from [<c1706020>] (setup_arch+0x690/0xd64)
[    0.000000] c0 [<c1706020>] (setup_arch) from [<c1700c18>] (start_kernel+0xb4/0x514)
[    0.000000] c0 [<c1700c18>] (start_kernel) from [<c0006fc0>] (0xc0006fc0)


Is there any config wrong?


thanks and best regards
youyan
    

Linus Walleij

unread,
Jul 13, 2020, 8:02:03 AM7/13/20
to Andrey Konovalov, yan, kasan-dev
On Mon, Jul 13, 2020 at 1:13 PM Andrey Konovalov <andre...@google.com> wrote:

> KASAN patches for ARM are currently on version v12 AFAICS, so try that
> instead of v2.

Yes it is here:
https://lore.kernel.org/linux-arm-kernel/20200706122447.696...@linaro.org/

Please test this version and report back on the mailing list. I am hunting
some ghost crashes but currently my best assumption is that these happen
because the kernel image (+device tree and/or initramfs) grows so big
that they don't fit inside the first memory block, which is necessary
during boot. But I'm still debugging that.

Yours,
Linus Walleij

hyo...@126.com

unread,
Jul 13, 2020, 9:25:18 AM7/13/20
to kasan-dev
hi Linus Walleij
I porting v12 to kernel v4.14,report fellow crash log:
    0.000000] c0 CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] c0 CPU: div instructions available: patching division code
[    0.000000] c0 CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] c0 OF: fdt: Machine model: Spreadtrum SL8541E-1H10-32b Board DX8000
[    0.000000] c0 earlycon: sprd_serial0 at MMIO 0x70100000 (options '115200n8')
[    0.000000] c0 bootconsole [sprd_serial0] enabled
[    0.000000] c0 Internal error: Oops: 805 [#1] PREEMPT SMP ARM
[    0.000000] c0 Modules linked in:
[    0.000000] c0 CPU: 0 PID: 0 Comm: swapper Not tainted 4.14.133+ #90
[    0.000000] c0 Hardware name: Generic DT based system
[    0.000000] c0 task: (ptrval) task.stack: (ptrval)
[    0.000000] c0 PC is at mmioset+0x30/0xa8
[    0.000000] c0 LR is at 0x0
[    0.000000] c0 pc : [<c1f59830>]    lr : [<00000000>]    psr: 200000d3
[    0.000000] c0 sp : c2a03d58  ip : a86f6000  fp : c2a03d94
[    0.000000] c0 r10: c2a14bc4  r9 : 00000000  r8 : 00000000
[    0.000000] c0 r7 : c0006dc8  r6 : b7200000  r5 : b7000000  r4 : a86f7000
[    0.000000] c0 r3 : 00000000  r2 : 00000fc0  r1 : 00000000  r0 : a86f6000
[    0.000000] c0 Flags: nzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none
[    0.000000] c0 Control: 10c5383d  Table: 828d006a  DAC: 00000051
[    0.000000] c0 Process swapper (pid: 0, stack limit = 0x(ptrval))
[    0.000000] c0 Stack: (0xc2a03d58 to 0xc2a04000)
[    0.000000] c0 3d40:                                                       bc200000 c2810998
[    0.000000] c0 3d60: a86f6000 00002dbe c1f90364 b7000000 c25de000 c2e5fce0 c2ab3880 c25de034
[    0.000000] c0 3d80: c28ca0b0 c255bc89 c2a03dcc c2a03d98 c2810cf0 c2810868 00000007 bc200000
[    0.000000] c0 3da0: c280fb4c c28bad18 c2a1a960 80008000 c2a03ec0 c2a03f40 e12fff1e c1f58f78
[    0.000000] c0 3dc0: c2a03eec c2a03dd0 c28090f4 c2810aec 0000006c 10c5383d c2a03ee4 00000000
[    0.000000] c0 3de0: 00000001 00000001 c2a03e0c c2a03df8 c028c3f4 185407c4 c1fa8300 c2a03ee4
[    0.000000] c0 3e00: c2a03e44 c2a03e10 c028f460 c028c3d0 c2a03e3c c2a03e20 c2a55fb4 b75407cc
[    0.000000] c0 3e20: 41b58ab3 c2559770 c2808584 00040e85 c2a0b200 00000000 c2a03edc c2a03e48
[    0.000000] c0 3e40: c028e1b0 c028eed4 c2a17348 c281d9e0 c2a17348 c2a55ec0 c2a03e94 c05b6b7c
[    0.000000] c0 3e60: 41b58ab3 c255c9e2 c028e134 c2a55f60 00000002 c1ffb16c c2a55fa8 c2a55fa4
[    0.000000] c0 3e80: c2a03ee4 00000000 c2a03eec c2e5bf80 c2e5d480 00000000 c2a0b208 00040e85
[    0.000000] c0 3ea0: c2a03ebc c2a03eb0 c05b6b7c c05b7340 c2a03ecc c2a03ec0 c05b7f6c 00000000
[    0.000000] c0 3ec0: c2a03eec b75407e4 c2a0b21c c2a03fc0 c2a0b208 00040e85 c2a0b200 00000000
[    0.000000] c0 3ee0: c2a03ff4 c2a03ef0 c280110c c2808590 00000000 00000000 00000000 00000000
[    0.000000] c0 3f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3f20: 41b58ab3 c25587e9 c2801058 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3f40: c28c923c 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3f60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3f80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    0.000000] c0 3fa0: 00000000 00000000 00000000 c2810ad4 00000000 00002dbe 00000000 c2dbfba0
[    0.000000] c0 3fc0: c2a0b21c 00000000 c2a1c324 c2dbfba0 c2a0b21c c28c9238 c2a1c324 8000406a
[    0.000000] c0 3fe0: 410fd034 00000000 00000000 c2a03ff8 c28109fc c2801064 00000000 00000000
[    0.000000] c0 [<c1f59830>] (mmioset) from [<c2810998>] (kasan_pgd_populate+0x13c/0x21c)
[    0.000000] c0 [<c2810998>] (kasan_pgd_populate) from [<c2810cf0>] (kasan_init+0x210/0x260)
[    0.000000] c0 [<c2810cf0>] (kasan_init) from [<c28090f4>] (setup_arch+0xb70/0x1978)
[    0.000000] c0 [<c28090f4>] (setup_arch) from [<c280110c>] (start_kernel+0xb4/0x6e4)
[    0.000000] c0 [<c280110c>] (start_kernel) from [<c28109fc>] (kasan_pgd_populate+0x1a0/0x2

how I can fix it?

thanks and best regards
youyan

在 2020年7月13日星期一 UTC+8下午2:16:43,hyo...@126.com写道:
Reply all
Reply to author
Forward
0 new messages