etnaviv: NULL pointer dereference in recent stable 5.4.y
After updating my 5.4.y stable kernel from 32 to 41, I now see a consistent Oops when the qtwebengine-based program starts. As the only change in etnaviv in that timeframe, I have reverted b716a5f5ec65474365965e4db3d3c77c625d53d2 ("drm/etnaviv: rework perfmon query infrastructure") and that fixes the Oops.
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = 3f34fb0f
[00000000] *pgd=00000000
Internal error: Oops: 5 [#1] ARM
Modules linked in:
CPU: 0 PID: 415 Comm: qt-host Not tainted 5.4.41-p868-00024-g934aea6e42aa-dirty #508
Hardware name: Freescale i.MX6 SoloX (Device Tree)
PC is at strncpy+0x14/0x30
LR is at etnaviv_pm_query_sig+0xd0/0x104
pc : [<c08bca78>] lr : [<c0473940>] psr: 20010013
sp : edd47e20 ip : edd47ed1 fp : 0000004c
r10: edd47e88 r9 : edd47e88 r8 : c046c7a4
r7 : 00000050 r6 : edd47e88 r5 : 00000001 r4 : c094d0c8
r3 : edd47e91 r2 : 0000003f r1 : 00000000 r0 : edd47e92
Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
Control: 10c53c7d Table: adcf8059 DAC: 00000051
Process qt-host (pid: 415, stack limit = 0x379c33fb)
Stack: (0xedd47e20 to 0xedd48000)
7e20: ee9d2c00 edd040c0 00000000 00000020 c046c7a4 c043e740 efe11ce0 00000000
7e40: 0000004b c094ccc4 0000004c 0000004b edd040c0 edd47e88 c04c644b c043e940
7e60: 00000001 c0b3a6a8 ffefe13c b0f3c18f efe17780 bede0eb8 0000004c edccccc0
7e80: c046c7a4 00000051 00000000 00000001 00000000 00000000 00000000 00000000
7ea0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
7ec0: 00000000 00000000 00000000 00000000 00000000 c01f7788 00000000 00000000
7ee0: edc53630 00000054 00100cca 000004e5 b0a41000 edcfac28 edcfac28 00000000
7f00: 00000000 00000000 00000000 bede0eb8 ee98bb58 00000009 c04c644b edccccc0
7f20: edd46000 00000036 010a7d90 c022c514 edc53630 c0111b18 00002710 00000000
7f40: 00000006 0e200080 00000000 00000054 00000000 00000000 00000000 00000009
7f60: 00000100 c0e09534 00000007 c01119fc edccccc0 edccccc0 00000009 c04c644b
7f80: bede0eb8 edd46000 00000036 c022cd1c 010a8370 bede0eb8 c04c644b 00000036
7fa0: c0101204 c0101000 010a8370 bede0eb8 00000009 c04c644b bede0eb8 0000004c
7fc0: 010a8370 bede0eb8 c04c644b 00000036 010a69d0 bede0eb8 bede0e70 010a7d90
7fe0: b0d76efc bede0e44 b0d5f823 b616b278 00010030 00000009 00000000 00000000
[<c08bca78>] (strncpy) from [<c0473940>] (etnaviv_pm_query_sig+0xd0/0x104)
[<c0473940>] (etnaviv_pm_query_sig) from [<c043e740>] (drm_ioctl_kernel+0x88/0xd0)
[<c043e740>] (drm_ioctl_kernel) from [<c043e940>] (drm_ioctl+0x1b8/0x368)
[<c043e940>] (drm_ioctl) from [<c022c514>] (do_vfs_ioctl+0x9c/0x870)
[<c022c514>] (do_vfs_ioctl) from [<c022cd1c>] (ksys_ioctl+0x34/0x60)
[<c022cd1c>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xedd47fa8 to 0xedd47ff0)
7fa0: 010a8370 bede0eb8 00000009 c04c644b bede0eb8 0000004c
7fc0: 010a8370 bede0eb8 c04c644b 00000036 010a69d0 bede0eb8 bede0e70 010a7d90
7fe0: b0d76efc bede0e44 b0d5f823 b616b278
Code: 012fff1e e2422001 e2403001 e080c002 (e5d12000)
---[ end trace d2e2b1e74be79ee4 ]---