All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] data corruption of init process
@ 2024-12-27 10:44 Stefan Kerkmann
  2024-12-27 13:24 ` Gao Xiang
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Kerkmann @ 2024-12-27 10:44 UTC (permalink / raw)
  To: linux-erofs

Hello,

I have debugged a kernel panic issue on my i.MX6Q board and might be running
into a bug in erofs. The problem manifests in a crashed init process in user
space. The process is either killed by a SIGILL as it attempts to execute a
malformed instruction or SIGSEGV by dereferencing an invalid address.

Example of a crash:

[    5.896446] 8<--- cut here ---
[    5.899614] init: unhandled page fault (11) at 0x000008ec, code 0x005
[    5.906214] [000008ec] *pgd=00000000
[    5.909925] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.12.6-00006-gfa286c4fa82b-dirty #96
[    5.918604] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    5.925351] PC is at 0x76ef6bbe
[    5.928698] LR is at 0x76efb619
[    5.931988] pc : [<76ef6bbe>]    lr : [<76efb619>]    psr: 200f0030
[    5.938500] sp : 7ee73b48  ip : ffffffff  fp : 004e0034
[    5.943908] r10: 00000009  r9 : 76efb5cd  r8 : 004e0034
[    5.949332] r7 : 7ee73b58  r6 : 00000000  r5 : 7ee73bb8  r4 : 76f08fd0
[    5.955952] r3 : 00000000  r2 : 7ee73d7c  r1 : 00000009  r0 : 00000000
[    5.962739] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment user
[    5.970282] Control: 50c5387d  Table: 1612c04a  DAC: 00000055
[    5.976193] Call trace:
[    5.976264] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

So far I was able to gather the following clues:

1. The crashes happen all the time and always have the same cause. 
  - Which corruption is triggered seems to be tied to the load on boot e.g., by
    capturing many trace events I'll run into the SIGSEGV if I don't capture
    SIGILL is triggered.
2. Any compressed erfos will trigger the bug. 
  - I have tested lz4, lzma and zstd, so the concrete compression algorithm shouldn't matter.
3. An uncompressed erofs didn't fail in my tests.
4. Mounting the erofs from an initramfs or my local machine works just fine.
  - The sha256 sums of any binary match the expected values.
5. Forcing full file reads instead of partial reads prevents the memory corruption from happening.
  - To force a full file read I "hacked" vfs_open to read to complete file via kernel_read_file
6. I couldn't reproduce the bug in a qemu setup (yet?)
  - I tried to force partial reads by slowing down the emulated disk by setting bps=202400, that didn't trigger it

From what I have gathered it looks like that partial reads of compressed files
lead to memory corruption of the decompressed file in specific circumstances
(which I lack the knowledge to debug). The modifications and .config of the
kernel I'm using to debug can be found in this branch:
https://github.com/KarlK90/linux/tree/debug/erofs.

This is my machine:

* ARM32 i.MX6Q SoC
  - forced single core during debug by setting maxcpus=0
* 1 GiB RAM (2/2G Split)
  - memtest=10 shows no problem
* 8GB eMMC (DDR54 Speed) with erofs rootfs
  - erofs-util: 1.8.3
* Kernel and DT loaded via TFTP from the bootloader
  - kernel: mainline v6.12.6

Here are some longer snippets of the augmented debug output:

Good case (forced full file reads):

[    5.350567] Run /sbin/init as init process
[    5.354822]   with arguments:
[    5.357978]     /sbin/init
[    5.360881]   with environment:
[    5.364139]     HOME=/
[    5.366616]     TERM=linux
[    5.373230] vfs_open: /usr/lib/systemd/systemd
[    5.382033] erofs: (device mmcblk3p3): lz4        : src c1002000 dst: c1000000 in: 4096b (eec708e7) out: 8859b (3bfdda11)
[    5.393476] erofs: (device mmcblk3p3): lz4        : src c1005000 dst: c100429b in: 4096b (76037b0d) out: 5168b (79840434)
[    5.411541] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c10066cb in: 4096b (4cac566d) out: 6376b (dfcc8264)
[    5.422948] erofs: (device mmcblk3p3): lz4        : src c100a000 dst: c1008fb3 in: 4096b (74af795c) out: 4651b (46c58dd7)
[    5.434316] erofs: (device mmcblk3p3): lz4        : src c100d000 dst: c100c1de in: 4096b (d65a3a49) out: 5360b (4364e0fc)
[    5.445764] erofs: (device mmcblk3p3): lz4        : src c100f000 dst: c100e6ce in: 4096b (db73bb75) out: 4606b (c0a54f50)
[    5.457156] erofs: (device mmcblk3p3): lz4        : src c1011000 dst: c10108cc in: 4096b (be653c3d) out: 4536b (10b3a4d0)
[    5.468599] erofs: (device mmcblk3p3): lz4        : src c1013000 dst: c1012a84 in: 4096b (8cd3cff3) out: 4285b (541c02fb)
[    5.480043] erofs: (device mmcblk3p3): lz4        : src c1015000 dst: c1014b41 in: 4096b (b885e4f7) out: 4789b (af1820d3)
[    5.491505] erofs: (device mmcblk3p3): lz4        : src c1018000 dst: c1016df6 in: 4096b (3b4e9357) out: 6216b (6a149c5)
[    5.502895] erofs: (device mmcblk3p3): lz4        : src c101c000 dst: c101a63e in: 4096b (a3bdbd0e) out: 8015b (63d1fbc1)
[    5.514353] erofs: (device mmcblk3p3): lz4        : src c101f000 dst: c101e58d in: 4096b (480285a7) out: 6603b (822f8de0)
[    5.525774] erofs: (device mmcblk3p3): lz4        : src c0b41000 dst: c1020f58 in: 1839b (4f637f42) out: 5780b (55fe911f)
[    5.538186] vfs_open: hash of /usr/lib/systemd/systemd: 0x0610c635
[    5.547236] vfs_open: /usr/lib/ld-linux-armhf.so.3
[    5.557957] erofs: (device mmcblk3p3): lz4        : src c1025000 dst: c1024000 in: 4096b (e4b39a2) out: 4907b (aa05f0a3)
[    5.569267] erofs: (device mmcblk3p3): lz4        : src c1027000 dst: c102632b in: 4096b (717fc925) out: 4246b (c0f62dca)
[    5.580659] erofs: (device mmcblk3p3): lz4        : src c1029000 dst: c10283c1 in: 4096b (8030d189) out: 4292b (1df48c5f)
[    5.592080] erofs: (device mmcblk3p3): lz4        : src c102b000 dst: c102a485 in: 4096b (4aac6f77) out: 4289b (7dbbff69)
[    5.603468] erofs: (device mmcblk3p3): lz4        : src c102d000 dst: c102c546 in: 4096b (e286b2b) out: 4207b (ec8e3f58)
[    5.614912] erofs: (device mmcblk3p3): lz4        : src c102f000 dst: c102e5b5 in: 4096b (e698fd35) out: 4291b (fcf580f8)
[    5.626289] erofs: (device mmcblk3p3): lz4        : src c1031000 dst: c1030678 in: 4096b (4859aa8f) out: 4297b (ab8a8574)
[    5.637684] erofs: (device mmcblk3p3): lz4        : src c1033000 dst: c1032741 in: 4096b (997436a4) out: 4218b (be0817b8)
[    5.649048] erofs: (device mmcblk3p3): lz4        : src c1035000 dst: c10347bb in: 4096b (112a3fda) out: 4271b (293ce253)
[    5.660486] erofs: (device mmcblk3p3): lz4        : src c1037000 dst: c103686a in: 4096b (fa3410b9) out: 4673b (7f7a9871)
[    5.672005] erofs: (device mmcblk3p3): lz4        : src c1039000 dst: c1038aab in: 4096b (634b03ca) out: 4477b (cf289eb)
[    5.683341] erofs: (device mmcblk3p3): lz4        : src c103b000 dst: c103ac28 in: 4096b (326e1ba0) out: 4254b (998b1f98)
[    5.694724] erofs: (device mmcblk3p3): lz4        : src c103d000 dst: c103ccc6 in: 4096b (3c5b4505) out: 4175b (3bf4f1a9)
[    5.706147] erofs: (device mmcblk3p3): lz4        : src c103f000 dst: c103ed15 in: 4096b (8e87c14d) out: 4288b (6a251e64)
[    5.717571] erofs: (device mmcblk3p3): lz4        : src c1041000 dst: c1040dd5 in: 4096b (31a2e179) out: 4257b (3e19e451)
[    5.729186] erofs: (device mmcblk3p3): lz4        : src c0b41000 dst: c1042e76 in: 4096b (65fa2fbe) out: 4460b (ebe0126c)
[    5.756228] erofs: (device mmcblk3p3): lz4        : src c1046000 dst: c1044fe2 in: 4096b (37a8bad1) out: 4349b (c125197)
[    5.767502] erofs: (device mmcblk3p3): lz4        : src c1049000 dst: c10480df in: 4096b (8d172a42) out: 4353b (1503ff28)
[    5.778859] erofs: (device mmcblk3p3): lz4        : src c104b000 dst: c104a1e0 in: 4096b (1ef07e2b) out: 4869b (c3bf758b)
[    5.790237] erofs: (device mmcblk3p3): lz4        : src c104d000 dst: c104c4e5 in: 4096b (f4462dc1) out: 5484b (9b35c90f)
[    5.801635] erofs: (device mmcblk3p3): lz4        : src c1050000 dst: c104ea51 in: 4096b (2ac6b4d5) out: 5985b (94cc0d29)
[    5.813049] erofs: (device mmcblk3p3): lz4        : src c1053000 dst: c10521b2 in: 4096b (90757c3c) out: 6356b (58df129b)
[    5.824504] erofs: (device mmcblk3p3): lz4        : src c1056000 dst: c1054a86 in: 4096b (971b791e) out: 6045b (3a6bbefa)
[    5.836079] erofs: (device mmcblk3p3): lz4        : src c105a000 dst: c1058223 in: 4096b (9804bc65) out: 10510b (2a60a723)
[    5.847541] erofs: (device mmcblk3p3): lz4        : src 836cea35 dst: c105cb31 in: 1483b (5c99618c) out: 4759b (b53e5caa)
[    5.860666] vfs_open: hash of /usr/lib/ld-linux-armhf.so.3: 0xf1fe4854

Bad case:

[    5.348323] Run /sbin/init as init process
[    5.352588]   with arguments:
[    5.355645]     /sbin/init
[    5.358551]   with environment:
[    5.361822]     HOME=/
[    5.364324]     TERM=linux
[    5.370845] vfs_open: /usr/lib/systemd/systemd
[    5.377861] erofs: (device mmcblk3p3): lz4        : src c1002000 dst: c1000000 in: 4096b (eec708e7) out: 8859b (3bfdda11)
[    5.389340] erofs: (device mmcblk3p3): lz4        : src c1005000 dst: c100429b in: 4096b (76037b0d) out: 5168b (79840434)
[    5.400891] erofs: (device mmcblk3p3): lz4 partial: src 83e3d000 dst: 810fb6cb in: 4096b (45bf72c3) out: 2357b (6e052dd5)
[    5.419977] vfs_open: /usr/lib/ld-linux-armhf.so.3
[    5.426854] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c1006000 in: 4096b (e4b39a2) out: 4907b (aa05f0a3)
[    5.438199] erofs: (device mmcblk3p3): lz4        : src c1009000 dst: c100832b in: 4096b (717fc925) out: 4246b (c0f62dca)
[    5.451237] erofs: (device mmcblk3p3): lz4        : src 83e3d000 dst: c100a6cb in: 4096b (45bf72c3) out: 6376b (dfcc8264)
[    5.462706] erofs: (device mmcblk3p3): lz4        : src c100d000 dst: c100c3c1 in: 4096b (8030d189) out: 4292b (1df48c5f)
[    5.474078] erofs: (device mmcblk3p3): lz4 partial: src 83fe9000 dst: 810f7485 in: 4096b (17ce8f99) out: 2939b (a1ab12cf)
[    5.487190] erofs: (device mmcblk3p3): lz4        : src c1010000 dst: c100efb3 in: 4096b (74af795c) out: 4651b (46c58dd7)
[    5.498593] erofs: (device mmcblk3p3): lz4        : src c1013000 dst: c10121de in: 4096b (d65a3a49) out: 5360b (4364e0fc)
[    5.510263] erofs: (device mmcblk3p3): lz4        : src c1015000 dst: c10146ce in: 4096b (db73bb75) out: 4606b (c0a54f50)
[    5.521662] erofs: (device mmcblk3p3): lz4        : src c1017000 dst: c10168cc in: 4096b (be653c3d) out: 4536b (10b3a4d0)
[    5.533076] erofs: (device mmcblk3p3): lz4        : src c1019000 dst: c1018a84 in: 4096b (8cd3cff3) out: 4285b (541c02fb)
[    5.546051] erofs: (device mmcblk3p3): lz4        : src c101b000 dst: c101ab41 in: 4096b (b885e4f7) out: 4789b (af1820d3)
[    5.557492] erofs: (device mmcblk3p3): lz4        : src c101e000 dst: c101cdf6 in: 4096b (3b4e9357) out: 6216b (6a149c5)
[    5.568954] erofs: (device mmcblk3p3): lz4        : src c1022000 dst: c102063e in: 4096b (a3bdbd0e) out: 8015b (63d1fbc1)
[    5.580412] erofs: (device mmcblk3p3): lz4        : src c1025000 dst: c102458d in: 4096b (480285a7) out: 6603b (822f8de0)
[    5.591833] erofs: (device mmcblk3p3): lz4        : src c0b11000 dst: c1026f58 in: 1839b (4f637f42) out: 5780b (55fe911f)
[    5.606916] erofs: (device mmcblk3p3): lz4        : src 83691000 dst: c102acc6 in: 4096b (cd2f4c7c) out: 4175b (3bf4f1a9)
[    5.618445] erofs: (device mmcblk3p3): lz4        : src c102d000 dst: c102cd15 in: 4096b (8e87c14d) out: 4288b (6a251e64)
[    5.638278] erofs: (device mmcblk3p3): lz4        : src c102f000 dst: c102edd5 in: 4096b (31a2e179) out: 4257b (3e19e451)
[    5.649650] erofs: (device mmcblk3p3): lz4        : src c0b11000 dst: c1030e76 in: 4096b (65fa2fbe) out: 4460b (ebe0126c)
[    5.661024] erofs: (device mmcblk3p3): lz4        : src c1034000 dst: c1032fe2 in: 4096b (37a8bad1) out: 4349b (c125197)
[    5.672301] erofs: (device mmcblk3p3): lz4        : src c1037000 dst: c10360df in: 4096b (8d172a42) out: 4353b (1503ff28)
[    5.683651] erofs: (device mmcblk3p3): lz4        : src c1039000 dst: c10381e0 in: 4096b (1ef07e2b) out: 4869b (c3bf758b)
[    5.695026] erofs: (device mmcblk3p3): lz4        : src c103b000 dst: c103a4e5 in: 4096b (f4462dc1) out: 5484b (9b35c90f)
[    5.706424] erofs: (device mmcblk3p3): lz4        : src c103e000 dst: c103ca51 in: 4096b (2ac6b4d5) out: 5985b (94cc0d29)
[    5.717848] erofs: (device mmcblk3p3): lz4        : src c1041000 dst: c10401b2 in: 4096b (90757c3c) out: 6356b (58df129b)
[    5.729267] erofs: (device mmcblk3p3): lz4        : src c1044000 dst: c1042a86 in: 4096b (971b791e) out: 6045b (3a6bbefa)
[    5.740762] erofs: (device mmcblk3p3): lz4        : src c1048000 dst: c1046223 in: 4096b (9804bc65) out: 10510b (2a60a723)
[    5.752186] erofs: (device mmcblk3p3): lz4        : src 83692a35 dst: c104ab31 in: 1483b (5c99618c) out: 4759b (b53e5caa)
[    5.764897] erofs: (device mmcblk3p3): lz4        : src 83fe9000 dst: c104c485 in: 4096b (17ce8f99) out: 4289b (7dbbff69)
[    5.783592] erofs: (device mmcblk3p3): lz4 partial: src 83691000 dst: 810cacc6 in: 4096b (cd2f4c7c) out: 826b (21762da4)
[    5.805222] erofs: (device mmcblk3p3): lz4        : src c104f000 dst: c104e546 in: 4096b (e286b2b) out: 4207b (ec8e3f58)
[    5.816904] erofs: (device mmcblk3p3): lz4        : src c1051000 dst: c10505b5 in: 4096b (e698fd35) out: 4291b (fcf580f8)
[    5.828288] erofs: (device mmcblk3p3): lz4        : src c1053000 dst: c1052678 in: 4096b (4859aa8f) out: 4297b (ab8a8574)
[    5.839655] erofs: (device mmcblk3p3): lz4        : src c1055000 dst: c1054741 in: 4096b (997436a4) out: 4218b (be0817b8)
[    5.851028] erofs: (device mmcblk3p3): lz4        : src c1057000 dst: c10567bb in: 4096b (112a3fda) out: 4271b (293ce253)
[    5.862394] erofs: (device mmcblk3p3): lz4        : src c1059000 dst: c105886a in: 4096b (fa3410b9) out: 4673b (7f7a9871)
[    5.873757] erofs: (device mmcblk3p3): lz4        : src c105b000 dst: c105aaab in: 4096b (634b03ca) out: 4477b (cf289eb)
[    5.885028] erofs: (device mmcblk3p3): lz4        : src 83692000 dst: c105cc28 in: 4096b (163cdf49) out: 4254b (998b1f98)
[    5.896446] 8<--- cut here ---
[    5.899614] init: unhandled page fault (11) at 0x000008ec, code 0x005
[    5.906214] [000008ec] *pgd=00000000
[    5.909925] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.12.6-00006-gfa286c4fa82b-dirty #96
[    5.918604] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    5.925351] PC is at 0x76ef6bbe
[    5.928698] LR is at 0x76efb619
[    5.931988] pc : [<76ef6bbe>]    lr : [<76efb619>]    psr: 200f0030
[    5.938500] sp : 7ee73b48  ip : ffffffff  fp : 004e0034
[    5.943908] r10: 00000009  r9 : 76efb5cd  r8 : 004e0034
[    5.949332] r7 : 7ee73b58  r6 : 00000000  r5 : 7ee73bb8  r4 : 76f08fd0
[    5.955952] r3 : 00000000  r2 : 7ee73d7c  r1 : 00000009  r0 : 00000000
[    5.962739] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment user
[    5.970282] Control: 50c5387d  Table: 1612c04a  DAC: 00000055
[    5.976193] Call trace:
[    5.976264] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

I'm not sure how to proceed from here or if anybody has some clues what the root cause might be?

Best regards,
Stefan

-- 
Pengutronix e.K.                       | Stefan Kerkmann             |
Steuerwalder Str. 21                   | https://www.pengutronix.de/ |
31137 Hildesheim, Germany              | Phone: +49-5121-206917-128  |
Amtsgericht Hildesheim, HRA 2686       | Fax:   +49-5121-206917-9    |


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2024-12-27 10:44 [bug report] data corruption of init process Stefan Kerkmann
@ 2024-12-27 13:24 ` Gao Xiang
  2025-01-19 12:07   ` Stefan Kerkmann
  0 siblings, 1 reply; 11+ messages in thread
From: Gao Xiang @ 2024-12-27 13:24 UTC (permalink / raw)
  To: Stefan Kerkmann, linux-erofs

Hi Stefan,

On 2024/12/27 18:44, Stefan Kerkmann wrote:
> Hello,
> 
> I have debugged a kernel panic issue on my i.MX6Q board and might be running
> into a bug in erofs. The problem manifests in a crashed init process in user
> space. The process is either killed by a SIGILL as it attempts to execute a
> malformed instruction or SIGSEGV by dereferencing an invalid address.
> 
> Example of a crash:
> 
> [    5.896446] 8<--- cut here ---
> [    5.899614] init: unhandled page fault (11) at 0x000008ec, code 0x005
> [    5.906214] [000008ec] *pgd=00000000
> [    5.909925] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.12.6-00006-gfa286c4fa82b-dirty #96
> [    5.918604] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [    5.925351] PC is at 0x76ef6bbe
> [    5.928698] LR is at 0x76efb619
> [    5.931988] pc : [<76ef6bbe>]    lr : [<76efb619>]    psr: 200f0030
> [    5.938500] sp : 7ee73b48  ip : ffffffff  fp : 004e0034
> [    5.943908] r10: 00000009  r9 : 76efb5cd  r8 : 004e0034
> [    5.949332] r7 : 7ee73b58  r6 : 00000000  r5 : 7ee73bb8  r4 : 76f08fd0
> [    5.955952] r3 : 00000000  r2 : 7ee73d7c  r1 : 00000009  r0 : 00000000
> [    5.962739] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment user
> [    5.970282] Control: 50c5387d  Table: 1612c04a  DAC: 00000055
> [    5.976193] Call trace:
> [    5.976264] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> 
> So far I was able to gather the following clues:
> 
> 1. The crashes happen all the time and always have the same cause.
>    - Which corruption is triggered seems to be tied to the load on boot e.g., by
>      capturing many trace events I'll run into the SIGSEGV if I don't capture
>      SIGILL is triggered.
> 2. Any compressed erfos will trigger the bug.
>    - I have tested lz4, lzma and zstd, so the concrete compression algorithm shouldn't matter.
> 3. An uncompressed erofs didn't fail in my tests.
> 4. Mounting the erofs from an initramfs or my local machine works just fine.
>    - The sha256 sums of any binary match the expected values.
> 5. Forcing full file reads instead of partial reads prevents the memory corruption from happening.
>    - To force a full file read I "hacked" vfs_open to read to complete file via kernel_read_file
> 6. I couldn't reproduce the bug in a qemu setup (yet?)
>    - I tried to force partial reads by slowing down the emulated disk by setting bps=202400, that didn't trigger it
> 
>  From what I have gathered it looks like that partial reads of compressed files
> lead to memory corruption of the decompressed file in specific circumstances
> (which I lack the knowledge to debug). The modifications and .config of the
> kernel I'm using to debug can be found in this branch:
> https://github.com/KarlK90/linux/tree/debug/erofs.
> 
> This is my machine:
> 
> * ARM32 i.MX6Q SoC
>    - forced single core during debug by setting maxcpus=0
> * 1 GiB RAM (2/2G Split)
>    - memtest=10 shows no problem
> * 8GB eMMC (DDR54 Speed) with erofs rootfs
>    - erofs-util: 1.8.3
> * Kernel and DT loaded via TFTP from the bootloader
>    - kernel: mainline v6.12.6

Thanks for your report!

Linux 6.12 is a relative new kernel version, however my own
stress test doesn't catch this issue.

I think it may be better to try the following stuffs:

  1) Can your i.MX6Q board be switched to 6.6 LTS kernels, since
     there are many products already using EROFS for 6.6 LTS, so
     I wonder if it can be reprodced with old kernels like 6.6
     too (If it can be easily tested, please help try).

  2) does your qemu test setup emulate ARM32 i.MX6Q SoC too?

  3) Can you share your generated rootfs image to me so I could
     debug?

  4) can you try to add the attached patch (writespace-damanged)
     to your debug kernel in addition to your debug patch and
     feed back the output?

diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index fa51437e1d99..e1d918e0e6c7 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -272,6 +272,8 @@ void erofs_onlinefolio_split(struct folio *folio)
  void erofs_onlinefolio_end(struct folio *folio, int err)
  {
         int orig, v;
+       void *ptr;
+       u32 hash;

         do {
                 orig = atomic_read((atomic_t *)&folio->private);
@@ -281,6 +283,11 @@ void erofs_onlinefolio_end(struct folio *folio, int err)
         if (v & ~EROFS_ONLINEFOLIO_EIO)
                 return;
         folio->private = 0;
+
+       ptr = kmap_local_folio(folio, 0);
+       hash = fnv_32_buf(ptr, PAGE_SIZE, FNV1_32_INIT);
+       erofs_info(NULL, "%px i_ino %lu, index %lu dst %px (%x)",
+                  folio, folio->mapping->host->i_ino, folio->index, ptr, hash);
         folio_end_read(folio, !(v & EROFS_ONLINEFOLIO_EIO));
  }


> 
> Here are some longer snippets of the augmented debug output:
> 
> Good case (forced full file reads):
> 

...

> 
> Bad case:
> 
> [    5.348323] Run /sbin/init as init process
> [    5.352588]   with arguments:
> [    5.355645]     /sbin/init
> [    5.358551]   with environment:
> [    5.361822]     HOME=/
> [    5.364324]     TERM=linux
> [    5.370845] vfs_open: /usr/lib/systemd/systemd


Case 1:


  [    5.411541] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c10066cb in: 4096b (4cac566d) out: 6376b (dfcc8264)

=======


> [    5.400891] erofs: (device mmcblk3p3): lz4 partial: src 83e3d000 dst: 810fb6cb in: 4096b (45bf72c3) out: 2357b (6e052dd5)

...

> [    5.451237] erofs: (device mmcblk3p3): lz4        : src 83e3d000 dst: c100a6cb in: 4096b (45bf72c3) out: 6376b (dfcc8264)


Case 2:

> [    5.592080] erofs: (device mmcblk3p3): lz4        : src c102b000 dst: c102a485 in: 4096b (4aac6f77) out: 4289b (7dbbff69)

=======

> [    5.474078] erofs: (device mmcblk3p3): lz4 partial: src 83fe9000 dst: 810f7485 in: 4096b (17ce8f99) out: 2939b (a1ab12cf)

...

> [    5.764897] erofs: (device mmcblk3p3): lz4        : src 83fe9000 dst: c104c485 in: 4096b (17ce8f99) out: 4289b (7dbbff69)


Case 3:

> [    5.694724] erofs: (device mmcblk3p3): lz4        : src c103d000 dst: c103ccc6 in: 4096b (3c5b4505) out: 4175b (3bf4f1a9)

=======

> [    5.783592] erofs: (device mmcblk3p3): lz4 partial: src 83691000 dst: 810cacc6 in: 4096b (cd2f4c7c) out: 826b (21762da4)

...

> [    5.606916] erofs: (device mmcblk3p3): lz4        : src 83691000 dst: c102acc6 in: 4096b (cd2f4c7c) out: 4175b (3bf4f1a9)

The odd thing is that the full hash is always the
same (dfcc8264, 7dbbff69, 3bf4f1a9) but the input
hash is somewhat different between good and bad
cases.

Could you also change the following line too?
erofs_info(rq->sb, "lz4        : src %px dst: %px in: %ub (%x, %px, %lu) out: %ub (%x)", src + inputmargin, out, rq->inputsize, hash_in, rq->in[0],  rq->in[0]->index, rq->outputsize, hash_out);


Thanks,
Gao Xiang



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2024-12-27 13:24 ` Gao Xiang
@ 2025-01-19 12:07   ` Stefan Kerkmann
  2025-01-19 12:48     ` Gao Xiang
  2025-01-20  1:45     ` Gao Xiang
  0 siblings, 2 replies; 11+ messages in thread
From: Stefan Kerkmann @ 2025-01-19 12:07 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs

Hi Gao,

Sorry again that it took me so long to respond properly.

On 27.12.24 14:24, Gao Xiang wrote:
> Hi Stefan,
> 
> On 2024/12/27 18:44, Stefan Kerkmann wrote:
>> Hello,
>>
>> I have debugged a kernel panic issue on my i.MX6Q board and might be running
>> into a bug in erofs. The problem manifests in a crashed init process in user
>> space. The process is either killed by a SIGILL as it attempts to execute a
>> malformed instruction or SIGSEGV by dereferencing an invalid address.
>>
>> Example of a crash:
>>
>> [    5.896446] 8<--- cut here ---
>> [    5.899614] init: unhandled page fault (11) at 0x000008ec, code 0x005
>> [    5.906214] [000008ec] *pgd=00000000
>> [    5.909925] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.12.6-00006-
>> gfa286c4fa82b-dirty #96
>> [    5.918604] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
>> [    5.925351] PC is at 0x76ef6bbe
>> [    5.928698] LR is at 0x76efb619
>> [    5.931988] pc : [<76ef6bbe>]    lr : [<76efb619>]    psr: 200f0030
>> [    5.938500] sp : 7ee73b48  ip : ffffffff  fp : 004e0034
>> [    5.943908] r10: 00000009  r9 : 76efb5cd  r8 : 004e0034
>> [    5.949332] r7 : 7ee73b58  r6 : 00000000  r5 : 7ee73bb8  r4 : 76f08fd0
>> [    5.955952] r3 : 00000000  r2 : 7ee73d7c  r1 : 00000009  r0 : 00000000
>> [    5.962739] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment
>> user
>> [    5.970282] Control: 50c5387d  Table: 1612c04a  DAC: 00000055
>> [    5.976193] Call trace:
>> [    5.976264] Kernel panic - not syncing: Attempted to kill init!
>> exitcode=0x0000000b
>>
>> So far I was able to gather the following clues:
>>
>> 1. The crashes happen all the time and always have the same cause.
>>    - Which corruption is triggered seems to be tied to the load on boot e.g., by
>>      capturing many trace events I'll run into the SIGSEGV if I don't capture
>>      SIGILL is triggered.
>> 2. Any compressed erfos will trigger the bug.
>>    - I have tested lz4, lzma and zstd, so the concrete compression algorithm
>> shouldn't matter.
>> 3. An uncompressed erofs didn't fail in my tests.
>> 4. Mounting the erofs from an initramfs or my local machine works just fine.
>>    - The sha256 sums of any binary match the expected values.
>> 5. Forcing full file reads instead of partial reads prevents the memory
>> corruption from happening.
>>    - To force a full file read I "hacked" vfs_open to read to complete file
>> via kernel_read_file
>> 6. I couldn't reproduce the bug in a qemu setup (yet?)
>>    - I tried to force partial reads by slowing down the emulated disk by
>> setting bps=202400, that didn't trigger it
>>
>>  From what I have gathered it looks like that partial reads of compressed files
>> lead to memory corruption of the decompressed file in specific circumstances
>> (which I lack the knowledge to debug). The modifications and .config of the
>> kernel I'm using to debug can be found in this branch:
>> https://github.com/KarlK90/linux/tree/debug/erofs.
>>
>> This is my machine:
>>
>> * ARM32 i.MX6Q SoC
>>    - forced single core during debug by setting maxcpus=0
>> * 1 GiB RAM (2/2G Split)
>>    - memtest=10 shows no problem
>> * 8GB eMMC (DDR54 Speed) with erofs rootfs
>>    - erofs-util: 1.8.3
>> * Kernel and DT loaded via TFTP from the bootloader
>>    - kernel: mainline v6.12.6
> 
> Thanks for your report!
> 
> Linux 6.12 is a relative new kernel version, however my own
> stress test doesn't catch this issue.
> 
> I think it may be better to try the following stuffs:
> 
>  1) Can your i.MX6Q board be switched to 6.6 LTS kernels, since
>     there are many products already using EROFS for 6.6 LTS, so
>     I wonder if it can be reprodced with old kernels like 6.6
>     too (If it can be easily tested, please help try).
> 

I tried the current top (6.6.72) of the stable/linux-6.6.y branch - no luck
there as well. It panics just like before.

>  2) does your qemu test setup emulate ARM32 i.MX6Q SoC too?
> 

The qemu board used for emulation is the sabrelite board which tries to be close
to the i.MX6Q SoC[1] My knowledge of qemu and the specific SoC emulation is limited though,
so maybe there is a certain edge case that is not emulated which trigger the bug.

[1]: https://www.qemu.org/docs/master/system/arm/sabrelite.html.
>  3) Can you share your generated rootfs image to me so I could
>     debug?
> 

I have sanitized the rootfs and uploaded it on Github[2]. The erofs-utils used to create the
image is the latest 1.8.4 release.

[2]: https://github.com/KarlK90/linux/blob/debug/erofs/erofsdebug-rootfs.erofs-lz4

>  4) can you try to add the attached patch (writespace-damanged)
>     to your debug kernel in addition to your debug patch and
>     feed back the output?
> 

Done. The attached debug output is from booting the erofs rootfs I have uploaded on Github.

> diff --git a/fs/erofs/data.c b/fs/erofs/data.c
> index fa51437e1d99..e1d918e0e6c7 100644
> --- a/fs/erofs/data.c
> +++ b/fs/erofs/data.c
> @@ -272,6 +272,8 @@ void erofs_onlinefolio_split(struct folio *folio)
>  void erofs_onlinefolio_end(struct folio *folio, int err)
>  {
>         int orig, v;
> +       void *ptr;
> +       u32 hash;
> 
>         do {
>                 orig = atomic_read((atomic_t *)&folio->private);
> @@ -281,6 +283,11 @@ void erofs_onlinefolio_end(struct folio *folio, int err)
>         if (v & ~EROFS_ONLINEFOLIO_EIO)
>                 return;
>         folio->private = 0;
> +
> +       ptr = kmap_local_folio(folio, 0);
> +       hash = fnv_32_buf(ptr, PAGE_SIZE, FNV1_32_INIT);
> +       erofs_info(NULL, "%px i_ino %lu, index %lu dst %px (%x)",
> +                  folio, folio->mapping->host->i_ino, folio->index, ptr, hash);
>         folio_end_read(folio, !(v & EROFS_ONLINEFOLIO_EIO));
>  }
> 
> 
>>
>> Here are some longer snippets of the augmented debug output:
>>
>> Good case (forced full file reads):
>>
> 
> ...
> 
>>
>> Bad case:
>>
>> [    5.348323] Run /sbin/init as init process
>> [    5.352588]   with arguments:
>> [    5.355645]     /sbin/init
>> [    5.358551]   with environment:
>> [    5.361822]     HOME=/
>> [    5.364324]     TERM=linux
>> [    5.370845] vfs_open: /usr/lib/systemd/systemd
> 
> 
> Case 1:
> 
> 
>  [    5.411541] erofs: (device mmcblk3p3): lz4        : src c1007000 dst:
> c10066cb in: 4096b (4cac566d) out: 6376b (dfcc8264)
> 
> =======
> 
> 
>> [    5.400891] erofs: (device mmcblk3p3): lz4 partial: src 83e3d000 dst:
>> 810fb6cb in: 4096b (45bf72c3) out: 2357b (6e052dd5)
> 
> ...
> 
>> [    5.451237] erofs: (device mmcblk3p3): lz4        : src 83e3d000 dst:
>> c100a6cb in: 4096b (45bf72c3) out: 6376b (dfcc8264)
> 
> 
> Case 2:
> 
>> [    5.592080] erofs: (device mmcblk3p3): lz4        : src c102b000 dst:
>> c102a485 in: 4096b (4aac6f77) out: 4289b (7dbbff69)
> 
> =======
> 
>> [    5.474078] erofs: (device mmcblk3p3): lz4 partial: src 83fe9000 dst:
>> 810f7485 in: 4096b (17ce8f99) out: 2939b (a1ab12cf)
> 
> ...
> 
>> [    5.764897] erofs: (device mmcblk3p3): lz4        : src 83fe9000 dst:
>> c104c485 in: 4096b (17ce8f99) out: 4289b (7dbbff69)
> 
> 
> Case 3:
> 
>> [    5.694724] erofs: (device mmcblk3p3): lz4        : src c103d000 dst:
>> c103ccc6 in: 4096b (3c5b4505) out: 4175b (3bf4f1a9)
> 
> =======
> 
>> [    5.783592] erofs: (device mmcblk3p3): lz4 partial: src 83691000 dst:
>> 810cacc6 in: 4096b (cd2f4c7c) out: 826b (21762da4)
> 
> ...
> 
>> [    5.606916] erofs: (device mmcblk3p3): lz4        : src 83691000 dst:
>> c102acc6 in: 4096b (cd2f4c7c) out: 4175b (3bf4f1a9)
> 
> The odd thing is that the full hash is always the
> same (dfcc8264, 7dbbff69, 3bf4f1a9) but the input
> hash is somewhat different between good and bad
> cases.
> 
> Could you also change the following line too?
> erofs_info(rq->sb, "lz4        : src %px dst: %px in: %ub (%x, %px, %lu) out:
> %ub (%x)", src + inputmargin, out, rq->inputsize, hash_in, rq->in[0],  rq-
>>in[0]->index, rq->outputsize, hash_out);
> 

Done.

> 
> Thanks,
> Gao Xiang
> 
> 
> 

Here is the new output:

BAD:

[    4.775107] erofs: (device mmcblk3p3): mounted with root inode @ nid 36.
[    4.782154] VFS: Mounted root (erofs filesystem) readonly on device 179:3.
[    4.789277] devtmpfs: mounted
[    4.802482] Freeing unused kernel image (initmem) memory: 1024K
[    4.809163] Run /sbin/init as init process
[    4.813358]   with arguments:
[    4.816516]     /sbin/init
[    4.819387]   with environment:
[    4.822621]     HOME=/
[    4.825068]     TERM=linux
[    4.836923] vfs_open: /usr/lib/systemd/systemd
[    4.843463] erofs: (device mmcblk3p3): lz4        : src c1002000 dst: c1000000 in: 4096b (eec708e7, bf5f1f80, 2) out: 8859b (3bfdda11)
[    4.855839] erofs: bf5f1fc0 i_ino 868416, index 0 dst 810fe000 (7795d697)
[    4.862916] erofs: bf5f1fa0 i_ino 868416, index 1 dst 810fd000 (e09f25c3)
[    4.876706] erofs: (device mmcblk3p3): lz4        : src c1005000 dst: c100429b in: 4096b (76037b0d, bf5f1f60, 3) out: 5168b (79840434)
[    4.889190] erofs: bf5f1f80 i_ino 868416, index 2 dst 810fc000 (88265a45)
[    4.896188] erofs: (device mmcblk3p3): lz4 partial: src 82a06000 dst: 810fb6cb in: 4096b (45bf72c3, bf6240c0, 6462) out: 2357b (6e052dd5)
[    4.908893] erofs: bf5f1f60 i_ino 868416, index 3 dst 810fb000 (2b4319d2)
[    4.916986] vfs_open: /usr/lib/ld-linux-armhf.so.3
[    4.923494] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c1006000 in: 4096b (e4b39a2, bf5f1f20, 1) out: 4907b (aa05f0a3)
[    4.935773] erofs: bf5f1f40 i_ino 190291, index 0 dst 810fa000 (20419a5e)
[    4.942887] erofs: (device mmcblk3p3): lz4        : src c1009000 dst: c100832b in: 4096b (717fc925, bf5f1f00, 2) out: 4246b (c0f62dca)
[    4.955958] erofs: (device mmcblk3p3): lz4        : src 82a06000 dst: c100a6cb in: 4096b (45bf72c3, bf6240c0, 6462) out: 6376b (dfcc8264)
[    4.968686] erofs: bf5f1f20 i_ino 190291, index 1 dst 810f9000 (64eb9a49)
[    4.975837] erofs: (device mmcblk3p3): lz4        : src c100d000 dst: c100c3c1 in: 4096b (8030d189, bf5f1ee0, 3) out: 4292b (1df48c5f)
[    4.989972] erofs: bf5f1f00 i_ino 190291, index 2 dst 810f8000 (7fc63af4)
[    4.997061] erofs: (device mmcblk3p3): lz4 partial: src 82a09000 dst: 810f7485 in: 4096b (17ce8f99, bf624120, 1493) out: 2939b (a1ab12cf)
[    5.009760] erofs: bf5f1ee0 i_ino 190291, index 3 dst 810f7000 (285ac58c)
[    5.018572] erofs: (device mmcblk3p3): lz4        : src c1010000 dst: c100efb3 in: 4096b (74af795c, bf5f1e60, 6) out: 4651b (46c58dd7)
[    5.030944] erofs: bf5f1ea0 i_ino 868416, index 4 dst 810f5000 (7ce0249e)
[    5.038011] erofs: bf5f1e80 i_ino 868416, index 5 dst 810f4000 (d832cf73)
[    5.045140] erofs: (device mmcblk3p3): lz4        : src c1013000 dst: c10121de in: 4096b (d65a3a49, bf5f1e40, 7) out: 5360b (4364e0fc)
[    5.057710] erofs: bf5f1e60 i_ino 868416, index 6 dst 810f3000 (aa9da9e7)
[    5.064783] erofs: (device mmcblk3p3): lz4        : src c1015000 dst: c10146ce in: 4096b (db73bb75, bf5f1e20, 8) out: 4606b (c0a54f50)
[    5.077215] erofs: bf5f1e40 i_ino 868416, index 7 dst 810f2000 (372b935)
[    5.084331] erofs: (device mmcblk3p3): lz4        : src c1017000 dst: c10168cc in: 4096b (be653c3d, bf5f1e00, 9) out: 4536b (10b3a4d0)
[    5.096680] erofs: bf5f1e20 i_ino 868416, index 8 dst 810f1000 (3ebcefe7)
[    5.103844] erofs: (device mmcblk3p3): lz4        : src c1019000 dst: c1018a84 in: 4096b (8cd3cff3, bf5f1de0, 10) out: 4285b (541c02fb)
[    5.116288] erofs: bf5f1e00 i_ino 868416, index 9 dst 810f0000 (12adb98e)
[    5.123384] erofs: (device mmcblk3p3): lz4        : src c101b000 dst: c101ab41 in: 4096b (b885e4f7, bf5f1dc0, 11) out: 4789b (af1820d3)
[    5.135910] erofs: bf5f1de0 i_ino 868416, index 10 dst 810ef000 (e8b33507)
[    5.151679] erofs: (device mmcblk3p3): lz4        : src c101e000 dst: c101cdf6 in: 4096b (3b4e9357, bf5f1d80, 13) out: 6216b (6a149c5)
[    5.164054] erofs: bf5f1dc0 i_ino 868416, index 11 dst 810ee000 (72cdfbb)
[    5.171019] erofs: bf5f1da0 i_ino 868416, index 12 dst 810ed000 (a4856fd6)
[    5.178261] erofs: (device mmcblk3p3): lz4        : src c1022000 dst: c102063e in: 4096b (a3bdbd0e, bf5f1d40, 15) out: 8015b (63d1fbc1)
[    5.190688] erofs: bf5f1d80 i_ino 868416, index 13 dst 810ec000 (d027d81e)
[    5.197815] erofs: bf5f1d60 i_ino 868416, index 14 dst 810eb000 (307b732a)
[    5.204989] erofs: (device mmcblk3p3): lz4        : src c1025000 dst: c102458d in: 4096b (480285a7, bf5f1d20, 16) out: 6603b (822f8de0)
[    5.217425] erofs: bf5f1d40 i_ino 868416, index 15 dst 810ea000 (39882425)
[    5.224569] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1026f58 in: 1839b (4f637f42, bf5f1d00, 17) out: 5780b (55fe911f)
[    5.237007] erofs: bf5f1d20 i_ino 868416, index 16 dst 810e9000 (7f303847)
[    5.244123] erofs: bf5f1d00 i_ino 868416, index 17 dst 810e8000 (7e903556)
[    5.251188] erofs: bf5f1ce0 i_ino 868416, index 18 dst 810e7000 (e3449d72)
[    5.266482] erofs: (device mmcblk3p3): lz4        : src 82a0c000 dst: c102acc6 in: 4096b (cd2f4c7c, bf624180, 1502) out: 4175b (3bf4f1a9)
[    5.279204] erofs: (device mmcblk3p3): lz4        : src c102d000 dst: c102cd15 in: 4096b (8e87c14d, bf5f1c80, 14) out: 4288b (6a251e64)
[    5.291669] erofs: bf5f1ca0 i_ino 190291, index 13 dst 810e5000 (36a0d885)
[    5.298823] erofs: (device mmcblk3p3): lz4        : src c102f000 dst: c102edd5 in: 4096b (31a2e179, bf5f1c60, 15) out: 4257b (3e19e451)
[    5.311318] erofs: bf5f1c80 i_ino 190291, index 14 dst 810e4000 (8890a118)
[    5.318495] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1030e76 in: 4096b (65fa2fbe, bf5f1c40, 16) out: 4460b (ebe0126c)
[    5.330928] erofs: bf5f1c60 i_ino 190291, index 15 dst 810e3000 (d48cbaf9)
[    5.338140] erofs: (device mmcblk3p3): lz4        : src c1034000 dst: c1032fe2 in: 4096b (37a8bad1, bf5f1c00, 18) out: 4349b (c125197)
[    5.350495] erofs: bf5f1c40 i_ino 190291, index 16 dst 810e2000 (940857ad)
[    5.357609] erofs: bf5f1c20 i_ino 190291, index 17 dst 810e1000 (bd0e7a43)
[    5.364718] erofs: (device mmcblk3p3): lz4        : src c1037000 dst: c10360df in: 4096b (8d172a42, bf5f1be0, 19) out: 4353b (1503ff28)
[    5.377148] erofs: bf5f1c00 i_ino 190291, index 18 dst 810e0000 (dec8eb5c)
[    5.384381] erofs: (device mmcblk3p3): lz4        : src c1039000 dst: c10381e0 in: 4096b (1ef07e2b, bf5f1bc0, 20) out: 4869b (c3bf758b)
[    5.396811] erofs: bf5f1be0 i_ino 190291, index 19 dst 810df000 (6e7792a7)
[    5.404048] erofs: (device mmcblk3p3): lz4        : src c103b000 dst: c103a4e5 in: 4096b (f4462dc1, bf5f1ba0, 21) out: 5484b (9b35c90f)
[    5.416471] erofs: bf5f1bc0 i_ino 190291, index 20 dst 810de000 (97b42709)
[    5.423664] erofs: (device mmcblk3p3): lz4        : src c103e000 dst: c103ca51 in: 4096b (2ac6b4d5, bf5f1b60, 23) out: 5985b (94cc0d29)
[    5.436100] erofs: bf5f1ba0 i_ino 190291, index 21 dst 810dd000 (29751a32)
[    5.443212] erofs: bf5f1b80 i_ino 190291, index 22 dst 810dc000 (eeea8a30)
[    5.450468] erofs: (device mmcblk3p3): lz4        : src c1041000 dst: c10401b2 in: 4096b (90757c3c, bf5f1b40, 24) out: 6356b (58df129b)
[    5.462902] erofs: bf5f1b60 i_ino 190291, index 23 dst 810db000 (a86b83ad)
[    5.470092] erofs: (device mmcblk3p3): lz4        : src c1044000 dst: c1042a86 in: 4096b (971b791e, bf5f1b00, 26) out: 6045b (3a6bbefa)
[    5.482526] erofs: bf5f1b40 i_ino 190291, index 24 dst 810da000 (2535a069)
[    5.489658] erofs: bf5f1b20 i_ino 190291, index 25 dst 810d9000 (98287e49)
[    5.496972] erofs: (device mmcblk3p3): lz4        : src c1048000 dst: c1046223 in: 4096b (9804bc65, bf5f1ac0, 28) out: 10510b (2a60a723)
[    5.509790] erofs: bf5f1b00 i_ino 190291, index 26 dst 810d8000 (64b12fc2)
[    5.516825] erofs: bf5f1ae0 i_ino 190291, index 27 dst 810d7000 (de4b4264)
[    5.524296] erofs: (device mmcblk3p3): lz4        : src 82a0da35 dst: c104ab31 in: 1483b (5c99618c, bf6241a0, 0) out: 4759b (b53e5caa)
[    5.540762] erofs: bf5f1ac0 i_ino 190291, index 28 dst 810d6000 (7881835d)
[    5.547904] erofs: bf5f1aa0 i_ino 190291, index 29 dst 810d5000 (80d1e247)
[    5.555492] erofs: (device mmcblk3p3): lz4        : src 82a09000 dst: c104c485 in: 4096b (17ce8f99, bf624120, 1493) out: 4289b (7dbbff69)
[    5.568341] erofs: (device mmcblk3p3): lz4 partial: src 82a0c000 dst: 810cacc6 in: 4096b (cd2f4c7c, bf624180, 1502) out: 826b (21762da4)
[    5.586697] erofs: (device mmcblk3p3): lz4        : src c104f000 dst: c104e546 in: 4096b (e286b2b, bf5f1a20, 5) out: 4207b (ec8e3f58)
[    5.599002] erofs: bf5f1a40 i_ino 190291, index 4 dst 810d2000 (63f2218c)
[    5.606110] erofs: (device mmcblk3p3): lz4        : src c1051000 dst: c10505b5 in: 4096b (e698fd35, bf5f1a00, 6) out: 4291b (fcf580f8)
[    5.618467] erofs: bf5f1a20 i_ino 190291, index 5 dst 810d1000 (d2cc83a9)
[    5.625492] erofs: (device mmcblk3p3): lz4        : src c1053000 dst: c1052678 in: 4096b (4859aa8f, bf5f19e0, 7) out: 4297b (ab8a8574)
[    5.637839] erofs: bf5f1a00 i_ino 190291, index 6 dst 810d0000 (fe13cf51)
[    5.644932] erofs: (device mmcblk3p3): lz4        : src c1055000 dst: c1054741 in: 4096b (997436a4, bf5f19c0, 8) out: 4218b (be0817b8)
[    5.657267] erofs: bf5f19e0 i_ino 190291, index 7 dst 810cf000 (a4994a5f)
[    5.664382] erofs: (device mmcblk3p3): lz4        : src c1057000 dst: c10567bb in: 4096b (112a3fda, bf5f19a0, 9) out: 4271b (293ce253)
[    5.676718] erofs: bf5f19c0 i_ino 190291, index 8 dst 810ce000 (9e8ba792)
[    5.683777] erofs: (device mmcblk3p3): lz4        : src c1059000 dst: c105886a in: 4096b (fa3410b9, bf5f1980, 10) out: 4673b (7f7a9871)
[    5.696214] erofs: bf5f19a0 i_ino 190291, index 9 dst 810cd000 (902d97fe)
[    5.703322] erofs: (device mmcblk3p3): lz4        : src c105b000 dst: c105aaab in: 4096b (634b03ca, bf5f1960, 11) out: 4477b (cf289eb)
[    5.715669] erofs: bf5f1980 i_ino 190291, index 10 dst 810cc000 (60b7ab45)
[    5.722863] erofs: (device mmcblk3p3): lz4        : src 829b3000 dst: c105cc28 in: 4096b (163cdf49, bf623660, 0) out: 4254b (998b1f98)
[    5.735217] erofs: bf5f1960 i_ino 190291, index 11 dst 810cb000 (55814486)
[    5.742263] erofs: bf5f1940 i_ino 190291, index 12 dst 810ca000 (717aa17d)
[    5.749414] 8<--- cut here ---
[    5.752564] init: unhandled page fault (11) at 0x6f842180, code 0x005
[    5.759492] [6f842180] *pgd=00000000
[    5.763255] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.12.10-00011-gaa53ac55e70a #110
[    5.771605] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    5.778371] PC is at 0x76f8dc86
[    5.781680] LR is at 0x76f942a5
[    5.784982] pc : [<76f8dc86>]    lr : [<76f942a5>]    psr: 20001430
[    5.791444] sp : 7e944e68  ip : 76fa2000  fp : 00000016
[    5.796759] r10: 76f84000  r9 : 76fa25f0  r8 : 76fa1ce0
[    5.802193] r7 : 7e944e80  r6 : 76fa2000  r5 : 00000003  r4 : 76f84148
[    5.808887] r3 : 00000008  r2 : 6f842180  r1 : 00000001  r0 : 76fa25f0
[    5.815601] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment user
[    5.823117] Control: 50c5387d  Table: 1369c04a  DAC: 00000055
[    5.829086] Call trace:
[    5.829153] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    5.839600] Dumping ftrace buffer:
[    5.843096]    (ftrace buffer empty)
[    5.865600] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

GOOD:

[    4.774379] erofs: (device mmcblk3p3): mounted with root inode @ nid 36.
[    4.781362] VFS: Mounted root (erofs filesystem) readonly on device 179:3.
[    4.788535] devtmpfs: mounted
[    4.801822] Freeing unused kernel image (initmem) memory: 1024K
[    4.808252] Run /sbin/init as init process
[    4.812524]   with arguments:
[    4.815617]     /sbin/init
[    4.818413]   with environment:
[    4.821740]     HOME=/
[    4.824196]     TERM=linux
[    4.830332] vfs_open: /usr/lib/systemd/systemd
[    4.837634] erofs: (device mmcblk3p3): lz4        : src c1002000 dst: c1000000 in: 4096b (eec708e7, bf5f1fa0, 2) out: 8859b (3bfdda11)
[    4.861987] erofs: bf5f1fe0 i_ino 868416, index 0 dst 810ff000 (7795d697)
[    4.869026] erofs: bf5f1fc0 i_ino 868416, index 1 dst 810fe000 (e09f25c3)
[    4.876096] erofs: (device mmcblk3p3): lz4        : src c1005000 dst: c100429b in: 4096b (76037b0d, bf5f1f80, 3) out: 5168b (79840434)
[    4.888448] erofs: bf5f1fa0 i_ino 868416, index 2 dst 810fd000 (88265a45)
[    4.895615] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c10066cb in: 4096b (4cac566d, bf5f1f60, 4) out: 6376b (dfcc8264)
[    4.907966] erofs: bf5f1f80 i_ino 868416, index 3 dst 810fc000 (2b4319d2)
[    4.915023] erofs: (device mmcblk3p3): lz4        : src c100a000 dst: c1008fb3 in: 4096b (74af795c, bf5f1f20, 6) out: 4651b (46c58dd7)
[    4.927474] erofs: bf5f1f60 i_ino 868416, index 4 dst 810fb000 (7ce0249e)
[    4.934451] erofs: bf5f1f40 i_ino 868416, index 5 dst 810fa000 (d832cf73)
[    4.941636] erofs: (device mmcblk3p3): lz4        : src c100d000 dst: c100c1de in: 4096b (d65a3a49, bf5f1f00, 7) out: 5360b (4364e0fc)
[    4.954065] erofs: bf5f1f20 i_ino 868416, index 6 dst 810f9000 (aa9da9e7)
[    4.961201] erofs: (device mmcblk3p3): lz4        : src c100f000 dst: c100e6ce in: 4096b (db73bb75, bf5f1ee0, 8) out: 4606b (c0a54f50)
[    4.973653] erofs: bf5f1f00 i_ino 868416, index 7 dst 810f8000 (372b935)
[    4.980751] erofs: (device mmcblk3p3): lz4        : src c1011000 dst: c10108cc in: 4096b (be653c3d, bf5f1ec0, 9) out: 4536b (10b3a4d0)
[    4.993167] erofs: bf5f1ee0 i_ino 868416, index 8 dst 810f7000 (3ebcefe7)
[    5.000337] erofs: (device mmcblk3p3): lz4        : src c1013000 dst: c1012a84 in: 4096b (8cd3cff3, bf5f1ea0, 10) out: 4285b (541c02fb)
[    5.012805] erofs: bf5f1ec0 i_ino 868416, index 9 dst 810f6000 (12adb98e)
[    5.019937] erofs: (device mmcblk3p3): lz4        : src c1015000 dst: c1014b41 in: 4096b (b885e4f7, bf5f1e80, 11) out: 4789b (af1820d3)
[    5.032473] erofs: bf5f1ea0 i_ino 868416, index 10 dst 810f5000 (e8b33507)
[    5.039713] erofs: (device mmcblk3p3): lz4        : src c1018000 dst: c1016df6 in: 4096b (3b4e9357, bf5f1e40, 13) out: 6216b (6a149c5)
[    5.052086] erofs: bf5f1e80 i_ino 868416, index 11 dst 810f4000 (72cdfbb)
[    5.059166] erofs: bf5f1e60 i_ino 868416, index 12 dst 810f3000 (a4856fd6)
[    5.066460] erofs: (device mmcblk3p3): lz4        : src c101c000 dst: c101a63e in: 4096b (a3bdbd0e, bf5f1e00, 15) out: 8015b (63d1fbc1)
[    5.078990] erofs: bf5f1e40 i_ino 868416, index 13 dst 810f2000 (d027d81e)
[    5.086070] erofs: bf5f1e20 i_ino 868416, index 14 dst 810f1000 (307b732a)
[    5.093381] erofs: (device mmcblk3p3): lz4        : src c101f000 dst: c101e58d in: 4096b (480285a7, bf5f1de0, 16) out: 6603b (822f8de0)
[    5.105920] erofs: bf5f1e00 i_ino 868416, index 15 dst 810f0000 (39882425)
[    5.113151] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1020f58 in: 1839b (4f637f42, bf5f1dc0, 17) out: 5780b (55fe911f)
[    5.125681] erofs: bf5f1de0 i_ino 868416, index 16 dst 810ef000 (7f303847)
[    5.132765] erofs: bf5f1dc0 i_ino 868416, index 17 dst 810ee000 (7e903556)
[    5.139925] erofs: bf5f1da0 i_ino 868416, index 18 dst 810ed000 (e3449d72)
[    5.147999] vfs_open: hash of /usr/lib/systemd/systemd: 0x0610c635
[    5.157814] vfs_open: /usr/lib/ld-linux-armhf.so.3
[    5.166197] erofs: (device mmcblk3p3): lz4        : src c1025000 dst: c1024000 in: 4096b (e4b39a2, bf5f1d40, 1) out: 4907b (aa05f0a3)
[    5.178510] erofs: bf5f1d60 i_ino 190291, index 0 dst 810eb000 (20419a5e)
[    5.185631] erofs: (device mmcblk3p3): lz4        : src c1027000 dst: c102632b in: 4096b (717fc925, bf5f1d20, 2) out: 4246b (c0f62dca)
[    5.197994] erofs: bf5f1d40 i_ino 190291, index 1 dst 810ea000 (64eb9a49)
[    5.205147] erofs: (device mmcblk3p3): lz4        : src c1029000 dst: c10283c1 in: 4096b (8030d189, bf5f1d00, 3) out: 4292b (1df48c5f)
[    5.217526] erofs: bf5f1d20 i_ino 190291, index 2 dst 810e9000 (7fc63af4)
[    5.224711] erofs: (device mmcblk3p3): lz4        : src c102b000 dst: c102a485 in: 4096b (4aac6f77, bf5f1ce0, 4) out: 4289b (7dbbff69)
[    5.237095] erofs: bf5f1d00 i_ino 190291, index 3 dst 810e8000 (285ac58c)
[    5.244249] erofs: (device mmcblk3p3): lz4        : src c102d000 dst: c102c546 in: 4096b (e286b2b, bf5f1cc0, 5) out: 4207b (ec8e3f58)
[    5.256495] erofs: bf5f1ce0 i_ino 190291, index 4 dst 810e7000 (63f2218c)
[    5.263664] erofs: (device mmcblk3p3): lz4        : src c102f000 dst: c102e5b5 in: 4096b (e698fd35, bf5f1ca0, 6) out: 4291b (fcf580f8)
[    5.276007] erofs: bf5f1cc0 i_ino 190291, index 5 dst 810e6000 (d2cc83a9)
[    5.283142] erofs: (device mmcblk3p3): lz4        : src c1031000 dst: c1030678 in: 4096b (4859aa8f, bf5f1c80, 7) out: 4297b (ab8a8574)
[    5.295590] erofs: bf5f1ca0 i_ino 190291, index 6 dst 810e5000 (fe13cf51)
[    5.302665] erofs: (device mmcblk3p3): lz4        : src c1033000 dst: c1032741 in: 4096b (997436a4, bf5f1c60, 8) out: 4218b (be0817b8)
[    5.315063] erofs: bf5f1c80 i_ino 190291, index 7 dst 810e4000 (a4994a5f)
[    5.322224] erofs: (device mmcblk3p3): lz4        : src c1035000 dst: c10347bb in: 4096b (112a3fda, bf5f1c40, 9) out: 4271b (293ce253)
[    5.334641] erofs: bf5f1c60 i_ino 190291, index 8 dst 810e3000 (9e8ba792)
[    5.350295] erofs: (device mmcblk3p3): lz4        : src c1037000 dst: c103686a in: 4096b (fa3410b9, bf5f1c20, 10) out: 4673b (7f7a9871)
[    5.362739] erofs: bf5f1c40 i_ino 190291, index 9 dst 810e2000 (902d97fe)
[    5.369870] erofs: (device mmcblk3p3): lz4        : src c1039000 dst: c1038aab in: 4096b (634b03ca, bf5f1c00, 11) out: 4477b (cf289eb)
[    5.382235] erofs: bf5f1c20 i_ino 190291, index 10 dst 810e1000 (60b7ab45)
[    5.389407] erofs: (device mmcblk3p3): lz4        : src c103b000 dst: c103ac28 in: 4096b (326e1ba0, bf5f1be0, 12) out: 4254b (998b1f98)
[    5.401844] erofs: bf5f1c00 i_ino 190291, index 11 dst 810e0000 (55814486)
[    5.408944] erofs: (device mmcblk3p3): lz4        : src c103d000 dst: c103ccc6 in: 4096b (3c5b4505, bf5f1bc0, 13) out: 4175b (3bf4f1a9)
[    5.421376] erofs: bf5f1be0 i_ino 190291, index 12 dst 810df000 (717aa17d)
[    5.428544] erofs: (device mmcblk3p3): lz4        : src c103f000 dst: c103ed15 in: 4096b (8e87c14d, bf5f1ba0, 14) out: 4288b (6a251e64)
[    5.441000] erofs: bf5f1bc0 i_ino 190291, index 13 dst 810de000 (36a0d885)
[    5.448220] erofs: (device mmcblk3p3): lz4        : src c1041000 dst: c1040dd5 in: 4096b (31a2e179, bf5f1b80, 15) out: 4257b (3e19e451)
[    5.460669] erofs: bf5f1ba0 i_ino 190291, index 14 dst 810dd000 (8890a118)
[    5.467837] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1042e76 in: 4096b (65fa2fbe, bf5f1b60, 16) out: 4460b (ebe0126c)
[    5.480272] erofs: bf5f1b80 i_ino 190291, index 15 dst 810dc000 (d48cbaf9)
[    5.487497] erofs: (device mmcblk3p3): lz4        : src c1046000 dst: c1044fe2 in: 4096b (37a8bad1, bf5f1b20, 18) out: 4349b (c125197)
[    5.499847] erofs: bf5f1b60 i_ino 190291, index 16 dst 810db000 (940857ad)
[    5.506993] erofs: bf5f1b40 i_ino 190291, index 17 dst 810da000 (bd0e7a43)
[    5.514145] erofs: (device mmcblk3p3): lz4        : src c1049000 dst: c10480df in: 4096b (8d172a42, bf5f1b00, 19) out: 4353b (1503ff28)
[    5.526601] erofs: bf5f1b20 i_ino 190291, index 18 dst 810d9000 (dec8eb5c)
[    5.533854] erofs: (device mmcblk3p3): lz4        : src c104b000 dst: c104a1e0 in: 4096b (1ef07e2b, bf5f1ae0, 20) out: 4869b (c3bf758b)
[    5.546298] erofs: bf5f1b00 i_ino 190291, index 19 dst 810d8000 (6e7792a7)
[    5.553561] erofs: (device mmcblk3p3): lz4        : src c104d000 dst: c104c4e5 in: 4096b (f4462dc1, bf5f1ac0, 21) out: 5484b (9b35c90f)
[    5.566001] erofs: bf5f1ae0 i_ino 190291, index 20 dst 810d7000 (97b42709)
[    5.573222] erofs: (device mmcblk3p3): lz4        : src c1050000 dst: c104ea51 in: 4096b (2ac6b4d5, bf5f1a80, 23) out: 5985b (94cc0d29)
[    5.585714] erofs: bf5f1ac0 i_ino 190291, index 21 dst 810d6000 (29751a32)
[    5.592805] erofs: bf5f1aa0 i_ino 190291, index 22 dst 810d5000 (eeea8a30)
[    5.600096] erofs: (device mmcblk3p3): lz4        : src c1053000 dst: c10521b2 in: 4096b (90757c3c, bf5f1a60, 24) out: 6356b (58df129b)
[    5.612540] erofs: bf5f1a80 i_ino 190291, index 23 dst 810d4000 (a86b83ad)
[    5.619754] erofs: (device mmcblk3p3): lz4        : src c1056000 dst: c1054a86 in: 4096b (971b791e, bf5f1a20, 26) out: 6045b (3a6bbefa)
[    5.632269] erofs: bf5f1a60 i_ino 190291, index 24 dst 810d3000 (2535a069)
[    5.639307] erofs: bf5f1a40 i_ino 190291, index 25 dst 810d2000 (98287e49)
[    5.646690] erofs: (device mmcblk3p3): lz4        : src c105a000 dst: c1058223 in: 4096b (9804bc65, bf5f19e0, 28) out: 10510b (2a60a723)
[    5.659249] erofs: bf5f1a20 i_ino 190291, index 26 dst 810d1000 (64b12fc2)
[    5.666330] erofs: bf5f1a00 i_ino 190291, index 27 dst 810d0000 (de4b4264)
[    5.673557] erofs: (device mmcblk3p3): lz4        : src 829bfa35 dst: c105cb31 in: 1483b (5c99618c, bf6237e0, 0) out: 4759b (b53e5caa)
[    5.685912] erofs: bf5f19e0 i_ino 190291, index 28 dst 810cf000 (7881835d)
[    5.693076] erofs: bf5f19c0 i_ino 190291, index 29 dst 810ce000 (80d1e247)
[    5.701807] vfs_open: hash of /usr/lib/ld-linux-armhf.so.3: 0xf1fe4854


Cheers,
Stefan

-- 
Pengutronix e.K.                       | Stefan Kerkmann             |
Steuerwalder Str. 21                   | https://www.pengutronix.de/ |
31137 Hildesheim, Germany              | Phone: +49-5121-206917-128  |
Amtsgericht Hildesheim, HRA 2686       | Fax:   +49-5121-206917-9    |


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2025-01-19 12:07   ` Stefan Kerkmann
@ 2025-01-19 12:48     ` Gao Xiang
  2025-01-20  1:45     ` Gao Xiang
  1 sibling, 0 replies; 11+ messages in thread
From: Gao Xiang @ 2025-01-19 12:48 UTC (permalink / raw)
  To: Stefan Kerkmann, linux-erofs



On 2025/1/19 20:07, Stefan Kerkmann wrote:
> Hi Gao,
> 
> Sorry again that it took me so long to respond properly.

Thanks! Let's me look into that first..

Thanks,
Gao Xiang


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2025-01-19 12:07   ` Stefan Kerkmann
  2025-01-19 12:48     ` Gao Xiang
@ 2025-01-20  1:45     ` Gao Xiang
  2025-01-20  1:55       ` Gao Xiang
  1 sibling, 1 reply; 11+ messages in thread
From: Gao Xiang @ 2025-01-20  1:45 UTC (permalink / raw)
  To: Stefan Kerkmann, linux-erofs

Hi Stefan,

On 2025/1/19 20:07, Stefan Kerkmann wrote:

...

> 
> Here is the new output:
> 
> BAD:
> 
> [    4.775107] erofs: (device mmcblk3p3): mounted with root inode @ nid 36.
> [    4.782154] VFS: Mounted root (erofs filesystem) readonly on device 179:3.
> [    4.789277] devtmpfs: mounted
> [    4.802482] Freeing unused kernel image (initmem) memory: 1024K
> [    4.809163] Run /sbin/init as init process
> [    4.813358]   with arguments:
> [    4.816516]     /sbin/init
> [    4.819387]   with environment:
> [    4.822621]     HOME=/
> [    4.825068]     TERM=linux
> [    4.836923] vfs_open: /usr/lib/systemd/systemd
> [    4.843463] erofs: (device mmcblk3p3): lz4        : src c1002000 dst: c1000000 in: 4096b (eec708e7, bf5f1f80, 2) out: 8859b (3bfdda11)
> [    4.855839] erofs: bf5f1fc0 i_ino 868416, index 0 dst 810fe000 (7795d697)
> [    4.862916] erofs: bf5f1fa0 i_ino 868416, index 1 dst 810fd000 (e09f25c3)
> [    4.876706] erofs: (device mmcblk3p3): lz4        : src c1005000 dst: c100429b in: 4096b (76037b0d, bf5f1f60, 3) out: 5168b (79840434)
> [    4.889190] erofs: bf5f1f80 i_ino 868416, index 2 dst 810fc000 (88265a45)
> [    4.896188] erofs: (device mmcblk3p3): lz4 partial: src 82a06000 dst: 810fb6cb in: 4096b (45bf72c3, bf6240c0, 6462) out: 2357b (6e052dd5)
> [    4.908893] erofs: bf5f1f60 i_ino 868416, index 3 dst 810fb000 (2b4319d2)
> [    4.916986] vfs_open: /usr/lib/ld-linux-armhf.so.3
> [    4.923494] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c1006000 in: 4096b (e4b39a2, bf5f1f20, 1) out: 4907b (aa05f0a3)
> [    4.935773] erofs: bf5f1f40 i_ino 190291, index 0 dst 810fa000 (20419a5e)
> [    4.942887] erofs: (device mmcblk3p3): lz4        : src c1009000 dst: c100832b in: 4096b (717fc925, bf5f1f00, 2) out: 4246b (c0f62dca)
> [    4.955958] erofs: (device mmcblk3p3): lz4        : src 82a06000 dst: c100a6cb in: 4096b (45bf72c3, bf6240c0, 6462) out: 6376b (dfcc8264)
> [    4.968686] erofs: bf5f1f20 i_ino 190291, index 1 dst 810f9000 (64eb9a49)
> [    4.975837] erofs: (device mmcblk3p3): lz4        : src c100d000 dst: c100c3c1 in: 4096b (8030d189, bf5f1ee0, 3) out: 4292b (1df48c5f)
> [    4.989972] erofs: bf5f1f00 i_ino 190291, index 2 dst 810f8000 (7fc63af4)
> [    4.997061] erofs: (device mmcblk3p3): lz4 partial: src 82a09000 dst: 810f7485 in: 4096b (17ce8f99, bf624120, 1493) out: 2939b (a1ab12cf)
> [    5.009760] erofs: bf5f1ee0 i_ino 190291, index 3 dst 810f7000 (285ac58c)
> [    5.018572] erofs: (device mmcblk3p3): lz4        : src c1010000 dst: c100efb3 in: 4096b (74af795c, bf5f1e60, 6) out: 4651b (46c58dd7)
> [    5.030944] erofs: bf5f1ea0 i_ino 868416, index 4 dst 810f5000 (7ce0249e)
> [    5.038011] erofs: bf5f1e80 i_ino 868416, index 5 dst 810f4000 (d832cf73)
> [    5.045140] erofs: (device mmcblk3p3): lz4        : src c1013000 dst: c10121de in: 4096b (d65a3a49, bf5f1e40, 7) out: 5360b (4364e0fc)
> [    5.057710] erofs: bf5f1e60 i_ino 868416, index 6 dst 810f3000 (aa9da9e7)
> [    5.064783] erofs: (device mmcblk3p3): lz4        : src c1015000 dst: c10146ce in: 4096b (db73bb75, bf5f1e20, 8) out: 4606b (c0a54f50)
> [    5.077215] erofs: bf5f1e40 i_ino 868416, index 7 dst 810f2000 (372b935)
> [    5.084331] erofs: (device mmcblk3p3): lz4        : src c1017000 dst: c10168cc in: 4096b (be653c3d, bf5f1e00, 9) out: 4536b (10b3a4d0)
> [    5.096680] erofs: bf5f1e20 i_ino 868416, index 8 dst 810f1000 (3ebcefe7)
> [    5.103844] erofs: (device mmcblk3p3): lz4        : src c1019000 dst: c1018a84 in: 4096b (8cd3cff3, bf5f1de0, 10) out: 4285b (541c02fb)
> [    5.116288] erofs: bf5f1e00 i_ino 868416, index 9 dst 810f0000 (12adb98e)
> [    5.123384] erofs: (device mmcblk3p3): lz4        : src c101b000 dst: c101ab41 in: 4096b (b885e4f7, bf5f1dc0, 11) out: 4789b (af1820d3)
> [    5.135910] erofs: bf5f1de0 i_ino 868416, index 10 dst 810ef000 (e8b33507)
> [    5.151679] erofs: (device mmcblk3p3): lz4        : src c101e000 dst: c101cdf6 in: 4096b (3b4e9357, bf5f1d80, 13) out: 6216b (6a149c5)
> [    5.164054] erofs: bf5f1dc0 i_ino 868416, index 11 dst 810ee000 (72cdfbb)
> [    5.171019] erofs: bf5f1da0 i_ino 868416, index 12 dst 810ed000 (a4856fd6)
> [    5.178261] erofs: (device mmcblk3p3): lz4        : src c1022000 dst: c102063e in: 4096b (a3bdbd0e, bf5f1d40, 15) out: 8015b (63d1fbc1)
> [    5.190688] erofs: bf5f1d80 i_ino 868416, index 13 dst 810ec000 (d027d81e)
> [    5.197815] erofs: bf5f1d60 i_ino 868416, index 14 dst 810eb000 (307b732a)
> [    5.204989] erofs: (device mmcblk3p3): lz4        : src c1025000 dst: c102458d in: 4096b (480285a7, bf5f1d20, 16) out: 6603b (822f8de0)
> [    5.217425] erofs: bf5f1d40 i_ino 868416, index 15 dst 810ea000 (39882425)
> [    5.224569] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1026f58 in: 1839b (4f637f42, bf5f1d00, 17) out: 5780b (55fe911f)
> [    5.237007] erofs: bf5f1d20 i_ino 868416, index 16 dst 810e9000 (7f303847)
> [    5.244123] erofs: bf5f1d00 i_ino 868416, index 17 dst 810e8000 (7e903556)
> [    5.251188] erofs: bf5f1ce0 i_ino 868416, index 18 dst 810e7000 (e3449d72)
> [    5.266482] erofs: (device mmcblk3p3): lz4        : src 82a0c000 dst: c102acc6 in: 4096b (cd2f4c7c, bf624180, 1502) out: 4175b (3bf4f1a9)
> [    5.279204] erofs: (device mmcblk3p3): lz4        : src c102d000 dst: c102cd15 in: 4096b (8e87c14d, bf5f1c80, 14) out: 4288b (6a251e64)
> [    5.291669] erofs: bf5f1ca0 i_ino 190291, index 13 dst 810e5000 (36a0d885)
> [    5.298823] erofs: (device mmcblk3p3): lz4        : src c102f000 dst: c102edd5 in: 4096b (31a2e179, bf5f1c60, 15) out: 4257b (3e19e451)
> [    5.311318] erofs: bf5f1c80 i_ino 190291, index 14 dst 810e4000 (8890a118)
> [    5.318495] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1030e76 in: 4096b (65fa2fbe, bf5f1c40, 16) out: 4460b (ebe0126c)
> [    5.330928] erofs: bf5f1c60 i_ino 190291, index 15 dst 810e3000 (d48cbaf9)
> [    5.338140] erofs: (device mmcblk3p3): lz4        : src c1034000 dst: c1032fe2 in: 4096b (37a8bad1, bf5f1c00, 18) out: 4349b (c125197)
> [    5.350495] erofs: bf5f1c40 i_ino 190291, index 16 dst 810e2000 (940857ad)
> [    5.357609] erofs: bf5f1c20 i_ino 190291, index 17 dst 810e1000 (bd0e7a43)
> [    5.364718] erofs: (device mmcblk3p3): lz4        : src c1037000 dst: c10360df in: 4096b (8d172a42, bf5f1be0, 19) out: 4353b (1503ff28)
> [    5.377148] erofs: bf5f1c00 i_ino 190291, index 18 dst 810e0000 (dec8eb5c)
> [    5.384381] erofs: (device mmcblk3p3): lz4        : src c1039000 dst: c10381e0 in: 4096b (1ef07e2b, bf5f1bc0, 20) out: 4869b (c3bf758b)
> [    5.396811] erofs: bf5f1be0 i_ino 190291, index 19 dst 810df000 (6e7792a7)
> [    5.404048] erofs: (device mmcblk3p3): lz4        : src c103b000 dst: c103a4e5 in: 4096b (f4462dc1, bf5f1ba0, 21) out: 5484b (9b35c90f)
> [    5.416471] erofs: bf5f1bc0 i_ino 190291, index 20 dst 810de000 (97b42709)
> [    5.423664] erofs: (device mmcblk3p3): lz4        : src c103e000 dst: c103ca51 in: 4096b (2ac6b4d5, bf5f1b60, 23) out: 5985b (94cc0d29)
> [    5.436100] erofs: bf5f1ba0 i_ino 190291, index 21 dst 810dd000 (29751a32)
> [    5.443212] erofs: bf5f1b80 i_ino 190291, index 22 dst 810dc000 (eeea8a30)
> [    5.450468] erofs: (device mmcblk3p3): lz4        : src c1041000 dst: c10401b2 in: 4096b (90757c3c, bf5f1b40, 24) out: 6356b (58df129b)
> [    5.462902] erofs: bf5f1b60 i_ino 190291, index 23 dst 810db000 (a86b83ad)
> [    5.470092] erofs: (device mmcblk3p3): lz4        : src c1044000 dst: c1042a86 in: 4096b (971b791e, bf5f1b00, 26) out: 6045b (3a6bbefa)
> [    5.482526] erofs: bf5f1b40 i_ino 190291, index 24 dst 810da000 (2535a069)
> [    5.489658] erofs: bf5f1b20 i_ino 190291, index 25 dst 810d9000 (98287e49)
> [    5.496972] erofs: (device mmcblk3p3): lz4        : src c1048000 dst: c1046223 in: 4096b (9804bc65, bf5f1ac0, 28) out: 10510b (2a60a723)
> [    5.509790] erofs: bf5f1b00 i_ino 190291, index 26 dst 810d8000 (64b12fc2)
> [    5.516825] erofs: bf5f1ae0 i_ino 190291, index 27 dst 810d7000 (de4b4264)
> [    5.524296] erofs: (device mmcblk3p3): lz4        : src 82a0da35 dst: c104ab31 in: 1483b (5c99618c, bf6241a0, 0) out: 4759b (b53e5caa)
> [    5.540762] erofs: bf5f1ac0 i_ino 190291, index 28 dst 810d6000 (7881835d)
> [    5.547904] erofs: bf5f1aa0 i_ino 190291, index 29 dst 810d5000 (80d1e247)
> [    5.555492] erofs: (device mmcblk3p3): lz4        : src 82a09000 dst: c104c485 in: 4096b (17ce8f99, bf624120, 1493) out: 4289b (7dbbff69)
> [    5.568341] erofs: (device mmcblk3p3): lz4 partial: src 82a0c000 dst: 810cacc6 in: 4096b (cd2f4c7c, bf624180, 1502) out: 826b (21762da4)
> [    5.586697] erofs: (device mmcblk3p3): lz4        : src c104f000 dst: c104e546 in: 4096b (e286b2b, bf5f1a20, 5) out: 4207b (ec8e3f58)
> [    5.599002] erofs: bf5f1a40 i_ino 190291, index 4 dst 810d2000 (63f2218c)
> [    5.606110] erofs: (device mmcblk3p3): lz4        : src c1051000 dst: c10505b5 in: 4096b (e698fd35, bf5f1a00, 6) out: 4291b (fcf580f8)
> [    5.618467] erofs: bf5f1a20 i_ino 190291, index 5 dst 810d1000 (d2cc83a9)
> [    5.625492] erofs: (device mmcblk3p3): lz4        : src c1053000 dst: c1052678 in: 4096b (4859aa8f, bf5f19e0, 7) out: 4297b (ab8a8574)
> [    5.637839] erofs: bf5f1a00 i_ino 190291, index 6 dst 810d0000 (fe13cf51)
> [    5.644932] erofs: (device mmcblk3p3): lz4        : src c1055000 dst: c1054741 in: 4096b (997436a4, bf5f19c0, 8) out: 4218b (be0817b8)
> [    5.657267] erofs: bf5f19e0 i_ino 190291, index 7 dst 810cf000 (a4994a5f)
> [    5.664382] erofs: (device mmcblk3p3): lz4        : src c1057000 dst: c10567bb in: 4096b (112a3fda, bf5f19a0, 9) out: 4271b (293ce253)
> [    5.676718] erofs: bf5f19c0 i_ino 190291, index 8 dst 810ce000 (9e8ba792)
> [    5.683777] erofs: (device mmcblk3p3): lz4        : src c1059000 dst: c105886a in: 4096b (fa3410b9, bf5f1980, 10) out: 4673b (7f7a9871)
> [    5.696214] erofs: bf5f19a0 i_ino 190291, index 9 dst 810cd000 (902d97fe)
> [    5.703322] erofs: (device mmcblk3p3): lz4        : src c105b000 dst: c105aaab in: 4096b (634b03ca, bf5f1960, 11) out: 4477b (cf289eb)
> [    5.715669] erofs: bf5f1980 i_ino 190291, index 10 dst 810cc000 (60b7ab45)
> [    5.722863] erofs: (device mmcblk3p3): lz4        : src 829b3000 dst: c105cc28 in: 4096b (163cdf49, bf623660, 0) out: 4254b (998b1f98)
> [    5.735217] erofs: bf5f1960 i_ino 190291, index 11 dst 810cb000 (55814486)
> [    5.742263] erofs: bf5f1940 i_ino 190291, index 12 dst 810ca000 (717aa17d)
> [    5.749414] 8<--- cut here ---
> [    5.752564] init: unhandled page fault (11) at 0x6f842180, code 0x005
> [    5.759492] [6f842180] *pgd=00000000
> [    5.763255] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.12.10-00011-gaa53ac55e70a #110
> [    5.771605] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [    5.778371] PC is at 0x76f8dc86
> [    5.781680] LR is at 0x76f942a5
> [    5.784982] pc : [<76f8dc86>]    lr : [<76f942a5>]    psr: 20001430
> [    5.791444] sp : 7e944e68  ip : 76fa2000  fp : 00000016
> [    5.796759] r10: 76f84000  r9 : 76fa25f0  r8 : 76fa1ce0
> [    5.802193] r7 : 7e944e80  r6 : 76fa2000  r5 : 00000003  r4 : 76f84148
> [    5.808887] r3 : 00000008  r2 : 6f842180  r1 : 00000001  r0 : 76fa25f0
> [    5.815601] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment user
> [    5.823117] Control: 50c5387d  Table: 1369c04a  DAC: 00000055
> [    5.829086] Call trace:
> [    5.829153] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> [    5.839600] Dumping ftrace buffer:
> [    5.843096]    (ftrace buffer empty)
> [    5.865600] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---
> 
> GOOD:
> 
> [    4.774379] erofs: (device mmcblk3p3): mounted with root inode @ nid 36.
> [    4.781362] VFS: Mounted root (erofs filesystem) readonly on device 179:3.
> [    4.788535] devtmpfs: mounted
> [    4.801822] Freeing unused kernel image (initmem) memory: 1024K
> [    4.808252] Run /sbin/init as init process
> [    4.812524]   with arguments:
> [    4.815617]     /sbin/init
> [    4.818413]   with environment:
> [    4.821740]     HOME=/
> [    4.824196]     TERM=linux
> [    4.830332] vfs_open: /usr/lib/systemd/systemd
> [    4.837634] erofs: (device mmcblk3p3): lz4        : src c1002000 dst: c1000000 in: 4096b (eec708e7, bf5f1fa0, 2) out: 8859b (3bfdda11)
> [    4.861987] erofs: bf5f1fe0 i_ino 868416, index 0 dst 810ff000 (7795d697)
> [    4.869026] erofs: bf5f1fc0 i_ino 868416, index 1 dst 810fe000 (e09f25c3)
> [    4.876096] erofs: (device mmcblk3p3): lz4        : src c1005000 dst: c100429b in: 4096b (76037b0d, bf5f1f80, 3) out: 5168b (79840434)
> [    4.888448] erofs: bf5f1fa0 i_ino 868416, index 2 dst 810fd000 (88265a45)
> [    4.895615] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c10066cb in: 4096b (4cac566d, bf5f1f60, 4) out: 6376b (dfcc8264)
> [    4.907966] erofs: bf5f1f80 i_ino 868416, index 3 dst 810fc000 (2b4319d2)
> [    4.915023] erofs: (device mmcblk3p3): lz4        : src c100a000 dst: c1008fb3 in: 4096b (74af795c, bf5f1f20, 6) out: 4651b (46c58dd7)
> [    4.927474] erofs: bf5f1f60 i_ino 868416, index 4 dst 810fb000 (7ce0249e)
> [    4.934451] erofs: bf5f1f40 i_ino 868416, index 5 dst 810fa000 (d832cf73)
> [    4.941636] erofs: (device mmcblk3p3): lz4        : src c100d000 dst: c100c1de in: 4096b (d65a3a49, bf5f1f00, 7) out: 5360b (4364e0fc)
> [    4.954065] erofs: bf5f1f20 i_ino 868416, index 6 dst 810f9000 (aa9da9e7)
> [    4.961201] erofs: (device mmcblk3p3): lz4        : src c100f000 dst: c100e6ce in: 4096b (db73bb75, bf5f1ee0, 8) out: 4606b (c0a54f50)
> [    4.973653] erofs: bf5f1f00 i_ino 868416, index 7 dst 810f8000 (372b935)
> [    4.980751] erofs: (device mmcblk3p3): lz4        : src c1011000 dst: c10108cc in: 4096b (be653c3d, bf5f1ec0, 9) out: 4536b (10b3a4d0)
> [    4.993167] erofs: bf5f1ee0 i_ino 868416, index 8 dst 810f7000 (3ebcefe7)
> [    5.000337] erofs: (device mmcblk3p3): lz4        : src c1013000 dst: c1012a84 in: 4096b (8cd3cff3, bf5f1ea0, 10) out: 4285b (541c02fb)
> [    5.012805] erofs: bf5f1ec0 i_ino 868416, index 9 dst 810f6000 (12adb98e)
> [    5.019937] erofs: (device mmcblk3p3): lz4        : src c1015000 dst: c1014b41 in: 4096b (b885e4f7, bf5f1e80, 11) out: 4789b (af1820d3)
> [    5.032473] erofs: bf5f1ea0 i_ino 868416, index 10 dst 810f5000 (e8b33507)
> [    5.039713] erofs: (device mmcblk3p3): lz4        : src c1018000 dst: c1016df6 in: 4096b (3b4e9357, bf5f1e40, 13) out: 6216b (6a149c5)
> [    5.052086] erofs: bf5f1e80 i_ino 868416, index 11 dst 810f4000 (72cdfbb)
> [    5.059166] erofs: bf5f1e60 i_ino 868416, index 12 dst 810f3000 (a4856fd6)
> [    5.066460] erofs: (device mmcblk3p3): lz4        : src c101c000 dst: c101a63e in: 4096b (a3bdbd0e, bf5f1e00, 15) out: 8015b (63d1fbc1)
> [    5.078990] erofs: bf5f1e40 i_ino 868416, index 13 dst 810f2000 (d027d81e)
> [    5.086070] erofs: bf5f1e20 i_ino 868416, index 14 dst 810f1000 (307b732a)
> [    5.093381] erofs: (device mmcblk3p3): lz4        : src c101f000 dst: c101e58d in: 4096b (480285a7, bf5f1de0, 16) out: 6603b (822f8de0)
> [    5.105920] erofs: bf5f1e00 i_ino 868416, index 15 dst 810f0000 (39882425)
> [    5.113151] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1020f58 in: 1839b (4f637f42, bf5f1dc0, 17) out: 5780b (55fe911f)
> [    5.125681] erofs: bf5f1de0 i_ino 868416, index 16 dst 810ef000 (7f303847)
> [    5.132765] erofs: bf5f1dc0 i_ino 868416, index 17 dst 810ee000 (7e903556)
> [    5.139925] erofs: bf5f1da0 i_ino 868416, index 18 dst 810ed000 (e3449d72)
> [    5.147999] vfs_open: hash of /usr/lib/systemd/systemd: 0x0610c635
> [    5.157814] vfs_open: /usr/lib/ld-linux-armhf.so.3
> [    5.166197] erofs: (device mmcblk3p3): lz4        : src c1025000 dst: c1024000 in: 4096b (e4b39a2, bf5f1d40, 1) out: 4907b (aa05f0a3)
> [    5.178510] erofs: bf5f1d60 i_ino 190291, index 0 dst 810eb000 (20419a5e)
> [    5.185631] erofs: (device mmcblk3p3): lz4        : src c1027000 dst: c102632b in: 4096b (717fc925, bf5f1d20, 2) out: 4246b (c0f62dca)
> [    5.197994] erofs: bf5f1d40 i_ino 190291, index 1 dst 810ea000 (64eb9a49)
> [    5.205147] erofs: (device mmcblk3p3): lz4        : src c1029000 dst: c10283c1 in: 4096b (8030d189, bf5f1d00, 3) out: 4292b (1df48c5f)
> [    5.217526] erofs: bf5f1d20 i_ino 190291, index 2 dst 810e9000 (7fc63af4)
> [    5.224711] erofs: (device mmcblk3p3): lz4        : src c102b000 dst: c102a485 in: 4096b (4aac6f77, bf5f1ce0, 4) out: 4289b (7dbbff69)
> [    5.237095] erofs: bf5f1d00 i_ino 190291, index 3 dst 810e8000 (285ac58c)
> [    5.244249] erofs: (device mmcblk3p3): lz4        : src c102d000 dst: c102c546 in: 4096b (e286b2b, bf5f1cc0, 5) out: 4207b (ec8e3f58)
> [    5.256495] erofs: bf5f1ce0 i_ino 190291, index 4 dst 810e7000 (63f2218c)
> [    5.263664] erofs: (device mmcblk3p3): lz4        : src c102f000 dst: c102e5b5 in: 4096b (e698fd35, bf5f1ca0, 6) out: 4291b (fcf580f8)
> [    5.276007] erofs: bf5f1cc0 i_ino 190291, index 5 dst 810e6000 (d2cc83a9)
> [    5.283142] erofs: (device mmcblk3p3): lz4        : src c1031000 dst: c1030678 in: 4096b (4859aa8f, bf5f1c80, 7) out: 4297b (ab8a8574)
> [    5.295590] erofs: bf5f1ca0 i_ino 190291, index 6 dst 810e5000 (fe13cf51)
> [    5.302665] erofs: (device mmcblk3p3): lz4        : src c1033000 dst: c1032741 in: 4096b (997436a4, bf5f1c60, 8) out: 4218b (be0817b8)
> [    5.315063] erofs: bf5f1c80 i_ino 190291, index 7 dst 810e4000 (a4994a5f)
> [    5.322224] erofs: (device mmcblk3p3): lz4        : src c1035000 dst: c10347bb in: 4096b (112a3fda, bf5f1c40, 9) out: 4271b (293ce253)
> [    5.334641] erofs: bf5f1c60 i_ino 190291, index 8 dst 810e3000 (9e8ba792)
> [    5.350295] erofs: (device mmcblk3p3): lz4        : src c1037000 dst: c103686a in: 4096b (fa3410b9, bf5f1c20, 10) out: 4673b (7f7a9871)
> [    5.362739] erofs: bf5f1c40 i_ino 190291, index 9 dst 810e2000 (902d97fe)
> [    5.369870] erofs: (device mmcblk3p3): lz4        : src c1039000 dst: c1038aab in: 4096b (634b03ca, bf5f1c00, 11) out: 4477b (cf289eb)
> [    5.382235] erofs: bf5f1c20 i_ino 190291, index 10 dst 810e1000 (60b7ab45)
> [    5.389407] erofs: (device mmcblk3p3): lz4        : src c103b000 dst: c103ac28 in: 4096b (326e1ba0, bf5f1be0, 12) out: 4254b (998b1f98)
> [    5.401844] erofs: bf5f1c00 i_ino 190291, index 11 dst 810e0000 (55814486)
> [    5.408944] erofs: (device mmcblk3p3): lz4        : src c103d000 dst: c103ccc6 in: 4096b (3c5b4505, bf5f1bc0, 13) out: 4175b (3bf4f1a9)
> [    5.421376] erofs: bf5f1be0 i_ino 190291, index 12 dst 810df000 (717aa17d)
> [    5.428544] erofs: (device mmcblk3p3): lz4        : src c103f000 dst: c103ed15 in: 4096b (8e87c14d, bf5f1ba0, 14) out: 4288b (6a251e64)
> [    5.441000] erofs: bf5f1bc0 i_ino 190291, index 13 dst 810de000 (36a0d885)
> [    5.448220] erofs: (device mmcblk3p3): lz4        : src c1041000 dst: c1040dd5 in: 4096b (31a2e179, bf5f1b80, 15) out: 4257b (3e19e451)
> [    5.460669] erofs: bf5f1ba0 i_ino 190291, index 14 dst 810dd000 (8890a118)
> [    5.467837] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1042e76 in: 4096b (65fa2fbe, bf5f1b60, 16) out: 4460b (ebe0126c)
> [    5.480272] erofs: bf5f1b80 i_ino 190291, index 15 dst 810dc000 (d48cbaf9)
> [    5.487497] erofs: (device mmcblk3p3): lz4        : src c1046000 dst: c1044fe2 in: 4096b (37a8bad1, bf5f1b20, 18) out: 4349b (c125197)
> [    5.499847] erofs: bf5f1b60 i_ino 190291, index 16 dst 810db000 (940857ad)
> [    5.506993] erofs: bf5f1b40 i_ino 190291, index 17 dst 810da000 (bd0e7a43)
> [    5.514145] erofs: (device mmcblk3p3): lz4        : src c1049000 dst: c10480df in: 4096b (8d172a42, bf5f1b00, 19) out: 4353b (1503ff28)
> [    5.526601] erofs: bf5f1b20 i_ino 190291, index 18 dst 810d9000 (dec8eb5c)
> [    5.533854] erofs: (device mmcblk3p3): lz4        : src c104b000 dst: c104a1e0 in: 4096b (1ef07e2b, bf5f1ae0, 20) out: 4869b (c3bf758b)
> [    5.546298] erofs: bf5f1b00 i_ino 190291, index 19 dst 810d8000 (6e7792a7)
> [    5.553561] erofs: (device mmcblk3p3): lz4        : src c104d000 dst: c104c4e5 in: 4096b (f4462dc1, bf5f1ac0, 21) out: 5484b (9b35c90f)
> [    5.566001] erofs: bf5f1ae0 i_ino 190291, index 20 dst 810d7000 (97b42709)
> [    5.573222] erofs: (device mmcblk3p3): lz4        : src c1050000 dst: c104ea51 in: 4096b (2ac6b4d5, bf5f1a80, 23) out: 5985b (94cc0d29)
> [    5.585714] erofs: bf5f1ac0 i_ino 190291, index 21 dst 810d6000 (29751a32)
> [    5.592805] erofs: bf5f1aa0 i_ino 190291, index 22 dst 810d5000 (eeea8a30)
> [    5.600096] erofs: (device mmcblk3p3): lz4        : src c1053000 dst: c10521b2 in: 4096b (90757c3c, bf5f1a60, 24) out: 6356b (58df129b)
> [    5.612540] erofs: bf5f1a80 i_ino 190291, index 23 dst 810d4000 (a86b83ad)
> [    5.619754] erofs: (device mmcblk3p3): lz4        : src c1056000 dst: c1054a86 in: 4096b (971b791e, bf5f1a20, 26) out: 6045b (3a6bbefa)
> [    5.632269] erofs: bf5f1a60 i_ino 190291, index 24 dst 810d3000 (2535a069)
> [    5.639307] erofs: bf5f1a40 i_ino 190291, index 25 dst 810d2000 (98287e49)
> [    5.646690] erofs: (device mmcblk3p3): lz4        : src c105a000 dst: c1058223 in: 4096b (9804bc65, bf5f19e0, 28) out: 10510b (2a60a723)
> [    5.659249] erofs: bf5f1a20 i_ino 190291, index 26 dst 810d1000 (64b12fc2)
> [    5.666330] erofs: bf5f1a00 i_ino 190291, index 27 dst 810d0000 (de4b4264)
> [    5.673557] erofs: (device mmcblk3p3): lz4        : src 829bfa35 dst: c105cb31 in: 1483b (5c99618c, bf6237e0, 0) out: 4759b (b53e5caa)
> [    5.685912] erofs: bf5f19e0 i_ino 190291, index 28 dst 810cf000 (7881835d)
> [    5.693076] erofs: bf5f19c0 i_ino 190291, index 29 dst 810ce000 (80d1e247)
> [    5.701807] vfs_open: hash of /usr/lib/ld-linux-armhf.so.3: 0xf1fe4854

After I picked "erofs: ... i_ino ...., index ...." lines out, sort them,
and use`sed -e 's/.*(\([0-9a-f]*\))$/\1/'` to parse the sorted items of
BAD and GOOD cases,

I found each decompressed page cache page (which will be visible to
the userspace) is the same, so I'm very confused why it could happen.

  - Could we get the exact file offset of `init` which init process is
    crashed?  It will help us to chase down the the primary scene.

  - Also I wonder if it exists some memory overflow issues, could you
    enable KASAN or something to find out more?

On my side, I will try to use your rootfs to find more evidence, but
from the debugging outputs, I have more clues since the decompressed
data looks correct for the BAD cases too...

Thanks,
Gao Xiang

> 
> 
> Cheers,
> Stefan
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2025-01-20  1:45     ` Gao Xiang
@ 2025-01-20  1:55       ` Gao Xiang
  2025-01-20 17:36         ` Stefan Kerkmann
  0 siblings, 1 reply; 11+ messages in thread
From: Gao Xiang @ 2025-01-20  1:55 UTC (permalink / raw)
  To: Stefan Kerkmann, linux-erofs



On 2025/1/20 09:45, Gao Xiang wrote:

...

> 
> After I picked "erofs: ... i_ino ...., index ...." lines out, sort them,
> and use`sed -e 's/.*(\([0-9a-f]*\))$/\1/'` to parse the sorted items of
> BAD and GOOD cases,
> 
> I found each decompressed page cache page (which will be visible to
> the userspace) is the same, so I'm very confused why it could happen.
> 

     - First of all, could you also confirm the output if the following
       patch is applied:

diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index 0cd6b5c4df98..3c2cff623016 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -264,6 +264,11 @@ void erofs_onlinefolio_end(struct folio *folio, int err)
         if (v & ~EROFS_ONLINEFOLIO_EIO)
                 return;
         folio->private = 0;
+       ptr = kmap_local_folio(folio, 0);
+       hash = fnv_32_buf(ptr, PAGE_SIZE, FNV1_32_INIT);
+       erofs_info(NULL, "%px i_ino %lu, index %lu dst %px (%x) err %d",
+                  folio, folio->mapping->host->i_ino, folio->index, ptr, hash,
+                  v & EROFS_ONLINEFOLIO_EIO);
         folio_end_read(folio, !(v & EROFS_ONLINEFOLIO_EIO));
  }

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index aff09f94afb2..39d857acd3d0 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1847,7 +1847,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio)

         /* if some pclusters are ready, need submit them anyway */
         err = z_erofs_runqueue(&f, 0) ?: err;
-       if (err && err != -EINTR)
+       if (err)
                 erofs_err(inode->i_sb, "read error %d @ %lu of nid %llu",
                           err, folio->index, EROFS_I(inode)->nid);

I'd like to know if some error is returned (especially EINTR) to
user space which could cause something...

Thanks,
Gao Xiang


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2025-01-20  1:55       ` Gao Xiang
@ 2025-01-20 17:36         ` Stefan Kerkmann
  2025-01-21  3:27           ` Gao Xiang
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Kerkmann @ 2025-01-20 17:36 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs

Hi Gao,

I have enabled KASAN and applied your requested changes, but nothing suspicious happened.

> - Could we get the exact file offset of `init` which init process is
>   crashed?  It will help us to chase down the the primary scene. 

I'll try to track that down. If you have any hints how to-do that let me know :-).

On 20.01.25 02:55, Gao Xiang wrote:
> 
> 
> On 2025/1/20 09:45, Gao Xiang wrote:
> 
> ...
> 
>>
>> After I picked "erofs: ... i_ino ...., index ...." lines out, sort them,
>> and use`sed -e 's/.*(\([0-9a-f]*\))$/\1/'` to parse the sorted items of
>> BAD and GOOD cases,
>>
>> I found each decompressed page cache page (which will be visible to
>> the userspace) is the same, so I'm very confused why it could happen.
>>
> 
>     - First of all, could you also confirm the output if the following
>       patch is applied:
> 
> diff --git a/fs/erofs/data.c b/fs/erofs/data.c
> index 0cd6b5c4df98..3c2cff623016 100644
> --- a/fs/erofs/data.c
> +++ b/fs/erofs/data.c
> @@ -264,6 +264,11 @@ void erofs_onlinefolio_end(struct folio *folio, int err)
>         if (v & ~EROFS_ONLINEFOLIO_EIO)
>                 return;
>         folio->private = 0;
> +       ptr = kmap_local_folio(folio, 0);
> +       hash = fnv_32_buf(ptr, PAGE_SIZE, FNV1_32_INIT);
> +       erofs_info(NULL, "%px i_ino %lu, index %lu dst %px (%x) err %d",
> +                  folio, folio->mapping->host->i_ino, folio->index, ptr, hash,
> +                  v & EROFS_ONLINEFOLIO_EIO);
>         folio_end_read(folio, !(v & EROFS_ONLINEFOLIO_EIO));
>  }
> 
> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> index aff09f94afb2..39d857acd3d0 100644
> --- a/fs/erofs/zdata.c
> +++ b/fs/erofs/zdata.c
> @@ -1847,7 +1847,7 @@ static int z_erofs_read_folio(struct file *file, struct
> folio *folio)
> 
>         /* if some pclusters are ready, need submit them anyway */
>         err = z_erofs_runqueue(&f, 0) ?: err;
> -       if (err && err != -EINTR)
> +       if (err)
>                 erofs_err(inode->i_sb, "read error %d @ %lu of nid %llu",
>                           err, folio->index, EROFS_I(inode)->nid);
> 
> I'd like to know if some error is returned (especially EINTR) to
> user space which could cause something...
> 

Here is the fresh debug output with your requested changes, and KASAN enabled. Ftrace
failed to patch `drm_modeset_acquire_fini` which seems unrelated, but produces an 
ftrace warning. The additional error debugging didn't show any errors.


BAD:

[   12.426636] erofs: (device mmcblk3p3): mounted with root inode @ nid 36.
[   12.434840] VFS: Mounted root (erofs filesystem) readonly on device 179:3.
[   12.442981] devtmpfs: mounted
[   12.506218] Freeing unused kernel image (initmem) memory: 1024K
[   12.513733] Run /sbin/init as init process
[   12.518403]   with arguments:
[   12.521684]     /sbin/init
[   12.524739]   with environment:
[   12.528408]     HOME=/
[   12.531101]     TERM=linux
[   12.548455] vfs_open: /usr/lib/systemd/systemd
[   12.562482] erofs: (device mmcblk3p3): lz4        : src c1202000 dst: c1200000 in: 4096b (eec708e7, bf629f80, 2) out: 8859b (3bfdda11)
[   12.575957] erofs: bf629fc0 i_ino 868416, index 0 dst 82cfe000 (7795d697) err 0
[   12.583776] erofs: bf629fa0 i_ino 868416, index 1 dst 82cfd000 (e09f25c3) err 0
[   12.593173] erofs: (device mmcblk3p3): lz4        : src c1205000 dst: c120429b in: 4096b (76037b0d, bf629f60, 3) out: 5168b (79840434)
[   12.606191] erofs: bf629f80 i_ino 868416, index 2 dst 82cfc000 (88265a45) err 0
[   12.614418] erofs: (device mmcblk3p3): lz4 partial: src 8576b000 dst: 82cfb6cb in: 4096b (45bf72c3, bf67ed60, 6462) out: 2357b (6e052dd5)
[   12.627615] erofs: bf629f60 i_ino 868416, index 3 dst 82cfb000 (2b4319d2) err 0
[   12.636953] vfs_open: /usr/lib/ld-linux-armhf.so.3
[   12.645023] erofs: (device mmcblk3p3): lz4        : src c1207000 dst: c1206000 in: 4096b (e4b39a2, bf629f20, 1) out: 4907b (aa05f0a3)
[   12.657938] erofs: bf629f40 i_ino 190291, index 0 dst 82cfa000 (20419a5e) err 0
[   12.665969] erofs: (device mmcblk3p3): lz4        : src c1209000 dst: c120832b in: 4096b (717fc925, bf629f00, 2) out: 4246b (c0f62dca)
[   12.679140] erofs: bf629f20 i_ino 190291, index 1 dst 82cf9000 (64eb9a49) err 0
[   12.687258] erofs: (device mmcblk3p3): lz4        : src c120b000 dst: c120a3c1 in: 4096b (8030d189, bf629ee0, 3) out: 4292b (1df48c5f)
[   12.704323] erofs: bf629f00 i_ino 190291, index 2 dst 82cf8000 (7fc63af4) err 0
[   12.712456] erofs: (device mmcblk3p3): lz4 partial: src 84dfe000 dst: 82cf7485 in: 4096b (17ce8f99, bf66bfc0, 1493) out: 2939b (a1ab12cf)
[   12.725580] erofs: bf629ee0 i_ino 190291, index 3 dst 82cf7000 (285ac58c) err 0
[   12.733728] erofs: (device mmcblk3p3): lz4        : src 8576b000 dst: c120c6cb in: 4096b (45bf72c3, bf67ed60, 6462) out: 6376b (dfcc8264)
[   12.749045] erofs: (device mmcblk3p3): lz4        : src c1210000 dst: c120efb3 in: 4096b (74af795c, bf629e60, 6) out: 4651b (46c58dd7)
[   12.762153] erofs: bf629ea0 i_ino 868416, index 4 dst 82cf5000 (7ce0249e) err 0
[   12.770114] erofs: bf629e80 i_ino 868416, index 5 dst 82cf4000 (d832cf73) err 0
[   12.778493] erofs: (device mmcblk3p3): lz4        : src c1213000 dst: c12121de in: 4096b (d65a3a49, bf629e40, 7) out: 5360b (4364e0fc)
[   12.791427] erofs: bf629e60 i_ino 868416, index 6 dst 82cf3000 (aa9da9e7) err 0
[   12.799777] erofs: (device mmcblk3p3): lz4        : src c1215000 dst: c12146ce in: 4096b (db73bb75, bf629e20, 8) out: 4606b (c0a54f50)
[   12.812720] erofs: bf629e40 i_ino 868416, index 7 dst 82cf2000 (372b935) err 0
[   12.820903] erofs: (device mmcblk3p3): lz4        : src c1217000 dst: c12168cc in: 4096b (be653c3d, bf629e00, 9) out: 4536b (10b3a4d0)
[   12.833837] erofs: bf629e20 i_ino 868416, index 8 dst 82cf1000 (3ebcefe7) err 0
[   12.841887] erofs: (device mmcblk3p3): lz4        : src c1219000 dst: c1218a84 in: 4096b (8cd3cff3, bf629de0, 10) out: 4285b (541c02fb)
[   12.854853] erofs: bf629e00 i_ino 868416, index 9 dst 82cf0000 (12adb98e) err 0
[   12.863148] erofs: (device mmcblk3p3): lz4        : src c121b000 dst: c121ab41 in: 4096b (b885e4f7, bf629dc0, 11) out: 4789b (af1820d3)
[   12.876074] erofs: bf629de0 i_ino 868416, index 10 dst 82cef000 (e8b33507) err 0
[   12.884660] erofs: (device mmcblk3p3): lz4        : src c121e000 dst: c121cdf6 in: 4096b (3b4e9357, bf629d80, 13) out: 6216b (6a149c5)
[   12.897597] erofs: bf629dc0 i_ino 868416, index 11 dst 82cee000 (72cdfbb) err 0
[   12.905625] erofs: bf629da0 i_ino 868416, index 12 dst 82ced000 (a4856fd6) err 0
[   12.914182] erofs: (device mmcblk3p3): lz4        : src c1222000 dst: c122063e in: 4096b (a3bdbd0e, bf629d40, 15) out: 8015b (63d1fbc1)
[   12.927174] erofs: bf629d80 i_ino 868416, index 13 dst 82cec000 (d027d81e) err 0
[   12.935288] erofs: bf629d60 i_ino 868416, index 14 dst 82ceb000 (307b732a) err 0
[   12.943878] erofs: (device mmcblk3p3): lz4        : src c1225000 dst: c122458d in: 4096b (480285a7, bf629d20, 16) out: 6603b (822f8de0)
[   12.956839] erofs: bf629d40 i_ino 868416, index 15 dst 82cea000 (39882425) err 0
[   12.965195] erofs: (device mmcblk3p3): lz4        : src c0995000 dst: c1226f58 in: 1839b (4f637f42, bf629d00, 17) out: 5780b (55fe911f)
[   12.978112] erofs: bf629d20 i_ino 868416, index 16 dst 82ce9000 (7f303847) err 0
[   12.986302] erofs: bf629d00 i_ino 868416, index 17 dst 82ce8000 (7e903556) err 0
[   12.994445] erofs: bf629ce0 i_ino 868416, index 18 dst 82ce7000 (e3449d72) err 0
[   13.008153] erofs: (device mmcblk3p3): lz4        : src 8a941000 dst: c122acc6 in: 4096b (cd2f4c7c, bf722820, 1502) out: 4175b (3bf4f1a9)
[   13.021553] erofs: (device mmcblk3p3): lz4        : src c122d000 dst: c122cd15 in: 4096b (8e87c14d, bf629c80, 14) out: 4288b (6a251e64)
[   13.035036] erofs: bf629ca0 i_ino 190291, index 13 dst 82ce5000 (36a0d885) err 0
[   13.043082] erofs: (device mmcblk3p3): lz4        : src c122f000 dst: c122edd5 in: 4096b (31a2e179, bf629c60, 15) out: 4257b (3e19e451)
[   13.056118] erofs: bf629c80 i_ino 190291, index 14 dst 82ce4000 (8890a118) err 0
[   13.064539] erofs: (device mmcblk3p3): lz4        : src c0995000 dst: c1230e76 in: 4096b (65fa2fbe, bf629c40, 16) out: 4460b (ebe0126c)
[   13.077523] erofs: bf629c60 i_ino 190291, index 15 dst 82ce3000 (d48cbaf9) err 0
[   13.085882] erofs: (device mmcblk3p3): lz4        : src c1234000 dst: c1232fe2 in: 4096b (37a8bad1, bf629c00, 18) out: 4349b (c125197)
[   13.098698] erofs: bf629c40 i_ino 190291, index 16 dst 82ce2000 (940857ad) err 0
[   13.106662] erofs: bf629c20 i_ino 190291, index 17 dst 82ce1000 (bd0e7a43) err 0
[   13.115095] erofs: (device mmcblk3p3): lz4        : src c1237000 dst: c12360df in: 4096b (8d172a42, bf629be0, 19) out: 4353b (1503ff28)
[   13.128027] erofs: bf629c00 i_ino 190291, index 18 dst 82ce0000 (dec8eb5c) err 0
[   13.136516] erofs: (device mmcblk3p3): lz4        : src c1239000 dst: c12381e0 in: 4096b (1ef07e2b, bf629bc0, 20) out: 4869b (c3bf758b)
[   13.149443] erofs: bf629be0 i_ino 190291, index 19 dst 82cdf000 (6e7792a7) err 0
[   13.157914] erofs: (device mmcblk3p3): lz4        : src c123b000 dst: c123a4e5 in: 4096b (f4462dc1, bf629ba0, 21) out: 5484b (9b35c90f)
[   13.170901] erofs: bf629bc0 i_ino 190291, index 20 dst 82cde000 (97b42709) err 0
[   13.179293] erofs: (device mmcblk3p3): lz4        : src c123e000 dst: c123ca51 in: 4096b (2ac6b4d5, bf629b60, 23) out: 5985b (94cc0d29)
[   13.192215] erofs: bf629ba0 i_ino 190291, index 21 dst 82cdd000 (29751a32) err 0
[   13.200369] erofs: bf629b80 i_ino 190291, index 22 dst 82cdc000 (eeea8a30) err 0
[   13.209106] erofs: (device mmcblk3p3): lz4        : src c1241000 dst: c12401b2 in: 4096b (90757c3c, bf629b40, 24) out: 6356b (58df129b)
[   13.222139] erofs: bf629b60 i_ino 190291, index 23 dst 82cdb000 (a86b83ad) err 0
[   13.230560] erofs: (device mmcblk3p3): lz4        : src c1244000 dst: c1242a86 in: 4096b (971b791e, bf629b00, 26) out: 6045b (3a6bbefa)
[   13.243775] erofs: bf629b40 i_ino 190291, index 24 dst 82cda000 (2535a069) err 0
[   13.251650] erofs: bf629b20 i_ino 190291, index 25 dst 82cd9000 (98287e49) err 0
[   13.260532] erofs: (device mmcblk3p3): lz4        : src c1248000 dst: c1246223 in: 4096b (9804bc65, bf629ac0, 28) out: 10510b (2a60a723)
[   13.273585] erofs: bf629b00 i_ino 190291, index 26 dst 82cd8000 (64b12fc2) err 0
[   13.281783] erofs: bf629ae0 i_ino 190291, index 27 dst 82cd7000 (de4b4264) err 0
[   13.289966] erofs: (device mmcblk3p3): lz4        : src 8a942a35 dst: c124ab31 in: 1483b (5c99618c, bf722840, 0) out: 4759b (b53e5caa)
[   13.302839] erofs: bf629ac0 i_ino 190291, index 28 dst 82cd6000 (7881835d) err 0
[   13.311032] erofs: bf629aa0 i_ino 190291, index 29 dst 82cd5000 (80d1e247) err 0
[   13.322206] erofs: (device mmcblk3p3): lz4        : src 84dfe000 dst: c124c485 in: 4096b (17ce8f99, bf66bfc0, 1493) out: 4289b (7dbbff69)
[   13.335623] erofs: (device mmcblk3p3): lz4 partial: src 8a941000 dst: 82ccacc6 in: 4096b (cd2f4c7c, bf722820, 1502) out: 826b (21762da4)
[   13.350514] erofs: (device mmcblk3p3): lz4        : src c124f000 dst: c124e546 in: 4096b (e286b2b, bf629a20, 5) out: 4207b (ec8e3f58)
[   13.363515] erofs: bf629a40 i_ino 190291, index 4 dst 82cd2000 (63f2218c) err 0
[   13.371728] erofs: (device mmcblk3p3): lz4        : src c1251000 dst: c12505b5 in: 4096b (e698fd35, bf629a00, 6) out: 4291b (fcf580f8)
[   13.384693] erofs: bf629a20 i_ino 190291, index 5 dst 82cd1000 (d2cc83a9) err 0
[   13.392657] erofs: (device mmcblk3p3): lz4        : src c1253000 dst: c1252678 in: 4096b (4859aa8f, bf6299e0, 7) out: 4297b (ab8a8574)
[   13.405564] erofs: bf629a00 i_ino 190291, index 6 dst 82cd0000 (fe13cf51) err 0
[   13.413748] erofs: (device mmcblk3p3): lz4        : src c1255000 dst: c1254741 in: 4096b (997436a4, bf6299c0, 8) out: 4218b (be0817b8)
[   13.426693] erofs: bf6299e0 i_ino 190291, index 7 dst 82ccf000 (a4994a5f) err 0
[   13.434899] erofs: (device mmcblk3p3): lz4        : src c1257000 dst: c12567bb in: 4096b (112a3fda, bf6299a0, 9) out: 4271b (293ce253)
[   13.447852] erofs: bf6299c0 i_ino 190291, index 8 dst 82cce000 (9e8ba792) err 0
[   13.455875] erofs: (device mmcblk3p3): lz4        : src c1259000 dst: c125886a in: 4096b (fa3410b9, bf629980, 10) out: 4673b (7f7a9871)
[   13.469132] erofs: bf6299a0 i_ino 190291, index 9 dst 82ccd000 (902d97fe) err 0
[   13.477144] erofs: (device mmcblk3p3): lz4        : src c125b000 dst: c125aaab in: 4096b (634b03ca, bf629960, 11) out: 4477b (cf289eb)
[   13.490084] erofs: bf629980 i_ino 190291, index 10 dst 82ccc000 (60b7ab45) err 0
[   13.498423] erofs: (device mmcblk3p3): lz4        : src 8a942000 dst: c125cc28 in: 4096b (163cdf49, bf722840, 0) out: 4254b (998b1f98)
[   13.511449] erofs: bf629960 i_ino 190291, index 11 dst 82ccb000 (55814486) err 0
[   13.519586] erofs: bf629940 i_ino 190291, index 12 dst 82cca000 (717aa17d) err 0
[   13.528275] 8<--- cut here ---
[   13.531897] init: unhandled page fault (11) at 0x34715a30, code 0x805
[   13.539075] [34715a30] *pgd=00000000
[   13.542989] CPU: 0 UID: 0 PID: 1 Comm: init Tainted: G        W          6.12.10-00014-g04b474955c55 #113
[   13.553255] Tainted: [W]=WARN
[   13.556877] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   13.563709] PC is at 0x66cf4268
[   13.567385] LR is at 0x66cfa50f
[   13.571055] pc : [<66cf4268>]    lr : [<66cfa50f>]    psr: 20000030
[   13.577675] sp : 6ebe3b48  ip : 66ce73a2  fp : 66ce7000
[   13.583458] r10: 66d07944  r9 : 6ebe3ba0  r8 : 66ce700c
[   13.589123] r7 : 6ebe3b58  r6 : 00000063  r5 : 20000000  r4 : 66d07a30
[   13.596384] r3 : 66d07000  r2 : 3683d180  r1 : 004ae500  r0 : cda0e000
[   13.603256] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment user
[   13.611331] Control: 50c5387d  Table: 1aa2804a  DAC: 00000055
[   13.617670] Call trace:
[   13.617969] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[   13.628774] Dumping ftrace buffer:
[   13.632700] # WARNING: FUNCTION TRACING IS CORRUPTED
[   13.637961] #          MAY BE MISSING FUNCTION EVENTS
[   13.643538]    (ftrace buffer empty)
[   13.714791] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

GOOD:

[   12.454158] erofs: (device mmcblk3p3): mounted with root inode @ nid 36.
[   12.462236] VFS: Mounted root (erofs filesystem) readonly on device 179:3.
[   12.470486] devtmpfs: mounted
[   12.533635] Freeing unused kernel image (initmem) memory: 1024K
[   12.541205] Run /sbin/init as init process
[   12.545615]   with arguments:
[   12.548878]     /sbin/init
[   12.552130]   with environment:
[   12.555840]     HOME=/
[   12.558497]     TERM=linux
[   12.575847] vfs_open: /usr/lib/systemd/systemd
[   12.592662] erofs: (device mmcblk3p3): lz4        : src c1202000 dst: c1200000 in: 4096b (eec708e7, bf629fa0, 2) out: 8859b (3bfdda11)
[   12.605809] erofs: bf629fe0 i_ino 868416, index 0 dst 82cff000 (7795d697) err 0
[   12.613719] erofs: bf629fc0 i_ino 868416, index 1 dst 82cfe000 (e09f25c3) err 0
[   12.622151] erofs: (device mmcblk3p3): lz4        : src c1205000 dst: c120429b in: 4096b (76037b0d, bf629f80, 3) out: 5168b (79840434)
[   12.635102] erofs: bf629fa0 i_ino 868416, index 2 dst 82cfd000 (88265a45) err 0
[   12.643606] erofs: (device mmcblk3p3): lz4        : src c1207000 dst: c12066cb in: 4096b (4cac566d, bf629f60, 4) out: 6376b (dfcc8264)
[   12.656475] erofs: bf629f80 i_ino 868416, index 3 dst 82cfc000 (2b4319d2) err 0
[   12.664694] erofs: (device mmcblk3p3): lz4        : src c120a000 dst: c1208fb3 in: 4096b (74af795c, bf629f20, 6) out: 4651b (46c58dd7)
[   12.677549] erofs: bf629f60 i_ino 868416, index 4 dst 82cfb000 (7ce0249e) err 0
[   12.685754] erofs: bf629f40 i_ino 868416, index 5 dst 82cfa000 (d832cf73) err 0
[   12.694175] erofs: (device mmcblk3p3): lz4        : src c120d000 dst: c120c1de in: 4096b (d65a3a49, bf629f00, 7) out: 5360b (4364e0fc)
[   12.707097] erofs: bf629f20 i_ino 868416, index 6 dst 82cf9000 (aa9da9e7) err 0
[   12.715201] erofs: (device mmcblk3p3): lz4        : src c120f000 dst: c120e6ce in: 4096b (db73bb75, bf629ee0, 8) out: 4606b (c0a54f50)
[   12.728314] erofs: bf629f00 i_ino 868416, index 7 dst 82cf8000 (372b935) err 0
[   12.736367] erofs: (device mmcblk3p3): lz4        : src c1211000 dst: c12108cc in: 4096b (be653c3d, bf629ec0, 9) out: 4536b (10b3a4d0)
[   12.749215] erofs: bf629ee0 i_ino 868416, index 8 dst 82cf7000 (3ebcefe7) err 0
[   12.757651] erofs: (device mmcblk3p3): lz4        : src c1213000 dst: c1212a84 in: 4096b (8cd3cff3, bf629ea0, 10) out: 4285b (541c02fb)
[   12.770577] erofs: bf629ec0 i_ino 868416, index 9 dst 82cf6000 (12adb98e) err 0
[   12.779070] erofs: (device mmcblk3p3): lz4        : src c1215000 dst: c1214b41 in: 4096b (b885e4f7, bf629e80, 11) out: 4789b (af1820d3)
[   12.791988] erofs: bf629ea0 i_ino 868416, index 10 dst 82cf5000 (e8b33507) err 0
[   12.800438] erofs: (device mmcblk3p3): lz4        : src c1218000 dst: c1216df6 in: 4096b (3b4e9357, bf629e40, 13) out: 6216b (6a149c5)
[   12.813310] erofs: bf629e80 i_ino 868416, index 11 dst 82cf4000 (72cdfbb) err 0
[   12.821459] erofs: bf629e60 i_ino 868416, index 12 dst 82cf3000 (a4856fd6) err 0
[   12.830275] erofs: (device mmcblk3p3): lz4        : src c121c000 dst: c121a63e in: 4096b (a3bdbd0e, bf629e00, 15) out: 8015b (63d1fbc1)
[   12.843328] erofs: bf629e40 i_ino 868416, index 13 dst 82cf2000 (d027d81e) err 0
[   12.851321] erofs: bf629e20 i_ino 868416, index 14 dst 82cf1000 (307b732a) err 0
[   12.859966] erofs: (device mmcblk3p3): lz4        : src c121f000 dst: c121e58d in: 4096b (480285a7, bf629de0, 16) out: 6603b (822f8de0)
[   12.873015] erofs: bf629e00 i_ino 868416, index 15 dst 82cf0000 (39882425) err 0
[   12.881494] erofs: (device mmcblk3p3): lz4        : src c0995000 dst: c1220f58 in: 1839b (4f637f42, bf629dc0, 17) out: 5780b (55fe911f)
[   12.894479] erofs: bf629de0 i_ino 868416, index 16 dst 82cef000 (7f303847) err 0
[   12.902660] erofs: bf629dc0 i_ino 868416, index 17 dst 82cee000 (7e903556) err 0
[   12.910494] erofs: bf629da0 i_ino 868416, index 18 dst 82ced000 (e3449d72) err 0
[   12.920714] vfs_open: hash of /usr/lib/systemd/systemd: 0x0610c635
[   12.931295] vfs_open: /usr/lib/ld-linux-armhf.so.3
[   12.946124] erofs: (device mmcblk3p3): lz4        : src c1225000 dst: c1224000 in: 4096b (e4b39a2, bf629d40, 1) out: 4907b (aa05f0a3)
[   12.959147] erofs: bf629d60 i_ino 190291, index 0 dst 82ceb000 (20419a5e) err 0
[   12.967455] erofs: (device mmcblk3p3): lz4        : src c1227000 dst: c122632b in: 4096b (717fc925, bf629d20, 2) out: 4246b (c0f62dca)
[   12.980398] erofs: bf629d40 i_ino 190291, index 1 dst 82cea000 (64eb9a49) err 0
[   12.988432] erofs: (device mmcblk3p3): lz4        : src c1229000 dst: c12283c1 in: 4096b (8030d189, bf629d00, 3) out: 4292b (1df48c5f)
[   13.001322] erofs: bf629d20 i_ino 190291, index 2 dst 82ce9000 (7fc63af4) err 0
[   13.009526] erofs: (device mmcblk3p3): lz4        : src c122b000 dst: c122a485 in: 4096b (4aac6f77, bf629ce0, 4) out: 4289b (7dbbff69)
[   13.022469] erofs: bf629d00 i_ino 190291, index 3 dst 82ce8000 (285ac58c) err 0
[   13.030641] erofs: (device mmcblk3p3): lz4        : src c122d000 dst: c122c546 in: 4096b (e286b2b, bf629cc0, 5) out: 4207b (ec8e3f58)
[   13.043431] erofs: bf629ce0 i_ino 190291, index 4 dst 82ce7000 (63f2218c) err 0
[   13.051729] erofs: (device mmcblk3p3): lz4        : src c122f000 dst: c122e5b5 in: 4096b (e698fd35, bf629ca0, 6) out: 4291b (fcf580f8)
[   13.064654] erofs: bf629cc0 i_ino 190291, index 5 dst 82ce6000 (d2cc83a9) err 0
[   13.072712] erofs: (device mmcblk3p3): lz4        : src c1231000 dst: c1230678 in: 4096b (4859aa8f, bf629c80, 7) out: 4297b (ab8a8574)
[   13.085616] erofs: bf629ca0 i_ino 190291, index 6 dst 82ce5000 (fe13cf51) err 0
[   13.093964] erofs: (device mmcblk3p3): lz4        : src c1233000 dst: c1232741 in: 4096b (997436a4, bf629c60, 8) out: 4218b (be0817b8)
[   13.106809] erofs: bf629c80 i_ino 190291, index 7 dst 82ce4000 (a4994a5f) err 0
[   13.115151] erofs: (device mmcblk3p3): lz4        : src c1235000 dst: c12347bb in: 4096b (112a3fda, bf629c40, 9) out: 4271b (293ce253)
[   13.127996] erofs: bf629c60 i_ino 190291, index 8 dst 82ce3000 (9e8ba792) err 0
[   13.136087] erofs: (device mmcblk3p3): lz4        : src c1237000 dst: c123686a in: 4096b (fa3410b9, bf629c20, 10) out: 4673b (7f7a9871)
[   13.149454] erofs: bf629c40 i_ino 190291, index 9 dst 82ce2000 (902d97fe) err 0
[   13.157524] erofs: (device mmcblk3p3): lz4        : src c1239000 dst: c1238aab in: 4096b (634b03ca, bf629c00, 11) out: 4477b (cf289eb)
[   13.170471] erofs: bf629c20 i_ino 190291, index 10 dst 82ce1000 (60b7ab45) err 0
[   13.178797] erofs: (device mmcblk3p3): lz4        : src c123b000 dst: c123ac28 in: 4096b (326e1ba0, bf629be0, 12) out: 4254b (998b1f98)
[   13.191761] erofs: bf629c00 i_ino 190291, index 11 dst 82ce0000 (55814486) err 0
[   13.200025] erofs: (device mmcblk3p3): lz4        : src c123d000 dst: c123ccc6 in: 4096b (3c5b4505, bf629bc0, 13) out: 4175b (3bf4f1a9)
[   13.213001] erofs: bf629be0 i_ino 190291, index 12 dst 82cdf000 (717aa17d) err 0
[   13.221167] erofs: (device mmcblk3p3): lz4        : src c123f000 dst: c123ed15 in: 4096b (8e87c14d, bf629ba0, 14) out: 4288b (6a251e64)
[   13.234181] erofs: bf629bc0 i_ino 190291, index 13 dst 82cde000 (36a0d885) err 0
[   13.242519] erofs: (device mmcblk3p3): lz4        : src c1241000 dst: c1240dd5 in: 4096b (31a2e179, bf629b80, 15) out: 4257b (3e19e451)
[   13.255534] erofs: bf629ba0 i_ino 190291, index 14 dst 82cdd000 (8890a118) err 0
[   13.263944] erofs: (device mmcblk3p3): lz4        : src c0995000 dst: c1242e76 in: 4096b (65fa2fbe, bf629b60, 16) out: 4460b (ebe0126c)
[   13.276918] erofs: bf629b80 i_ino 190291, index 15 dst 82cdc000 (d48cbaf9) err 0
[   13.285456] erofs: (device mmcblk3p3): lz4        : src c1246000 dst: c1244fe2 in: 4096b (37a8bad1, bf629b20, 18) out: 4349b (c125197)
[   13.298312] erofs: bf629b60 i_ino 190291, index 16 dst 82cdb000 (940857ad) err 0
[   13.306341] erofs: bf629b40 i_ino 190291, index 17 dst 82cda000 (bd0e7a43) err 0
[   13.314760] erofs: (device mmcblk3p3): lz4        : src c1249000 dst: c12480df in: 4096b (8d172a42, bf629b00, 19) out: 4353b (1503ff28)
[   13.327777] erofs: bf629b20 i_ino 190291, index 18 dst 82cd9000 (dec8eb5c) err 0
[   13.336231] erofs: (device mmcblk3p3): lz4        : src c124b000 dst: c124a1e0 in: 4096b (1ef07e2b, bf629ae0, 20) out: 4869b (c3bf758b)
[   13.349213] erofs: bf629b00 i_ino 190291, index 19 dst 82cd8000 (6e7792a7) err 0
[   13.357541] erofs: (device mmcblk3p3): lz4        : src c124d000 dst: c124c4e5 in: 4096b (f4462dc1, bf629ac0, 21) out: 5484b (9b35c90f)
[   13.370740] erofs: bf629ae0 i_ino 190291, index 20 dst 82cd7000 (97b42709) err 0
[   13.379196] erofs: (device mmcblk3p3): lz4        : src c1250000 dst: c124ea51 in: 4096b (2ac6b4d5, bf629a80, 23) out: 5985b (94cc0d29)
[   13.392170] erofs: bf629ac0 i_ino 190291, index 21 dst 82cd6000 (29751a32) err 0
[   13.400416] erofs: bf629aa0 i_ino 190291, index 22 dst 82cd5000 (eeea8a30) err 0
[   13.409143] erofs: (device mmcblk3p3): lz4        : src c1253000 dst: c12521b2 in: 4096b (90757c3c, bf629a60, 24) out: 6356b (58df129b)
[   13.422165] erofs: bf629a80 i_ino 190291, index 23 dst 82cd4000 (a86b83ad) err 0
[   13.430562] erofs: (device mmcblk3p3): lz4        : src c1256000 dst: c1254a86 in: 4096b (971b791e, bf629a20, 26) out: 6045b (3a6bbefa)
[   13.443592] erofs: bf629a60 i_ino 190291, index 24 dst 82cd3000 (2535a069) err 0
[   13.451735] erofs: bf629a40 i_ino 190291, index 25 dst 82cd2000 (98287e49) err 0
[   13.460545] erofs: (device mmcblk3p3): lz4        : src c125a000 dst: c1258223 in: 4096b (9804bc65, bf6299e0, 28) out: 10510b (2a60a723)
[   13.473642] erofs: bf629a20 i_ino 190291, index 26 dst 82cd1000 (64b12fc2) err 0
[   13.481862] erofs: bf629a00 i_ino 190291, index 27 dst 82cd0000 (de4b4264) err 0
[   13.489996] erofs: (device mmcblk3p3): lz4        : src 85d73a35 dst: c125cb31 in: 1483b (5c99618c, bf68ae60, 0) out: 4759b (b53e5caa)
[   13.502976] erofs: bf6299e0 i_ino 190291, index 28 dst 82ccf000 (7881835d) err 0
[   13.511102] erofs: bf6299c0 i_ino 190291, index 29 dst 82cce000 (80d1e247) err 0
[   13.522922] vfs_open: hash of /usr/lib/ld-linux-armhf.so.3: 0xf1fe4854

> Thanks,
> Gao Xiang
> 
> 

Cheers,
Stefan

-- 
Pengutronix e.K.                       | Stefan Kerkmann             |
Steuerwalder Str. 21                   | https://www.pengutronix.de/ |
31137 Hildesheim, Germany              | Phone: +49-5121-206917-128  |
Amtsgericht Hildesheim, HRA 2686       | Fax:   +49-5121-206917-9    |


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2025-01-20 17:36         ` Stefan Kerkmann
@ 2025-01-21  3:27           ` Gao Xiang
  2025-01-21  3:33             ` Gao Xiang
  0 siblings, 1 reply; 11+ messages in thread
From: Gao Xiang @ 2025-01-21  3:27 UTC (permalink / raw)
  To: Stefan Kerkmann, linux-erofs



On 2025/1/21 01:36, Stefan Kerkmann wrote:
> Hi Gao,
> 
> I have enabled KASAN and applied your requested changes, but nothing suspicious happened.

Sigh...

> 
>> - Could we get the exact file offset of `init` which init process is
>>    crashed?  It will help us to chase down the the primary scene.
> 
> I'll try to track that down. If you have any hints how to-do that let me know :-).

Many thanks for the test...
I just hacked some code but un-tested as below:

diff --git a/kernel/exit.c b/kernel/exit.c
index 1dcddfe537ee..868fea16732f 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -873,6 +873,8 @@ static void synchronize_group_exit(struct task_struct *tsk, long code)
  	spin_unlock_irq(&sighand->siglock);
  }

+extern struct inode *erofs_iget(struct super_block *sb, u64 nid);
+
  void __noreturn do_exit(long code)
  {
  	struct task_struct *tsk = current;
@@ -903,9 +905,59 @@ void __noreturn do_exit(long code)
  		 * If the last thread of global init has exited, panic
  		 * immediately to get a useable coredump.
  		 */
-		if (unlikely(is_global_init(tsk)))
+		if (unlikely(is_global_init(tsk))) {
+			struct path path;
+			struct inode *inode;
+
+			get_fs_pwd(tsk->fs, &path);
+
+			inode = d_inode(path.dentry);
+			if (inode && inode->i_sb->s_magic == EROFS_SUPER_MAGIC_V1) {
+				struct inode *inode;
+				int i = 0;
+
+				inode = erofs_iget(inode->i_sb, 190291);
+				if (IS_ERR(inode))
+					goto skip;
+
+				for (i = 0; i < 30; ++i) {
+					struct page *page = find_get_page(inode->i_mapping, i);
+					void *data;
+
+					if (!page)
+						continue;
+					data = kmap_local_page(page);
+
+					hash = fnv_32_buf(data, PAGE_SIZE, FNV1_32_INIT);
+					pr_err("%px i_ino %lu, index %lu dst %px (%x) err %d",
+					       page, page->mapping->host->i_ino, i, ptr, hash);
+					kunmap_local(data);
+				}
+				iput(inode);
+
+				inode = erofs_iget(inode->i_sb, 868416);
+				if (IS_ERR(inode))
+					goto skip;
+
+				for (i = 0; i < 19; ++i) {
+					struct page *page = find_get_page(inode->i_mapping, i);
+					void *data;
+
+					if (!page)
+						continue;
+					data = kmap_local_page(page);
+					hash = fnv_32_buf(data, PAGE_SIZE, FNV1_32_INIT);
+					pr_err("%px i_ino %lu, index %lu dst %px (%x) err %d",
+					       page, page->mapping->host->i_ino, i, ptr, hash);
+					kunmap_local(data);
+				}
+				iput(inode);
+			}
+skip:
  			panic("Attempted to kill init! exitcode=0x%08x\n",
  				tsk->signal->group_exit_code ?: (int)code);
+		}
+

  #ifdef CONFIG_POSIX_TIMERS
  		hrtimer_cancel(&tsk->signal->real_timer);

You could follow the idea to dump the page cache data when init
is killed, I wonder the output...


Thanks,
Gao Xiang

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2025-01-21  3:27           ` Gao Xiang
@ 2025-01-21  3:33             ` Gao Xiang
  2025-01-21 17:21               ` Stefan Kerkmann
  0 siblings, 1 reply; 11+ messages in thread
From: Gao Xiang @ 2025-01-21  3:33 UTC (permalink / raw)
  To: Stefan Kerkmann, linux-erofs



On 2025/1/21 11:27, Gao Xiang wrote:
> 
> 
> On 2025/1/21 01:36, Stefan Kerkmann wrote:
>> Hi Gao,
>>
>> I have enabled KASAN and applied your requested changes, but nothing suspicious happened.
> 
> Sigh...
> 
>>
>>> - Could we get the exact file offset of `init` which init process is
>>>    crashed?  It will help us to chase down the the primary scene.
>>
>> I'll try to track that down. If you have any hints how to-do that let me know :-).
> 
> Many thanks for the test...
> I just hacked some code but un-tested as below:
> 
> diff --git a/kernel/exit.c b/kernel/exit.c
> index 1dcddfe537ee..868fea16732f 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -873,6 +873,8 @@ static void synchronize_group_exit(struct task_struct *tsk, long code)
>       spin_unlock_irq(&sighand->siglock);
>   }
> 
> +extern struct inode *erofs_iget(struct super_block *sb, u64 nid);
> +
>   void __noreturn do_exit(long code)
>   {
>       struct task_struct *tsk = current;
> @@ -903,9 +905,59 @@ void __noreturn do_exit(long code)
>            * If the last thread of global init has exited, panic
>            * immediately to get a useable coredump.
>            */
> -        if (unlikely(is_global_init(tsk)))
> +        if (unlikely(is_global_init(tsk))) {
> +            struct path path;
> +            struct inode *inode;
> +
> +            get_fs_pwd(tsk->fs, &path);
> +
> +            inode = d_inode(path.dentry);
> +            if (inode && inode->i_sb->s_magic == EROFS_SUPER_MAGIC_V1) {
> +                struct inode *inode;
> +                int i = 0;
> +
> +                inode = erofs_iget(inode->i_sb, 190291);
> +                if (IS_ERR(inode))
> +                    goto skip;
> +
> +                for (i = 0; i < 30; ++i) {
> +                    struct page *page = find_get_page(inode->i_mapping, i);
> +                    void *data;
> +
> +                    if (!page)
> +                        continue;
> +                    data = kmap_local_page(page);
> +
> +                    hash = fnv_32_buf(data, PAGE_SIZE, FNV1_32_INIT);
> +                    pr_err("%px i_ino %lu, index %lu dst %px (%x) err %d",
> +                           page, page->mapping->host->i_ino, i, ptr, hash);

maybe use some different style in this print message:

		"exit: %px i_ino %lu, index %lu dst %px (%x)"

likewise.

Anyway, it's somewhat hack code, just wonder if it works, and
the output is helpful for us to know which page is corrupt.


> +                    kunmap_local(data);
> +                }
> +                iput(inode);
> +
> +                inode = erofs_iget(inode->i_sb, 868416);
> +                if (IS_ERR(inode))
> +                    goto skip;
> +
> +                for (i = 0; i < 19; ++i) {
> +                    struct page *page = find_get_page(inode->i_mapping, i);
> +                    void *data;
> +
> +                    if (!page)
> +                        continue;
> +                    data = kmap_local_page(page);
> +                    hash = fnv_32_buf(data, PAGE_SIZE, FNV1_32_INIT);
> +                    pr_err("%px i_ino %lu, index %lu dst %px (%x) err %d",
> +                           page, page->mapping->host->i_ino, i, ptr, hash);
> +                    kunmap_local(data);
> +                }
> +                iput(inode);
> +            }
> +skip:
>               panic("Attempted to kill init! exitcode=0x%08x\n",
>                   tsk->signal->group_exit_code ?: (int)code);
> +        }
> +
> 
>   #ifdef CONFIG_POSIX_TIMERS
>           hrtimer_cancel(&tsk->signal->real_timer);
> 
> You could follow the idea to dump the page cache data when init
> is killed, I wonder the output...
> 
> 
> Thanks,
> Gao Xiang


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2025-01-21  3:33             ` Gao Xiang
@ 2025-01-21 17:21               ` Stefan Kerkmann
  2025-01-22  1:41                 ` Gao Xiang
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Kerkmann @ 2025-01-21 17:21 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs

Hi Gao,

I have applied your patch (with minor corrections) and here is the output. I haven't had the time today to look deeper into it unfortunately.

[    4.765049] erofs: (device mmcblk3p3): mounted with root inode @ nid 36.
[    4.772082] VFS: Mounted root (erofs filesystem) readonly on device 179:3.
[    4.779155] devtmpfs: mounted
[    4.792432] Freeing unused kernel image (initmem) memory: 1024K
[    4.798909] Run /sbin/init as init process
[    4.803219]   with arguments:
[    4.806345]     /sbin/init
[    4.809168]   with environment:
[    4.812526]     HOME=/
[    4.814998]     TERM=linux
[    4.821205] vfs_open: /usr/lib/systemd/systemd
[    4.827746] erofs: (device mmcblk3p3): lz4        : src c1002000 dst: c1000000 in: 4096b (eec708e7, bf5f1f80, 2) out: 8859b (3bfdda11)
[    4.840164] erofs: bf5f1fc0 i_ino 868416, index 0 dst 810fe000 (7795d697) err 0
[    4.847766] erofs: bf5f1fa0 i_ino 868416, index 1 dst 810fd000 (e09f25c3) err 0
[    4.862091] erofs: (device mmcblk3p3): lz4        : src c1005000 dst: c100429b in: 4096b (76037b0d, bf5f1f60, 3) out: 5168b (79840434)
[    4.874456] erofs: bf5f1f80 i_ino 868416, index 2 dst 810fc000 (88265a45) err 0
[    4.882098] erofs: (device mmcblk3p3): lz4 partial: src 82cbd000 dst: 810fb6cb in: 4096b (45bf72c3, bf6297a0, 6462) out: 2357b (6e052dd5)
[    4.894729] erofs: bf5f1f60 i_ino 868416, index 3 dst 810fb000 (2b4319d2) err 0
[    4.903346] vfs_open: /usr/lib/ld-linux-armhf.so.3
[    4.909853] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c1006000 in: 4096b (e4b39a2, bf5f1f20, 1) out: 4907b (aa05f0a3)
[    4.922134] erofs: bf5f1f40 i_ino 190291, index 0 dst 810fa000 (20419a5e) err 0
[    4.929813] erofs: (device mmcblk3p3): lz4        : src c1009000 dst: c100832b in: 4096b (717fc925, bf5f1f00, 2) out: 4246b (c0f62dca)
[    4.942938] erofs: (device mmcblk3p3): lz4        : src 82cbd000 dst: c100a6cb in: 4096b (45bf72c3, bf6297a0, 6462) out: 6376b (dfcc8264)
[    4.955668] erofs: bf5f1f20 i_ino 190291, index 1 dst 810f9000 (64eb9a49) err 0
[    4.963321] erofs: (device mmcblk3p3): lz4        : src c100d000 dst: c100c3c1 in: 4096b (8030d189, bf5f1ee0, 3) out: 4292b (1df48c5f)
[    4.975678] erofs: bf5f1f00 i_ino 190291, index 2 dst 810f8000 (7fc63af4) err 0
[    4.983363] erofs: (device mmcblk3p3): lz4 partial: src 830a8000 dst: 810f7485 in: 4096b (17ce8f99, bf631500, 1493) out: 2939b (a1ab12cf)
[    4.995957] erofs: bf5f1ee0 i_ino 190291, index 3 dst 810f7000 (285ac58c) err 0
[    5.007086] erofs: (device mmcblk3p3): lz4        : src c1010000 dst: c100efb3 in: 4096b (74af795c, bf5f1e60, 6) out: 4651b (46c58dd7)
[    5.019455] erofs: bf5f1ea0 i_ino 868416, index 4 dst 810f5000 (7ce0249e) err 0
[    5.027040] erofs: bf5f1e80 i_ino 868416, index 5 dst 810f4000 (d832cf73) err 0
[    5.034641] erofs: (device mmcblk3p3): lz4        : src c1013000 dst: c10121de in: 4096b (d65a3a49, bf5f1e40, 7) out: 5360b (4364e0fc)
[    5.046970] erofs: bf5f1e60 i_ino 868416, index 6 dst 810f3000 (aa9da9e7) err 0
[    5.054649] erofs: (device mmcblk3p3): lz4        : src c1015000 dst: c10146ce in: 4096b (db73bb75, bf5f1e20, 8) out: 4606b (c0a54f50)
[    5.067063] erofs: bf5f1e40 i_ino 868416, index 7 dst 810f2000 (372b935) err 0
[    5.074721] erofs: (device mmcblk3p3): lz4        : src c1017000 dst: c10168cc in: 4096b (be653c3d, bf5f1e00, 9) out: 4536b (10b3a4d0)
[    5.087070] erofs: bf5f1e20 i_ino 868416, index 8 dst 810f1000 (3ebcefe7) err 0
[    5.094683] erofs: (device mmcblk3p3): lz4        : src c1019000 dst: c1018a84 in: 4096b (8cd3cff3, bf5f1de0, 10) out: 4285b (541c02fb)
[    5.107120] erofs: bf5f1e00 i_ino 868416, index 9 dst 810f0000 (12adb98e) err 0
[    5.114832] erofs: (device mmcblk3p3): lz4        : src c101b000 dst: c101ab41 in: 4096b (b885e4f7, bf5f1dc0, 11) out: 4789b (af1820d3)
[    5.127409] erofs: bf5f1de0 i_ino 868416, index 10 dst 810ef000 (e8b33507) err 0
[    5.143657] erofs: (device mmcblk3p3): lz4        : src c101e000 dst: c101cdf6 in: 4096b (3b4e9357, bf5f1d80, 13) out: 6216b (6a149c5)
[    5.156017] erofs: bf5f1dc0 i_ino 868416, index 11 dst 810ee000 (72cdfbb) err 0
[    5.163505] erofs: bf5f1da0 i_ino 868416, index 12 dst 810ed000 (a4856fd6) err 0
[    5.171330] erofs: (device mmcblk3p3): lz4        : src c1022000 dst: c102063e in: 4096b (a3bdbd0e, bf5f1d40, 15) out: 8015b (63d1fbc1)
[    5.183762] erofs: bf5f1d80 i_ino 868416, index 13 dst 810ec000 (d027d81e) err 0
[    5.191414] erofs: bf5f1d60 i_ino 868416, index 14 dst 810eb000 (307b732a) err 0
[    5.199108] erofs: (device mmcblk3p3): lz4        : src c1025000 dst: c102458d in: 4096b (480285a7, bf5f1d20, 16) out: 6603b (822f8de0)
[    5.211544] erofs: bf5f1d40 i_ino 868416, index 15 dst 810ea000 (39882425) err 0
[    5.219253] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1026f58 in: 1839b (4f637f42, bf5f1d00, 17) out: 5780b (55fe911f)
[    5.231687] erofs: bf5f1d20 i_ino 868416, index 16 dst 810e9000 (7f303847) err 0
[    5.239317] erofs: bf5f1d00 i_ino 868416, index 17 dst 810e8000 (7e903556) err 0
[    5.246960] erofs: bf5f1ce0 i_ino 868416, index 18 dst 810e7000 (e3449d72) err 0
[    5.262766] erofs: (device mmcblk3p3): lz4        : src 830ab000 dst: c102acc6 in: 4096b (cd2f4c7c, bf631560, 1502) out: 4175b (3bf4f1a9)
[    5.275485] erofs: (device mmcblk3p3): lz4        : src c102d000 dst: c102cd15 in: 4096b (8e87c14d, bf5f1c80, 14) out: 4288b (6a251e64)
[    5.287917] erofs: bf5f1ca0 i_ino 190291, index 13 dst 810e5000 (36a0d885) err 0
[    5.295657] erofs: (device mmcblk3p3): lz4        : src c102f000 dst: c102edd5 in: 4096b (31a2e179, bf5f1c60, 15) out: 4257b (3e19e451)
[    5.308098] erofs: bf5f1c80 i_ino 190291, index 14 dst 810e4000 (8890a118) err 0
[    5.315759] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1030e76 in: 4096b (65fa2fbe, bf5f1c40, 16) out: 4460b (ebe0126c)
[    5.328237] erofs: bf5f1c60 i_ino 190291, index 15 dst 810e3000 (d48cbaf9) err 0
[    5.335963] erofs: (device mmcblk3p3): lz4        : src c1034000 dst: c1032fe2 in: 4096b (37a8bad1, bf5f1c00, 18) out: 4349b (c125197)
[    5.348311] erofs: bf5f1c40 i_ino 190291, index 16 dst 810e2000 (940857ad) err 0
[    5.355943] erofs: bf5f1c20 i_ino 190291, index 17 dst 810e1000 (bd0e7a43) err 0
[    5.363673] erofs: (device mmcblk3p3): lz4        : src c1037000 dst: c10360df in: 4096b (8d172a42, bf5f1be0, 19) out: 4353b (1503ff28)
[    5.376111] erofs: bf5f1c00 i_ino 190291, index 18 dst 810e0000 (dec8eb5c) err 0
[    5.383781] erofs: (device mmcblk3p3): lz4        : src c1039000 dst: c10381e0 in: 4096b (1ef07e2b, bf5f1bc0, 20) out: 4869b (c3bf758b)
[    5.396214] erofs: bf5f1be0 i_ino 190291, index 19 dst 810df000 (6e7792a7) err 0
[    5.403964] erofs: (device mmcblk3p3): lz4        : src c103b000 dst: c103a4e5 in: 4096b (f4462dc1, bf5f1ba0, 21) out: 5484b (9b35c90f)
[    5.416397] erofs: bf5f1bc0 i_ino 190291, index 20 dst 810de000 (97b42709) err 0
[    5.424162] erofs: (device mmcblk3p3): lz4        : src c103e000 dst: c103ca51 in: 4096b (2ac6b4d5, bf5f1b60, 23) out: 5985b (94cc0d29)
[    5.436597] erofs: bf5f1ba0 i_ino 190291, index 21 dst 810dd000 (29751a32) err 0
[    5.444168] erofs: bf5f1b80 i_ino 190291, index 22 dst 810dc000 (eeea8a30) err 0
[    5.451965] erofs: (device mmcblk3p3): lz4        : src c1041000 dst: c10401b2 in: 4096b (90757c3c, bf5f1b40, 24) out: 6356b (58df129b)
[    5.464395] erofs: bf5f1b60 i_ino 190291, index 23 dst 810db000 (a86b83ad) err 0
[    5.472176] erofs: (device mmcblk3p3): lz4        : src c1044000 dst: c1042a86 in: 4096b (971b791e, bf5f1b00, 26) out: 6045b (3a6bbefa)
[    5.484610] erofs: bf5f1b40 i_ino 190291, index 24 dst 810da000 (2535a069) err 0
[    5.492246] erofs: bf5f1b20 i_ino 190291, index 25 dst 810d9000 (98287e49) err 0
[    5.500043] erofs: (device mmcblk3p3): lz4        : src c1048000 dst: c1046223 in: 4096b (9804bc65, bf5f1ac0, 28) out: 10510b (2a60a723)
[    5.512834] erofs: bf5f1b00 i_ino 190291, index 26 dst 810d8000 (64b12fc2) err 0
[    5.520495] erofs: bf5f1ae0 i_ino 190291, index 27 dst 810d7000 (de4b4264) err 0
[    5.528179] erofs: (device mmcblk3p3): lz4        : src 830aca35 dst: c104ab31 in: 1483b (5c99618c, bf631580, 0) out: 4759b (b53e5caa)
[    5.540810] erofs: bf5f1ac0 i_ino 190291, index 28 dst 810d6000 (7881835d) err 0
[    5.548449] erofs: bf5f1aa0 i_ino 190291, index 29 dst 810d5000 (80d1e247) err 0
[    5.560729] erofs: (device mmcblk3p3): lz4        : src 830a8000 dst: c104c485 in: 4096b (17ce8f99, bf631500, 1493) out: 4289b (7dbbff69)
[    5.573541] erofs: (device mmcblk3p3): lz4 partial: src 830ab000 dst: 810cacc6 in: 4096b (cd2f4c7c, bf631560, 1502) out: 826b (21762da4)
[    5.591796] erofs: (device mmcblk3p3): lz4        : src c104f000 dst: c104e546 in: 4096b (e286b2b, bf5f1a20, 5) out: 4207b (ec8e3f58)
[    5.604130] erofs: bf5f1a40 i_ino 190291, index 4 dst 810d2000 (63f2218c) err 0
[    5.611835] erofs: (device mmcblk3p3): lz4        : src c1051000 dst: c10505b5 in: 4096b (e698fd35, bf5f1a00, 6) out: 4291b (fcf580f8)
[    5.624404] erofs: bf5f1a20 i_ino 190291, index 5 dst 810d1000 (d2cc83a9) err 0
[    5.632158] erofs: (device mmcblk3p3): lz4        : src c1053000 dst: c1052678 in: 4096b (4859aa8f, bf5f19e0, 7) out: 4297b (ab8a8574)
[    5.644522] erofs: bf5f1a00 i_ino 190291, index 6 dst 810d0000 (fe13cf51) err 0
[    5.652188] erofs: (device mmcblk3p3): lz4        : src c1055000 dst: c1054741 in: 4096b (997436a4, bf5f19c0, 8) out: 4218b (be0817b8)
[    5.664551] erofs: bf5f19e0 i_ino 190291, index 7 dst 810cf000 (a4994a5f) err 0
[    5.672199] erofs: (device mmcblk3p3): lz4        : src c1057000 dst: c10567bb in: 4096b (112a3fda, bf5f19a0, 9) out: 4271b (293ce253)
[    5.684561] erofs: bf5f19c0 i_ino 190291, index 8 dst 810ce000 (9e8ba792) err 0
[    5.692214] erofs: (device mmcblk3p3): lz4        : src c1059000 dst: c105886a in: 4096b (fa3410b9, bf5f1980, 10) out: 4673b (7f7a9871)
[    5.704675] erofs: bf5f19a0 i_ino 190291, index 9 dst 810cd000 (902d97fe) err 0
[    5.712242] erofs: (device mmcblk3p3): lz4        : src c105b000 dst: c105aaab in: 4096b (634b03ca, bf5f1960, 11) out: 4477b (cf289eb)
[    5.724628] erofs: bf5f1980 i_ino 190291, index 10 dst 810cc000 (60b7ab45) err 0
[    5.732329] 8<--- cut here ---
[    5.735476] init: unhandled page fault (11) at 0x6f532180, code 0x005
[    5.742271] erofs: (device mmcblk3p3): lz4        : src 830ac000 dst: c105cc28 in: 4096b (163cdf49, bf631580, 0) out: 4254b (998b1f98)
[    5.754643] erofs: bf5f1960 i_ino 190291, index 11 dst 810cb000 (55814486) err 0
[    5.762301] erofs: bf5f1940 i_ino 190291, index 12 dst 810ca000 (717aa17d) err 0
[    5.769871] [6f532180] *pgd=00000000
[    5.773686] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.12.10-00014-g1f2f4d02b240-dirty #117
[    5.782503] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    5.789264] PC is at 0x76f5cc86
[    5.792568] LR is at 0x76f632a5
[    5.795806] pc : [<76f5cc86>]    lr : [<76f632a5>]    psr: 20001430
[    5.802270] sp : 7e8ece68  ip : 76f71000  fp : 00000016
[    5.807603] r10: 76f53000  r9 : 76f715f0  r8 : 76f70ce0
[    5.813037] r7 : 7e8ece80  r6 : 76f71000  r5 : 00000003  r4 : 76f53148
[    5.819743] r3 : 00000008  r2 : 6f532180  r1 : 00000001  r0 : 76f715f0
[    5.826377] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment user
[    5.834031] Control: 50c5387d  Table: 136b004a  DAC: 00000055
[    5.839892] Call trace: 
[    5.840018] exit: bf5f1f40 i_ino 190291, index 0 (20419a5e)
[    5.842725] exit: bf5f1f20 i_ino 190291, index 1 (64eb9a49)
[    5.848514] exit: bf5f1f00 i_ino 190291, index 2 (7fc63af4)
[    5.854319] exit: bf5f1ee0 i_ino 190291, index 3 (285ac58c)
[    5.860177] exit: bf5f1a40 i_ino 190291, index 4 (63f2218c)
[    5.865901] exit: bf5f1a20 i_ino 190291, index 5 (d2cc83a9)
[    5.871722] exit: bf5f1a00 i_ino 190291, index 6 (fe13cf51)
[    5.877463] exit: bf5f19e0 i_ino 190291, index 7 (a4994a5f)
[    5.883300] exit: bf5f19c0 i_ino 190291, index 8 (9e8ba792)
[    5.889025] exit: bf5f19a0 i_ino 190291, index 9 (902d97fe)
[    5.894850] exit: bf5f1980 i_ino 190291, index 10 (60b7ab45)
[    5.900658] exit: bf5f1960 i_ino 190291, index 11 (55814486)
[    5.906652] exit: bf5f1940 i_ino 190291, index 12 (717aa17d)
[    5.912540] exit: bf5f1ca0 i_ino 190291, index 13 (36a0d885)
[    5.918426] exit: bf5f1c80 i_ino 190291, index 14 (8890a118)
[    5.924260] exit: bf5f1c60 i_ino 190291, index 15 (d48cbaf9)
[    5.930299] exit: bf5f1c40 i_ino 190291, index 16 (940857ad)
[    5.936157] exit: bf5f1c20 i_ino 190291, index 17 (bd0e7a43)
[    5.942062] exit: bf5f1c00 i_ino 190291, index 18 (dec8eb5c)
[    5.947890] exit: bf5f1be0 i_ino 190291, index 19 (6e7792a7)
[    5.953840] exit: bf5f1bc0 i_ino 190291, index 20 (97b42709)
[    5.959670] exit: bf5f1ba0 i_ino 190291, index 21 (29751a32)
[    5.965569] exit: bf5f1b80 i_ino 190291, index 22 (eeea8a30)
[    5.971399] exit: bf5f1b60 i_ino 190291, index 23 (a86b83ad)
[    5.977273] exit: bf5f1b40 i_ino 190291, index 24 (2535a069)
[    5.983145] exit: bf5f1b20 i_ino 190291, index 25 (98287e49)
[    5.989021] exit: bf5f1b00 i_ino 190291, index 26 (64b12fc2)
[    6.007435] exit: bf5f1ae0 i_ino 190291, index 27 (de4b4264)
[    6.007507] exit: bf5f1ac0 i_ino 190291, index 28 (7881835d)
[    6.013353] exit: bf5f1aa0 i_ino 190291, index 29 (80d1e247)
[    6.019169] exit: bf5f1fc0 i_ino 868416, index 0 (7795d697)
[    6.025058] exit: bf5f1fa0 i_ino 868416, index 1 (e09f25c3)
[    6.030896] exit: bf5f1f80 i_ino 868416, index 2 (88265a45)
[    6.036740] exit: bf5f1f60 i_ino 868416, index 3 (2b4319d2)
[    6.042504] exit: bf5f1ea0 i_ino 868416, index 4 (7ce0249e)
[    6.048309] exit: bf5f1e80 i_ino 868416, index 5 (d832cf73)
[    6.054132] exit: bf5f1e60 i_ino 868416, index 6 (aa9da9e7)
[    6.060033] exit: bf5f1e40 i_ino 868416, index 7 (372b935)
[    6.065827] exit: bf5f1e20 i_ino 868416, index 8 (3ebcefe7)
[    6.071554] exit: bf5f1e00 i_ino 868416, index 9 (12adb98e)
[    6.077300] exit: bf5f1de0 i_ino 868416, index 10 (e8b33507)
[    6.083161] exit: bf5f1dc0 i_ino 868416, index 11 (72cdfbb)
[    6.088985] exit: bf5f1da0 i_ino 868416, index 12 (a4856fd6)
[    6.094799] exit: bf5f1d80 i_ino 868416, index 13 (d027d81e)
[    6.100644] exit: bf5f1d60 i_ino 868416, index 14 (307b732a)
[    6.106519] exit: bf5f1d40 i_ino 868416, index 15 (39882425)
[    6.112381] exit: bf5f1d20 i_ino 868416, index 16 (7f303847)
[    6.118273] exit: bf5f1d00 i_ino 868416, index 17 (7e903556)
[    6.124159] exit: bf5f1ce0 i_ino 868416, index 18 (e3449d72)
[    6.130080] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    6.143641] Dumping ftrace buffer:
[    6.147131]    (ftrace buffer empty)
[    6.170722] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

Cheers,
Stefan

On 21.01.25 04:33, Gao Xiang wrote:
> 
> 
> On 2025/1/21 11:27, Gao Xiang wrote:
>>
>>
>> On 2025/1/21 01:36, Stefan Kerkmann wrote:
>>> Hi Gao,
>>>
>>> I have enabled KASAN and applied your requested changes, but nothing
>>> suspicious happened.
>>
>> Sigh...
>>
>>>
>>>> - Could we get the exact file offset of `init` which init process is
>>>>    crashed?  It will help us to chase down the the primary scene.
>>>
>>> I'll try to track that down. If you have any hints how to-do that let me
>>> know :-).
>>
>> Many thanks for the test...
>> I just hacked some code but un-tested as below:
>>
>> diff --git a/kernel/exit.c b/kernel/exit.c
>> index 1dcddfe537ee..868fea16732f 100644
>> --- a/kernel/exit.c
>> +++ b/kernel/exit.c
>> @@ -873,6 +873,8 @@ static void synchronize_group_exit(struct task_struct
>> *tsk, long code)
>>       spin_unlock_irq(&sighand->siglock);
>>   }
>>
>> +extern struct inode *erofs_iget(struct super_block *sb, u64 nid);
>> +
>>   void __noreturn do_exit(long code)
>>   {
>>       struct task_struct *tsk = current;
>> @@ -903,9 +905,59 @@ void __noreturn do_exit(long code)
>>            * If the last thread of global init has exited, panic
>>            * immediately to get a useable coredump.
>>            */
>> -        if (unlikely(is_global_init(tsk)))
>> +        if (unlikely(is_global_init(tsk))) {
>> +            struct path path;
>> +            struct inode *inode;
>> +
>> +            get_fs_pwd(tsk->fs, &path);
>> +
>> +            inode = d_inode(path.dentry);
>> +            if (inode && inode->i_sb->s_magic == EROFS_SUPER_MAGIC_V1) {
>> +                struct inode *inode;
>> +                int i = 0;
>> +
>> +                inode = erofs_iget(inode->i_sb, 190291);
>> +                if (IS_ERR(inode))
>> +                    goto skip;
>> +
>> +                for (i = 0; i < 30; ++i) {
>> +                    struct page *page = find_get_page(inode->i_mapping, i);
>> +                    void *data;
>> +
>> +                    if (!page)
>> +                        continue;
>> +                    data = kmap_local_page(page);
>> +
>> +                    hash = fnv_32_buf(data, PAGE_SIZE, FNV1_32_INIT);
>> +                    pr_err("%px i_ino %lu, index %lu dst %px (%x) err %d",
>> +                           page, page->mapping->host->i_ino, i, ptr, hash);
> 
> maybe use some different style in this print message:
> 
>         "exit: %px i_ino %lu, index %lu dst %px (%x)"
> 
> likewise.
> 
> Anyway, it's somewhat hack code, just wonder if it works, and
> the output is helpful for us to know which page is corrupt.
> 
> 
>> +                    kunmap_local(data);
>> +                }
>> +                iput(inode);
>> +
>> +                inode = erofs_iget(inode->i_sb, 868416);
>> +                if (IS_ERR(inode))
>> +                    goto skip;
>> +
>> +                for (i = 0; i < 19; ++i) {
>> +                    struct page *page = find_get_page(inode->i_mapping, i);
>> +                    void *data;
>> +
>> +                    if (!page)
>> +                        continue;
>> +                    data = kmap_local_page(page);
>> +                    hash = fnv_32_buf(data, PAGE_SIZE, FNV1_32_INIT);
>> +                    pr_err("%px i_ino %lu, index %lu dst %px (%x) err %d",
>> +                           page, page->mapping->host->i_ino, i, ptr, hash);
>> +                    kunmap_local(data);
>> +                }
>> +                iput(inode);
>> +            }
>> +skip:
>>               panic("Attempted to kill init! exitcode=0x%08x\n",
>>                   tsk->signal->group_exit_code ?: (int)code);
>> +        }
>> +
>>
>>   #ifdef CONFIG_POSIX_TIMERS
>>           hrtimer_cancel(&tsk->signal->real_timer);
>>
>> You could follow the idea to dump the page cache data when init
>> is killed, I wonder the output...
>>
>>
>> Thanks,
>> Gao Xiang
> 
> 

-- 
Pengutronix e.K.                       | Stefan Kerkmann             |
Steuerwalder Str. 21                   | https://www.pengutronix.de/ |
31137 Hildesheim, Germany              | Phone: +49-5121-206917-128  |
Amtsgericht Hildesheim, HRA 2686       | Fax:   +49-5121-206917-9    |


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [bug report] data corruption of init process
  2025-01-21 17:21               ` Stefan Kerkmann
@ 2025-01-22  1:41                 ` Gao Xiang
  0 siblings, 0 replies; 11+ messages in thread
From: Gao Xiang @ 2025-01-22  1:41 UTC (permalink / raw)
  To: Stefan Kerkmann, linux-erofs



On 2025/1/22 01:21, Stefan Kerkmann wrote:
> Hi Gao,
> 
> I have applied your patch (with minor corrections) and here is the output. I haven't had the time today to look deeper into it unfortunately.
> 
> [    4.765049] erofs: (device mmcblk3p3): mounted with root inode @ nid 36.
> [    4.772082] VFS: Mounted root (erofs filesystem) readonly on device 179:3.
> [    4.779155] devtmpfs: mounted
> [    4.792432] Freeing unused kernel image (initmem) memory: 1024K
> [    4.798909] Run /sbin/init as init process
> [    4.803219]   with arguments:
> [    4.806345]     /sbin/init
> [    4.809168]   with environment:
> [    4.812526]     HOME=/
> [    4.814998]     TERM=linux
> [    4.821205] vfs_open: /usr/lib/systemd/systemd
> [    4.827746] erofs: (device mmcblk3p3): lz4        : src c1002000 dst: c1000000 in: 4096b (eec708e7, bf5f1f80, 2) out: 8859b (3bfdda11)
> [    4.840164] erofs: bf5f1fc0 i_ino 868416, index 0 dst 810fe000 (7795d697) err 0
> [    4.847766] erofs: bf5f1fa0 i_ino 868416, index 1 dst 810fd000 (e09f25c3) err 0
> [    4.862091] erofs: (device mmcblk3p3): lz4        : src c1005000 dst: c100429b in: 4096b (76037b0d, bf5f1f60, 3) out: 5168b (79840434)
> [    4.874456] erofs: bf5f1f80 i_ino 868416, index 2 dst 810fc000 (88265a45) err 0
> [    4.882098] erofs: (device mmcblk3p3): lz4 partial: src 82cbd000 dst: 810fb6cb in: 4096b (45bf72c3, bf6297a0, 6462) out: 2357b (6e052dd5)
> [    4.894729] erofs: bf5f1f60 i_ino 868416, index 3 dst 810fb000 (2b4319d2) err 0
> [    4.903346] vfs_open: /usr/lib/ld-linux-armhf.so.3
> [    4.909853] erofs: (device mmcblk3p3): lz4        : src c1007000 dst: c1006000 in: 4096b (e4b39a2, bf5f1f20, 1) out: 4907b (aa05f0a3)
> [    4.922134] erofs: bf5f1f40 i_ino 190291, index 0 dst 810fa000 (20419a5e) err 0
> [    4.929813] erofs: (device mmcblk3p3): lz4        : src c1009000 dst: c100832b in: 4096b (717fc925, bf5f1f00, 2) out: 4246b (c0f62dca)
> [    4.942938] erofs: (device mmcblk3p3): lz4        : src 82cbd000 dst: c100a6cb in: 4096b (45bf72c3, bf6297a0, 6462) out: 6376b (dfcc8264)
> [    4.955668] erofs: bf5f1f20 i_ino 190291, index 1 dst 810f9000 (64eb9a49) err 0
> [    4.963321] erofs: (device mmcblk3p3): lz4        : src c100d000 dst: c100c3c1 in: 4096b (8030d189, bf5f1ee0, 3) out: 4292b (1df48c5f)
> [    4.975678] erofs: bf5f1f00 i_ino 190291, index 2 dst 810f8000 (7fc63af4) err 0
> [    4.983363] erofs: (device mmcblk3p3): lz4 partial: src 830a8000 dst: 810f7485 in: 4096b (17ce8f99, bf631500, 1493) out: 2939b (a1ab12cf)
> [    4.995957] erofs: bf5f1ee0 i_ino 190291, index 3 dst 810f7000 (285ac58c) err 0
> [    5.007086] erofs: (device mmcblk3p3): lz4        : src c1010000 dst: c100efb3 in: 4096b (74af795c, bf5f1e60, 6) out: 4651b (46c58dd7)
> [    5.019455] erofs: bf5f1ea0 i_ino 868416, index 4 dst 810f5000 (7ce0249e) err 0
> [    5.027040] erofs: bf5f1e80 i_ino 868416, index 5 dst 810f4000 (d832cf73) err 0
> [    5.034641] erofs: (device mmcblk3p3): lz4        : src c1013000 dst: c10121de in: 4096b (d65a3a49, bf5f1e40, 7) out: 5360b (4364e0fc)
> [    5.046970] erofs: bf5f1e60 i_ino 868416, index 6 dst 810f3000 (aa9da9e7) err 0
> [    5.054649] erofs: (device mmcblk3p3): lz4        : src c1015000 dst: c10146ce in: 4096b (db73bb75, bf5f1e20, 8) out: 4606b (c0a54f50)
> [    5.067063] erofs: bf5f1e40 i_ino 868416, index 7 dst 810f2000 (372b935) err 0
> [    5.074721] erofs: (device mmcblk3p3): lz4        : src c1017000 dst: c10168cc in: 4096b (be653c3d, bf5f1e00, 9) out: 4536b (10b3a4d0)
> [    5.087070] erofs: bf5f1e20 i_ino 868416, index 8 dst 810f1000 (3ebcefe7) err 0
> [    5.094683] erofs: (device mmcblk3p3): lz4        : src c1019000 dst: c1018a84 in: 4096b (8cd3cff3, bf5f1de0, 10) out: 4285b (541c02fb)
> [    5.107120] erofs: bf5f1e00 i_ino 868416, index 9 dst 810f0000 (12adb98e) err 0
> [    5.114832] erofs: (device mmcblk3p3): lz4        : src c101b000 dst: c101ab41 in: 4096b (b885e4f7, bf5f1dc0, 11) out: 4789b (af1820d3)
> [    5.127409] erofs: bf5f1de0 i_ino 868416, index 10 dst 810ef000 (e8b33507) err 0
> [    5.143657] erofs: (device mmcblk3p3): lz4        : src c101e000 dst: c101cdf6 in: 4096b (3b4e9357, bf5f1d80, 13) out: 6216b (6a149c5)
> [    5.156017] erofs: bf5f1dc0 i_ino 868416, index 11 dst 810ee000 (72cdfbb) err 0
> [    5.163505] erofs: bf5f1da0 i_ino 868416, index 12 dst 810ed000 (a4856fd6) err 0
> [    5.171330] erofs: (device mmcblk3p3): lz4        : src c1022000 dst: c102063e in: 4096b (a3bdbd0e, bf5f1d40, 15) out: 8015b (63d1fbc1)
> [    5.183762] erofs: bf5f1d80 i_ino 868416, index 13 dst 810ec000 (d027d81e) err 0
> [    5.191414] erofs: bf5f1d60 i_ino 868416, index 14 dst 810eb000 (307b732a) err 0
> [    5.199108] erofs: (device mmcblk3p3): lz4        : src c1025000 dst: c102458d in: 4096b (480285a7, bf5f1d20, 16) out: 6603b (822f8de0)
> [    5.211544] erofs: bf5f1d40 i_ino 868416, index 15 dst 810ea000 (39882425) err 0
> [    5.219253] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1026f58 in: 1839b (4f637f42, bf5f1d00, 17) out: 5780b (55fe911f)
> [    5.231687] erofs: bf5f1d20 i_ino 868416, index 16 dst 810e9000 (7f303847) err 0
> [    5.239317] erofs: bf5f1d00 i_ino 868416, index 17 dst 810e8000 (7e903556) err 0
> [    5.246960] erofs: bf5f1ce0 i_ino 868416, index 18 dst 810e7000 (e3449d72) err 0
> [    5.262766] erofs: (device mmcblk3p3): lz4        : src 830ab000 dst: c102acc6 in: 4096b (cd2f4c7c, bf631560, 1502) out: 4175b (3bf4f1a9)
> [    5.275485] erofs: (device mmcblk3p3): lz4        : src c102d000 dst: c102cd15 in: 4096b (8e87c14d, bf5f1c80, 14) out: 4288b (6a251e64)
> [    5.287917] erofs: bf5f1ca0 i_ino 190291, index 13 dst 810e5000 (36a0d885) err 0
> [    5.295657] erofs: (device mmcblk3p3): lz4        : src c102f000 dst: c102edd5 in: 4096b (31a2e179, bf5f1c60, 15) out: 4257b (3e19e451)
> [    5.308098] erofs: bf5f1c80 i_ino 190291, index 14 dst 810e4000 (8890a118) err 0
> [    5.315759] erofs: (device mmcblk3p3): lz4        : src c0b49000 dst: c1030e76 in: 4096b (65fa2fbe, bf5f1c40, 16) out: 4460b (ebe0126c)
> [    5.328237] erofs: bf5f1c60 i_ino 190291, index 15 dst 810e3000 (d48cbaf9) err 0
> [    5.335963] erofs: (device mmcblk3p3): lz4        : src c1034000 dst: c1032fe2 in: 4096b (37a8bad1, bf5f1c00, 18) out: 4349b (c125197)
> [    5.348311] erofs: bf5f1c40 i_ino 190291, index 16 dst 810e2000 (940857ad) err 0
> [    5.355943] erofs: bf5f1c20 i_ino 190291, index 17 dst 810e1000 (bd0e7a43) err 0
> [    5.363673] erofs: (device mmcblk3p3): lz4        : src c1037000 dst: c10360df in: 4096b (8d172a42, bf5f1be0, 19) out: 4353b (1503ff28)
> [    5.376111] erofs: bf5f1c00 i_ino 190291, index 18 dst 810e0000 (dec8eb5c) err 0
> [    5.383781] erofs: (device mmcblk3p3): lz4        : src c1039000 dst: c10381e0 in: 4096b (1ef07e2b, bf5f1bc0, 20) out: 4869b (c3bf758b)
> [    5.396214] erofs: bf5f1be0 i_ino 190291, index 19 dst 810df000 (6e7792a7) err 0
> [    5.403964] erofs: (device mmcblk3p3): lz4        : src c103b000 dst: c103a4e5 in: 4096b (f4462dc1, bf5f1ba0, 21) out: 5484b (9b35c90f)
> [    5.416397] erofs: bf5f1bc0 i_ino 190291, index 20 dst 810de000 (97b42709) err 0
> [    5.424162] erofs: (device mmcblk3p3): lz4        : src c103e000 dst: c103ca51 in: 4096b (2ac6b4d5, bf5f1b60, 23) out: 5985b (94cc0d29)
> [    5.436597] erofs: bf5f1ba0 i_ino 190291, index 21 dst 810dd000 (29751a32) err 0
> [    5.444168] erofs: bf5f1b80 i_ino 190291, index 22 dst 810dc000 (eeea8a30) err 0
> [    5.451965] erofs: (device mmcblk3p3): lz4        : src c1041000 dst: c10401b2 in: 4096b (90757c3c, bf5f1b40, 24) out: 6356b (58df129b)
> [    5.464395] erofs: bf5f1b60 i_ino 190291, index 23 dst 810db000 (a86b83ad) err 0
> [    5.472176] erofs: (device mmcblk3p3): lz4        : src c1044000 dst: c1042a86 in: 4096b (971b791e, bf5f1b00, 26) out: 6045b (3a6bbefa)
> [    5.484610] erofs: bf5f1b40 i_ino 190291, index 24 dst 810da000 (2535a069) err 0
> [    5.492246] erofs: bf5f1b20 i_ino 190291, index 25 dst 810d9000 (98287e49) err 0
> [    5.500043] erofs: (device mmcblk3p3): lz4        : src c1048000 dst: c1046223 in: 4096b (9804bc65, bf5f1ac0, 28) out: 10510b (2a60a723)
> [    5.512834] erofs: bf5f1b00 i_ino 190291, index 26 dst 810d8000 (64b12fc2) err 0
> [    5.520495] erofs: bf5f1ae0 i_ino 190291, index 27 dst 810d7000 (de4b4264) err 0
> [    5.528179] erofs: (device mmcblk3p3): lz4        : src 830aca35 dst: c104ab31 in: 1483b (5c99618c, bf631580, 0) out: 4759b (b53e5caa)
> [    5.540810] erofs: bf5f1ac0 i_ino 190291, index 28 dst 810d6000 (7881835d) err 0
> [    5.548449] erofs: bf5f1aa0 i_ino 190291, index 29 dst 810d5000 (80d1e247) err 0
> [    5.560729] erofs: (device mmcblk3p3): lz4        : src 830a8000 dst: c104c485 in: 4096b (17ce8f99, bf631500, 1493) out: 4289b (7dbbff69)
> [    5.573541] erofs: (device mmcblk3p3): lz4 partial: src 830ab000 dst: 810cacc6 in: 4096b (cd2f4c7c, bf631560, 1502) out: 826b (21762da4)
> [    5.591796] erofs: (device mmcblk3p3): lz4        : src c104f000 dst: c104e546 in: 4096b (e286b2b, bf5f1a20, 5) out: 4207b (ec8e3f58)
> [    5.604130] erofs: bf5f1a40 i_ino 190291, index 4 dst 810d2000 (63f2218c) err 0
> [    5.611835] erofs: (device mmcblk3p3): lz4        : src c1051000 dst: c10505b5 in: 4096b (e698fd35, bf5f1a00, 6) out: 4291b (fcf580f8)
> [    5.624404] erofs: bf5f1a20 i_ino 190291, index 5 dst 810d1000 (d2cc83a9) err 0
> [    5.632158] erofs: (device mmcblk3p3): lz4        : src c1053000 dst: c1052678 in: 4096b (4859aa8f, bf5f19e0, 7) out: 4297b (ab8a8574)
> [    5.644522] erofs: bf5f1a00 i_ino 190291, index 6 dst 810d0000 (fe13cf51) err 0
> [    5.652188] erofs: (device mmcblk3p3): lz4        : src c1055000 dst: c1054741 in: 4096b (997436a4, bf5f19c0, 8) out: 4218b (be0817b8)
> [    5.664551] erofs: bf5f19e0 i_ino 190291, index 7 dst 810cf000 (a4994a5f) err 0
> [    5.672199] erofs: (device mmcblk3p3): lz4        : src c1057000 dst: c10567bb in: 4096b (112a3fda, bf5f19a0, 9) out: 4271b (293ce253)
> [    5.684561] erofs: bf5f19c0 i_ino 190291, index 8 dst 810ce000 (9e8ba792) err 0
> [    5.692214] erofs: (device mmcblk3p3): lz4        : src c1059000 dst: c105886a in: 4096b (fa3410b9, bf5f1980, 10) out: 4673b (7f7a9871)
> [    5.704675] erofs: bf5f19a0 i_ino 190291, index 9 dst 810cd000 (902d97fe) err 0
> [    5.712242] erofs: (device mmcblk3p3): lz4        : src c105b000 dst: c105aaab in: 4096b (634b03ca, bf5f1960, 11) out: 4477b (cf289eb)
> [    5.724628] erofs: bf5f1980 i_ino 190291, index 10 dst 810cc000 (60b7ab45) err 0
> [    5.732329] 8<--- cut here ---
> [    5.735476] init: unhandled page fault (11) at 0x6f532180, code 0x005
> [    5.742271] erofs: (device mmcblk3p3): lz4        : src 830ac000 dst: c105cc28 in: 4096b (163cdf49, bf631580, 0) out: 4254b (998b1f98)
> [    5.754643] erofs: bf5f1960 i_ino 190291, index 11 dst 810cb000 (55814486) err 0
> [    5.762301] erofs: bf5f1940 i_ino 190291, index 12 dst 810ca000 (717aa17d) err 0
> [    5.769871] [6f532180] *pgd=00000000
> [    5.773686] CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 6.12.10-00014-g1f2f4d02b240-dirty #117
> [    5.782503] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [    5.789264] PC is at 0x76f5cc86
> [    5.792568] LR is at 0x76f632a5
> [    5.795806] pc : [<76f5cc86>]    lr : [<76f632a5>]    psr: 20001430
> [    5.802270] sp : 7e8ece68  ip : 76f71000  fp : 00000016
> [    5.807603] r10: 76f53000  r9 : 76f715f0  r8 : 76f70ce0
> [    5.813037] r7 : 7e8ece80  r6 : 76f71000  r5 : 00000003  r4 : 76f53148
> [    5.819743] r3 : 00000008  r2 : 6f532180  r1 : 00000001  r0 : 76f715f0
> [    5.826377] Flags: nzCv  IRQs on  FIQs on  Mode USER_32  ISA Thumb  Segment user
> [    5.834031] Control: 50c5387d  Table: 136b004a  DAC: 00000055
> [    5.839892] Call trace:
> [    5.840018] exit: bf5f1f40 i_ino 190291, index 0 (20419a5e)
> [    5.842725] exit: bf5f1f20 i_ino 190291, index 1 (64eb9a49)
> [    5.848514] exit: bf5f1f00 i_ino 190291, index 2 (7fc63af4)
> [    5.854319] exit: bf5f1ee0 i_ino 190291, index 3 (285ac58c)
> [    5.860177] exit: bf5f1a40 i_ino 190291, index 4 (63f2218c)
> [    5.865901] exit: bf5f1a20 i_ino 190291, index 5 (d2cc83a9)
> [    5.871722] exit: bf5f1a00 i_ino 190291, index 6 (fe13cf51)
> [    5.877463] exit: bf5f19e0 i_ino 190291, index 7 (a4994a5f)
> [    5.883300] exit: bf5f19c0 i_ino 190291, index 8 (9e8ba792)
> [    5.889025] exit: bf5f19a0 i_ino 190291, index 9 (902d97fe)
> [    5.894850] exit: bf5f1980 i_ino 190291, index 10 (60b7ab45)
> [    5.900658] exit: bf5f1960 i_ino 190291, index 11 (55814486)
> [    5.906652] exit: bf5f1940 i_ino 190291, index 12 (717aa17d)
> [    5.912540] exit: bf5f1ca0 i_ino 190291, index 13 (36a0d885)
> [    5.918426] exit: bf5f1c80 i_ino 190291, index 14 (8890a118)
> [    5.924260] exit: bf5f1c60 i_ino 190291, index 15 (d48cbaf9)
> [    5.930299] exit: bf5f1c40 i_ino 190291, index 16 (940857ad)
> [    5.936157] exit: bf5f1c20 i_ino 190291, index 17 (bd0e7a43)
> [    5.942062] exit: bf5f1c00 i_ino 190291, index 18 (dec8eb5c)
> [    5.947890] exit: bf5f1be0 i_ino 190291, index 19 (6e7792a7)
> [    5.953840] exit: bf5f1bc0 i_ino 190291, index 20 (97b42709)
> [    5.959670] exit: bf5f1ba0 i_ino 190291, index 21 (29751a32)
> [    5.965569] exit: bf5f1b80 i_ino 190291, index 22 (eeea8a30)
> [    5.971399] exit: bf5f1b60 i_ino 190291, index 23 (a86b83ad)
> [    5.977273] exit: bf5f1b40 i_ino 190291, index 24 (2535a069)
> [    5.983145] exit: bf5f1b20 i_ino 190291, index 25 (98287e49)
> [    5.989021] exit: bf5f1b00 i_ino 190291, index 26 (64b12fc2)
> [    6.007435] exit: bf5f1ae0 i_ino 190291, index 27 (de4b4264)
> [    6.007507] exit: bf5f1ac0 i_ino 190291, index 28 (7881835d)
> [    6.013353] exit: bf5f1aa0 i_ino 190291, index 29 (80d1e247)
> [    6.019169] exit: bf5f1fc0 i_ino 868416, index 0 (7795d697)
> [    6.025058] exit: bf5f1fa0 i_ino 868416, index 1 (e09f25c3)
> [    6.030896] exit: bf5f1f80 i_ino 868416, index 2 (88265a45)
> [    6.036740] exit: bf5f1f60 i_ino 868416, index 3 (2b4319d2)
> [    6.042504] exit: bf5f1ea0 i_ino 868416, index 4 (7ce0249e)
> [    6.048309] exit: bf5f1e80 i_ino 868416, index 5 (d832cf73)
> [    6.054132] exit: bf5f1e60 i_ino 868416, index 6 (aa9da9e7)
> [    6.060033] exit: bf5f1e40 i_ino 868416, index 7 (372b935)
> [    6.065827] exit: bf5f1e20 i_ino 868416, index 8 (3ebcefe7)
> [    6.071554] exit: bf5f1e00 i_ino 868416, index 9 (12adb98e)
> [    6.077300] exit: bf5f1de0 i_ino 868416, index 10 (e8b33507)
> [    6.083161] exit: bf5f1dc0 i_ino 868416, index 11 (72cdfbb)
> [    6.088985] exit: bf5f1da0 i_ino 868416, index 12 (a4856fd6)
> [    6.094799] exit: bf5f1d80 i_ino 868416, index 13 (d027d81e)
> [    6.100644] exit: bf5f1d60 i_ino 868416, index 14 (307b732a)
> [    6.106519] exit: bf5f1d40 i_ino 868416, index 15 (39882425)
> [    6.112381] exit: bf5f1d20 i_ino 868416, index 16 (7f303847)
> [    6.118273] exit: bf5f1d00 i_ino 868416, index 17 (7e903556)
> [    6.124159] exit: bf5f1ce0 i_ino 868416, index 18 (e3449d72)

Just quick parsing, all hashes are correct as expected, very confused...

Thanks,
Gao Xiang

> [    6.130080] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> [    6.143641] Dumping ftrace buffer:
> [    6.147131]    (ftrace buffer empty)
> [    6.170722] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---
> 
> Cheers,
> Stefan


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-01-22  1:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-27 10:44 [bug report] data corruption of init process Stefan Kerkmann
2024-12-27 13:24 ` Gao Xiang
2025-01-19 12:07   ` Stefan Kerkmann
2025-01-19 12:48     ` Gao Xiang
2025-01-20  1:45     ` Gao Xiang
2025-01-20  1:55       ` Gao Xiang
2025-01-20 17:36         ` Stefan Kerkmann
2025-01-21  3:27           ` Gao Xiang
2025-01-21  3:33             ` Gao Xiang
2025-01-21 17:21               ` Stefan Kerkmann
2025-01-22  1:41                 ` Gao Xiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.