Auditd segfaults (only) on mvebu

I build and use my own OpenWrt images with audit enabled for 3 platforms:

  • Raspberry Pi 3B+
  • Linksys WRT-1900AC v1
  • Linksys WRT-1900ACS v2.

The 3 configurations that I built are almost identical. Drivers built-in kernel differ, but OpenWrt config is mostly the same for all 3.

On RPi, audit works properly.
On mvebu (both of them), kernel audit works, but auditd daemon segfaults on start.

I tried:

  • to make the package built-in, so there woudn't be any version conflict - segfaults too
  • to install auditd from the official OpenWrt package - segfaults too.
  • to start without any audit rules or config files - segfaults too.
  • to start manually and with various cmdline switches - still segfaults.

I have this situation for more than a year. At first I thought that there must be something wrong with my build. But after several images built, kernel major version changed, numerous cleanups, host gcc major version change (Gentoo), now I'm sure it must be a problem with OpenWrt.
Before reporting a bug, I just wanted to check one more time:

If any of you use mvebu, does auditd work on your system?

Thanks.

It segfaults on Turris Omnia too.
I tried gdb on the binary as it is now, but there's only an address.

Starting program: /usr/sbin/auditd -n -c /tmp
[New LWP 6932]

Thread 1 "auditd" received signal SIGSEGV, Segmentation fault.
0xb6fd75c0 in ?? ()

kernel log:

<3>[  142.662503][ T5739] 8<--- cut here ---
<3>[  142.666354][ T5739] auditd: unhandled page fault (11) at 0x00000019, code 0x005
<3>[  142.673722][ T5739] [00000019] *pgd=00000000
<5>[  142.678026][ T5739] CPU: 0 PID: 5739 Comm: auditd Tainted: G           O       6.1.82 #0
<5>[  142.686167][ T5739] Hardware name: Marvell Armada 380/385 (Device Tree)
<5>[  142.692837][ T5739] PC is at 0xb6f4f5b0
<5>[  142.696694][ T5739] LR is at 0xb6f50c44
<5>[  142.700540][ T5739] pc : [<b6f4f5b0>]    lr : [<b6f50c44>]    psr: 20000010
<5>[  142.707542][ T5739] sp : bed11130  ip : 0000003a  fp : 00000000
<5>[  142.713482][ T5739] r10: bed11540  r9 : 004ab3c5  r8 : 00000000
<5>[  142.719415][ T5739] r7 : 00000000  r6 : 00000019  r5 : 00000019  r4 : 7fffffff
<5>[  142.726740][ T5739] r3 : 00000019  r2 : 7fffffff  r1 : 00000000  r0 : 00000019
<5>[  142.733992][ T5739] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA ARM Segment user
<5>[  142.741934][ T5739] Control: 10c5387d  Table: 0a4ac04a  DAC: 00000055
<3>[  147.749776][ T5766] 8<--- cut here ---
<3>[  147.753546][ T5766] auditd: unhandled page fault (11) at 0x00000074, code 0x005
<3>[  147.760895][ T5766] [00000074] *pgd=00000000
<5>[  147.765180][ T5766] CPU: 0 PID: 5766 Comm: auditd Tainted: G           O       6.1.82 #0
<5>[  147.773300][ T5766] Hardware name: Marvell Armada 380/385 (Device Tree)
<5>[  147.779955][ T5766] PC is at 0xb6efa5c0
<5>[  147.783802][ T5766] LR is at 0xb6efbc44
<5>[  147.787662][ T5766] pc : [<b6efa5c0>]    lr : [<b6efbc44>]    psr: 20000010
<5>[  147.794647][ T5766] sp : bec20120  ip : 0000003a  fp : 00000000
<5>[  147.800592][ T5766] r10: bec20540  r9 : 0046b3c5  r8 : 00000000
<5>[  147.806526][ T5766] r7 : 00000000  r6 : 00000074  r5 : 00000074  r4 : 7fffffff
<5>[  147.813771][ T5766] r3 : 00000032  r2 : 7fffffff  r1 : 00000000  r0 : 00000074
<5>[  147.821029][ T5766] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA ARM Segment user
<5>[  147.828966][ T5766] Control: 10c5387d  Table: 0a48c04a  DAC: 00000055

Can anyone tell me how to build the package so that it can be debugged ?
Thanks