mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: syzbot <syzbot+9c3df8acb6283d0cf12d@syzkaller.appspotmail.com>
To: brauner@kernel.org, jack@suse.cz,
	jfs-discussion@lists.sourceforge.net,  jkoolstra@xs4all.nl,
	linux-kernel@vger.kernel.org, sforshee@kernel.org,
	 shaggy@kernel.org, syzkaller-bugs@googlegroups.com
Subject: [syzbot] [jfs?] WARNING in jfs_rmdir (2)
Date: Sat, 21 Nov 2026 15:53:43 -0800	[thread overview]
Message-ID: <6b022f07.44b41460.34b83f.0017.GAE@google.com> (raw)

Hello,

syzbot found the following issue on:

HEAD commit:    d0f871bfb831 Merge tag 'arm64-fixes' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15d3bc11580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=d16c0eae9c338e3c
dashboard link: https://syzkaller.appspot.com/bug?extid=9c3df8acb6283d0cf12d
compiler:       Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/9be5c77a65c2/disk-d0f871bf.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/71f40d657e8b/vmlinux-d0f871bf.xz
kernel image: https://storage.googleapis.com/syzbot-assets/66c9f33ae1f0/bzImage-d0f871bf.xz

AI-generated root cause summary:
When JFS loads an inode from disk in `diRead()`/`copy_from_dinode()`, it only
checks that `di_nlink != 0` and copies `di_nlink` verbatim without verifying
that a directory inode (`S_ISDIR`) has a valid link count (`>= 2` and consistent
with child subdirectories). Consequently, on a corrupted JFS image where a
parent directory `dip` has an insufficient on-disk `di_nlink` (such as `1` while
containing subdirectories), removing a subdirectory via `jfs_rmdir()` (or moving
one via `jfs_rename()`) drops `dip->i_nlink` to `0` while `dip` remains live. A
subsequent `jfs_rmdir()` on another child directory unconditionally calls
`inode_dec_link_count(dip)` -> `drop_nlink(dip)` without checking
`dip->i_nlink`, triggering `WARN_ON(inode->i_nlink == 0)` at `fs/inode.c:408`
and underflowing `dip->__i_nlink`.

full analysis:  https://syzkaller.appspot.com/x/ai_root_cause?x=9c3df8acb6283d0cf12d

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+9c3df8acb6283d0cf12d@syzkaller.appspotmail.com

------------[ cut here ]------------
inode->i_nlink == 0
WARNING: fs/inode.c:408 at drop_nlink+0xc5/0x110 fs/inode.c:408, CPU#0: syz-executor/5603
Modules linked in:
CPU: 0 UID: 0 PID: 5603 Comm: syz-executor Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:drop_nlink+0xc5/0x110 fs/inode.c:408
Code: 68 09 00 00 be 08 00 00 00 e8 97 2a e9 ff f0 48 ff 83 68 09 00 00 5b 41 5c 41 5e 41 5f 5d e9 92 8b 29 09 cc e8 cc 72 75 ff 90 <0f> 0b 90 eb 81 44 89 f1 80 e1 07 80 c1 03 38 c1 0f 8c 5b ff ff ff
RSP: 0018:ffffc9000529fc30 EFLAGS: 00010293
RAX: ffffffff82528194 RBX: ffff8880678164d0 RCX: ffff88803564ddc0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffffbfff21ab838 R12: 1ffff1100cf02ca3
R13: dffffc0000000000 R14: ffff888067816518 R15: dffffc0000000000
FS:  000055559535d500(0000) GS:ffff888124704000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555595390ac8 CR3: 00000000414ec000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 inode_dec_link_count include/linux/fs.h:2276 [inline]
 jfs_rmdir+0x416/0x850 fs/jfs/namei.c:395
 vfs_rmdir+0x3e9/0x700 fs/namei.c:5533
 filename_rmdir+0x276/0x510 fs/namei.c:5590
 __do_sys_unlinkat fs/namei.c:5765 [inline]
 __se_sys_unlinkat+0x71/0x1a0 fs/namei.c:5758
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff7bfd68677
Code: 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 b8 07 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff92aabc68 EFLAGS: 00000207 ORIG_RAX: 0000000000000107
RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007ff7bfd68677
RDX: 0000000000000200 RSI: 00007fff92aace10 RDI: 00000000ffffff9c
RBP: 00007ff7bfdf751b R08: 0000000000008580 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000207 R12: 00007fff92aace10
R13: 00007ff7bfdf751b R14: 0000000000022252 R15: 00007fff92aaefd0
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

                 reply	other threads:[~2026-11-21 23:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b022f07.44b41460.34b83f.0017.GAE@google.com \
    --to=syzbot+9c3df8acb6283d0cf12d@syzkaller.appspotmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jkoolstra@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sforshee@kernel.org \
    --cc=shaggy@kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®