kernel BUG in notify_change

Status: fixed on 2023/08/02 14:36
Reported-by: syzbot+fcb6592762d7a9ae57f0@syzkaller.appspotmail.com
Fix commit: f8c9fae0076e ANDROID: incfs: Add check for ATTR_KILL_SUID and ATTR_MODE in incfs_setattr
First crash: 1502d, last: 1471d
Cause bisection: the cause commit could be any of (bisect log):
commit 58bf0c328828d0bd8b32e76050c5dd647b53b495
Author: Keoseong Park <keosung.park@samsung.com>
Date: Mon Sep 27 06:06:48 2021 +0000

  f2fs: fix to use WHINT_MODE

commit 9fc4794bc551667c2b20f933e485fc2238f11bfd
Author: Gao Xiang <hsiangkao@linux.alibaba.com>
Date: Tue Sep 21 14:37:30 2021 +0000

  f2fs: fix up f2fs_lookup tracepoints

commit b4c06c0fba87f4fb71977333ae087fb291804788
Author: Chao Yu <chao@kernel.org>
Date: Tue Sep 28 19:19:14 2021 +0000

  f2fs: fix wrong condition to trigger background checkpoint correctly

commit 241a9657dda59177e40882dbbb3e0a7eaa09670e
Author: Weichao Guo <guoweichao@oppo.com>
Date: Sat Sep 18 12:46:36 2021 +0000

  f2fs: set SBI_NEED_FSCK flag when inconsistent node block found

commit de9f6680a24a488ec6b7e615b06bc1f4909b2091
Author: Daeho Jeong <daehojeong@google.com>
Date: Wed Oct 6 17:49:10 2021 +0000

  f2fs: include non-compressed blocks in compr_written_block

commit 6d774f233dbd2174c64583103cdaa5f96bb28b50
Author: Chao Yu <chao@kernel.org>
Date: Thu Sep 16 09:09:03 2021 +0000

  f2fs: introduce excess_dirty_threshold()

commit 8698114aad34da9d02a851e0f5908e9633ad71ea
Author: Qing Wang <wangqing@vivo.com>
Date: Wed Oct 13 03:29:04 2021 +0000

  f2fs: replace snprintf in show functions with sysfs_emit

commit 1edfc9e068ccdf46fb7819bfc9c8485d9d1b1360
Author: Chao Yu <chao@kernel.org>
Date: Wed Sep 1 08:06:21 2021 +0000

  f2fs: avoid attaching SB_ACTIVE flag during mount

commit 5f8b2e61df4a04888eefab2ac76e8ce103d0e465
Author: Daeho Jeong <daehojeong@google.com>
Date: Wed Sep 29 18:12:03 2021 +0000

  f2fs: introduce fragment allocation mode mount option

commit 3ca2d068d5a4b531c90fe3b54c2932a7f5709f45
Author: Chao Yu <chao@kernel.org>
Date: Wed Sep 1 06:39:20 2021 +0000

  f2fs: multidevice: support direct IO

commit 721e9cc848c473a13d20496be8337bd1dd19bdef
Author: Chao Yu <chao@kernel.org>
Date: Fri Sep 3 02:38:11 2021 +0000

  f2fs: quota: fix potential deadlock

commit 17d4b0d96b3b4f5c6cdb0b412f32762d471ed3b5
Author: Fengnan Chang <changfengnan@vivo.com>
Date: Sat Oct 23 03:08:00 2021 +0000

  f2fs: compress: fix overwrite may reduce compress ratio unproperly

commit e0cb7a15f47aa5233c4cfa13b887eeb0ffcc2794
Author: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Tue Sep 7 17:24:21 2021 +0000

  f2fs: should use GFP_NOFS for directory inodes

commit 4c7449b48bb67c07a8a1fd35edad8f6c5c384bd6
Author: Hyeong-Jun Kim <hj514.kim@samsung.com>
Date: Wed Oct 27 04:16:00 2021 +0000

  f2fs: compress: disallow disabling compress on non-empty compressed file
▶ ▼ Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 kernel BUG in notify_change (2) -1 syz, C error 2 1677d 1677d 0/2 closed as invalid on 2022/05/06 17:34
android-5-10 kernel BUG in notify_change (3) -1 syz, C error 2 1557d 1557d 2/2 fixed on 2022/10/03 16:13
android-5-10 kernel BUG in notify_change -1 syz, C error 3 1744d 1803d 2/2 fixed on 2022/03/05 17:38
android-54 kernel BUG in notify_change -1 syz, C 18 1555d 2098d 2/2 fixed on 2022/09/20 15:04
▶ ▼ Last patch testing requests (1)
Created Duration User Patch Repo Result
2022/11/23 10:36 16m jun.nie@linaro.org patch android13-5.15-lts OK log
▶ ▼ Fix bisection attempts (1)
Created Duration User Patch Repo Result
2022/11/17 03:43 19m bisect fix android13-5.15-lts OK (0) job log log

Sample crash report:
kernel BUG at fs/attr.c:377!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 412 Comm: syz-executor879 Not tainted 5.15.73-syzkaller-04348-g44b8b2ac1d96 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
RIP: 0010:notify_change+0x103e/0x1040 fs/attr.c:377
Code: f0 ff e9 61 fa ff ff 44 89 e1 80 e1 07 80 c1 03 38 c1 0f 8c 79 f5 ff ff 4c 89 e7 e8 2c 12 f0 ff e9 6c f5 ff ff e8 92 c5 ad ff <0f> 0b 55 48 89 e5 41 57 41 56 41 55 41 54 53 50 41 89 f4 49 89 fd
RSP: 0018:ffffc900002cfaf0 EFLAGS: 00010293
RAX: ffffffff81c3cbfe RBX: 0000000000001847 RCX: ffff8881071813c0
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc900002cfb78 R08: ffffffff81c3c198 R09: ffffc900002cfa60
R10: fffff52000059f4e R11: 1ffff92000059f4c R12: ffffc900002cfd40
R13: ffff88811e069cc0 R14: dffffc0000000000 R15: 0000000000000001
FS:  0000555555d6b300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000100 CR3: 000000011f755000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 incfs_setattr+0x238/0x3c0 fs/incfs/vfs.c:1628
 notify_change+0xd8f/0x1040 fs/attr.c:426
 chown_common+0x526/0x7e0 fs/open.c:681
 do_fchownat+0x175/0x250 fs/open.c:712
 __do_sys_chown fs/open.c:732 [inline]
 __se_sys_chown fs/open.c:730 [inline]
 __x64_sys_chown+0x82/0x90 fs/open.c:730
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f0aecbc2ba9
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd8da001a8 EFLAGS: 00000246 ORIG_RAX: 000000000000005c
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f0aecbc2ba9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000300
RBP: 2f30656c69662f2e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0aecb86de0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 81a5101ef8a25cb2 ]---
RIP: 0010:notify_change+0x103e/0x1040 fs/attr.c:377
Code: f0 ff e9 61 fa ff ff 44 89 e1 80 e1 07 80 c1 03 38 c1 0f 8c 79 f5 ff ff 4c 89 e7 e8 2c 12 f0 ff e9 6c f5 ff ff e8 92 c5 ad ff <0f> 0b 55 48 89 e5 41 57 41 56 41 55 41 54 53 50 41 89 f4 49 89 fd
RSP: 0018:ffffc900002cfaf0 EFLAGS: 00010293
RAX: ffffffff81c3cbfe RBX: 0000000000001847 RCX: ffff8881071813c0
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc900002cfb78 R08: ffffffff81c3c198 R09: ffffc900002cfa60
R10: fffff52000059f4e R11: 1ffff92000059f4c R12: ffffc900002cfd40
R13: ffff88811e069cc0 R14: dffffc0000000000 R15: 0000000000000001
FS:  0000555555d6b300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000100 CR3: 000000011f755000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/10/16 15:28 android13-5.15-lts 44b8b2ac1d96 67cb024c .config strace log report syz C [disk image] [vmlinux] ci2-android-5-15 kernel BUG in notify_change
2022/10/16 15:11 android13-5.15-lts 44b8b2ac1d96 67cb024c .config console log report info [disk image] [vmlinux] ci2-android-5-15 kernel BUG in notify_change
* Struck through repros no longer work on HEAD.