Re: f2fs write error Linux v6.2

From: Bagas Sanjaya
Date: Sat Dec 24 2022 - 07:43:48 EST


On Sat, Dec 24, 2022 at 01:48:55PM +0800, Jeff Chua wrote:
> Got the following error in latest linux-6.2-git with just vim (:w
> file1). No problem with linux-6.1.1
>
> 2022-12-22T14:09:51.419409+08:00 [localhost] kernel: BUG: kernel NULL
> pointer dereference, address: 0000000000000024
> 2022-12-22T14:09:51.419422+08:00 [localhost] kernel: #PF: supervisor
> write access in kernel mode
> 2022-12-22T14:09:51.419423+08:00 [localhost] kernel: #PF:
> error_code(0x0002) - not-present page
> 2022-12-22T14:09:51.419424+08:00 [localhost] kernel: PGD 147b63067 P4D
> 147b63067 PUD 177d5c067 PMD 0
> 2022-12-22T14:09:51.419424+08:00 [localhost] kernel: Oops: 0002 [#7] PREEMPT SMP
> 2022-12-22T14:09:51.419428+08:00 [localhost] kernel: CPU: 6 PID: 22891
> Comm: vi Tainted: G UD 6.1.0 #11
> 2022-12-22T14:09:51.419428+08:00 [localhost] kernel: Hardware name:
> LENOVO 21CCS1GL00/21CCS1GL00, BIOS N3AET69W (1.34 ) 12/05/2022
> 2022-12-22T14:09:51.419428+08:00 [localhost] kernel: RIP:
> 0010:f2fs_issue_flush+0x10e/0x180
> 2022-12-22T14:09:51.419429+08:00 [localhost] kernel: Code: ba 01 00 00
> 00 be 03 00 00 00 e8 ad e8 d5 ff 48 83 3b 00 74 1e 48 89 e7 e8 7f c1
> 84 00 f0 ff 4b 24 8b 44 24 2c e9 66 ff ff ff <f0> ff 43 24 e9 4a ff ff
> ff 45 31 ff 4c 87 7b 28 4d 85 ff 74 d6 44
> 2022-12-22T14:09:51.419429+08:00 [localhost] kernel: RSP:
> 0018:ffffc90000b13df0 EFLAGS: 00010246
> 2022-12-22T14:09:51.419430+08:00 [localhost] kernel: RAX:
> ffff888101caccc0 RBX: 0000000000000000 RCX: 0000000000000000
> 2022-12-22T14:09:51.419430+08:00 [localhost] kernel: RDX:
> 0000000010000088 RSI: 000000000005a844 RDI: ffff8881027bf000
> 2022-12-22T14:09:51.419431+08:00 [localhost] kernel: RBP:
> ffff8881027bf000 R08: 0000000000000000 R09: ffff8881027bf2a8
> 2022-12-22T14:09:51.419431+08:00 [localhost] kernel: R10:
> 0000000000000000 R11: 0000000000000000 R12: 0000000000000024
> 2022-12-22T14:09:51.419432+08:00 [localhost] kernel: R13:
> 000000000005a844 R14: 000000000005a844 R15: 0000000000000000
> 2022-12-22T14:09:51.419432+08:00 [localhost] kernel: FS:
> 00007ff03fdf0b80(0000) GS:ffff88883f380000(0000)
> knlGS:0000000000000000
> 2022-12-22T14:09:51.419432+08:00 [localhost] kernel: CS: 0010 DS:
> 0000 ES: 0000 CR0: 0000000080050033
> 2022-12-22T14:09:51.419433+08:00 [localhost] kernel: CR2:
> 0000000000000024 CR3: 000000013d64e006 CR4: 0000000000770ee0
> 2022-12-22T14:09:51.419433+08:00 [localhost] kernel: PKRU: 55555554
> 2022-12-22T14:09:51.419434+08:00 [localhost] kernel: Call Trace:
> 2022-12-22T14:09:51.419434+08:00 [localhost] kernel: <TASK>
> 2022-12-22T14:09:51.419435+08:00 [localhost] kernel: ?
> preempt_count_add+0x63/0x90
> 2022-12-22T14:09:51.419435+08:00 [localhost] kernel: ?
> preempt_count_add+0x63/0x90
> 2022-12-22T14:09:51.419435+08:00 [localhost] kernel: ?
> preempt_count_add+0x63/0x90
> 2022-12-22T14:09:51.419436+08:00 [localhost] kernel:
> f2fs_do_sync_file+0x489/0x650
> 2022-12-22T14:09:51.419436+08:00 [localhost] kernel: __x64_sys_fsync+0x2f/0x60
> 2022-12-22T14:09:51.419437+08:00 [localhost] kernel: do_syscall_64+0x35/0x80
> 2022-12-22T14:09:51.419437+08:00 [localhost] kernel:
> entry_SYSCALL_64_after_hwframe+0x46/0xb0
> 2022-12-22T14:09:51.419438+08:00 [localhost] kernel: RIP: 0033:0x7ff03feef20b
> 2022-12-22T14:09:51.419438+08:00 [localhost] kernel: Code: 3d 00 f0 ff
> ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 a3 a2 f8
> ff 8b 7c 24 0c 41 89 c0 b8 4a 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35
> 44 89 c7 89 44 24 0c e8 01 a3 f8 ff 8b 44
> 2022-12-22T14:09:51.419438+08:00 [localhost] kernel: RSP:
> 002b:00007ffe6ecca530 EFLAGS: 00000293 ORIG_RAX: 000000000000004a
> 2022-12-22T14:09:51.419439+08:00 [localhost] kernel: RAX:
> ffffffffffffffda RBX: 0000000000000001 RCX: 00007ff03feef20b
> 2022-12-22T14:09:51.419439+08:00 [localhost] kernel: RDX:
> 0000000000000002 RSI: 0000000000000002 RDI: 0000000000000003
> 2022-12-22T14:09:51.419440+08:00 [localhost] kernel: RBP:
> 0000000000002000 R08: 0000000000000000 R09: 00000000024bcfb0
> 2022-12-22T14:09:51.419440+08:00 [localhost] kernel: R10:
> fffffffffffff4bf R11: 0000000000000293 R12: 00000000000006b7
> 2022-12-22T14:09:51.419440+08:00 [localhost] kernel: R13:
> 000000000000003d R14: 0000000000000000 R15: 00000000024a1680
> 2022-12-22T14:09:51.419441+08:00 [localhost] kernel: </TASK>
> 2022-12-22T14:09:51.419441+08:00 [localhost] kernel: Modules linked
> in: [last unloaded: ecc]
> 2022-12-22T14:09:51.419442+08:00 [localhost] kernel: CR2: 0000000000000024
> 2022-12-22T14:09:51.419442+08:00 [localhost] kernel: ---[ end trace
> 0000000000000000 ]---
> 2022-12-22T14:09:51.419443+08:00 [localhost] kernel: RIP:
> 0010:f2fs_issue_flush+0x10e/0x180
> 2022-12-22T14:09:51.419443+08:00 [localhost] kernel: Code: ba 01 00 00
> 00 be 03 00 00 00 e8 ad e8 d5 ff 48 83 3b 00 74 1e 48 89 e7 e8 7f c1
> 84 00 f0 ff 4b 24 8b 44 24 2c e9 66 ff ff ff <f0> ff 43 24 e9 4a ff ff
> ff 45 31 ff 4c 87 7b 28 4d 85 ff 74 d6 44
> 2022-12-22T14:09:51.419443+08:00 [localhost] kernel: RSP:
> 0018:ffffc90003903df0 EFLAGS: 00010246
> 2022-12-22T14:09:51.419444+08:00 [localhost] kernel: RAX:
> ffff888100106d80 RBX: 0000000000000000 RCX: 0000000000000000
> 2022-12-22T14:09:51.419444+08:00 [localhost] kernel: RDX:
> 0000000010000088 RSI: 0000000000b0e2ba RDI: ffff888116227000
> 2022-12-22T14:09:51.419445+08:00 [localhost] kernel: RBP:
> ffff888116227000 R08: 0000000000000000 R09: ffff8881162272a8
> 2022-12-22T14:09:51.419445+08:00 [localhost] kernel: R10:
> 0000000000000000 R11: 0000000000000000 R12: 0000000000000024
> 2022-12-22T14:09:51.419445+08:00 [localhost] kernel: R13:
> 0000000000b0e2ba R14: 0000000000b0e2ba R15: 0000000000000000
> 2022-12-22T14:09:51.419446+08:00 [localhost] kernel: FS:
> 00007ff03fdf0b80(0000) GS:ffff88883f380000(0000)
> knlGS:0000000000000000
> 2022-12-22T14:09:51.419446+08:00 [localhost] kernel: CS: 0010 DS:
> 0000 ES: 0000 CR0: 0000000080050033
> 2022-12-22T14:09:51.419446+08:00 [localhost] kernel: CR2:
> 0000000000000024 CR3: 000000013d64e006 CR4: 0000000000770ee0
> 2022-12-22T14:09:51.419447+08:00 [localhost] kernel: PKRU: 55555554

Thanks for the report! I'm adding this to regzbot:

#regzbot ^introduced v6.1.1..v6.2
#regzbot title f2fs: kernel NULL pointer dereference when writing file

--
An old man doll... just what I always wanted! - Clara

Attachment: signature.asc
Description: PGP signature