From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5820606A32F for ; Sat, 5 Dec 2026 15:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=HBQf6xOg DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:Message-ID:In-Reply-To: Date:MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Unsubscribe-Post:List-Owner; bh=DQgTGH8NAahVAe90Fl9RduW8gTSRKkyOblVbKRHZDjo=; b=HBQf6xOgKQVdBO30WgA7FHRJUQ DbCALOHSOdaQy6Eqkj0xuULQHIHeMcd24vn5YddVT2dzMpsXWzJ6Q5EGhoClEoeQyfMrubjIOnN3f qh1ILdMLf0ILSexULhaRneUShbhJB9nAoAdaoHaiZYDkDpCiuhnrYEQsktDDTxSGvO1D7JKqwgGnl NO5Iq08GL3W6aBmZCCRsLUvKUwKjvucj0gsehkb8czp3C5kD268u6K4pUSruuyGEf+jd2Rb6lqg89 JjyY4zk86t21qLPBNUNuxC90cPeU++lQHOaNNv/yDSA+MCkVsXay43tU3Q58f4bGBg1ZnoPiXW1Ob Kd4C8zKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZrTM-00000002aEm-0J8J; Sat, 05 Dec 2026 15:14:48 +0000 Received: from mail-oo1-f69.google.com ([209.85.161.69]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZrTH-00000002aCw-0iCC for linux-mtd@lists.infradead.org; Sat, 05 Dec 2026 15:14:45 +0000 Received: by mail-oo1-f69.google.com with SMTP id 006d021491bc7-6f4d828b9eeso1474831eaf.1 for ; Sat, 05 Dec 2026 07:14:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796483681; x=1797088481; h=content-type:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ItjcHHtJH/lCgJEyArOOzZ4ErZ5TBUdAihP5z2YV9j4=; b=0pkY3UlgSDkt0J8JO3tnH1BQ+w3uiTPoOVDFilEyZeZI2rIhQVrwCIumlI7aU830pX ckpnlvq99fjOxUPBoiCFi2VUrfUB0uZZXHxEbZJdD2EfoGHlTOYEHeH9KSO8qfUd2QMJ PqlGEXMrQXUlOogRn9pAhy0OCdx/kKc7/I5Lr7rFegJo7VedSKdSrWJi7iPcQKxMHcZk 78+dvgk+nSFex/+iGl5dJT9UZle6VN51+NSm6q6VuwaB71kFg6ETBA9K9MeoeNjOOVzp 2gk5GgVYai4G1rpwL4nNjEPzp/SX6egNokE5DG/pcxnWfJ611wA9VhmmhwL7RQeQrGcP kf2w== X-Forwarded-Encrypted: i=1; AL+hErE8SDK/GQcvvjlt/NhqcCpqUsI8VGnk0kiGI90lO00t6RA+LYtIncrTqxT3ruSCxlg42rH5XmEOrEY=@lists.infradead.org X-Gm-Message-State: APuU4Z/7OEhReDOHqn2ohf87DovYh0qJ8VMooqWMlpWThgDYm48+9GcE +zpeDAKBi457p/NrFRbuVO821zSbkhH4ROQZBsLfb8A6gH9lA45ndSn/4khqNzvuGtLDYQtfAtD 7FPiS1v5nUOJzfBKP7X0YDCdRo0WE867YFRIR7EsbWBkkNWwBmN2fLLB3Eis= X-Archived-By: MIME-Version: 1.0 X-Received: by 2002:a05:6820:c60a:10b0:71a:f0dc:ec6 with SMTP id 006d021491bc7-71bf21b0267mr3372155eaf.58.1796483681643; Sat, 05 Dec 2026 07:14:41 -0800 (PST) Date: Sat, 05 Dec 2026 07:14:41 -0800 In-Reply-To: <6b1115f2.8744ccba.1c9cf9.00b9.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6b142a61.7375a9b9.1d867b.10fd.GAE@google.com> Subject: Re: [syzbot] [jffs2?] kernel BUG in jffs2_do_read_inode From: syzbot To: 847807867@qq.com, dwmw2@infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at, sashiko-bot@kernel.org, syzkaller-bugs@googlegroups.com, tglx@linutronix.de, vigneshr@ti.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261205_071443_220067_1612B44F X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.5 (+) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" X-Spam-Status: No, score=-9.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,FROM_LOCAL_HEX, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 syzbot has found a reproducer for the following issue on: HEAD commit: 28a23309c8e4 Merge tag 'for-7.4-rc5-tag' of git://git.kern.. git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git console output: https://syzkaller.appspot.com/x/log.txt?x=179f2fbd580000 kernel config: https://syzkaller.appspot.com/x/.config?x=fc1834b4a2e3ba54 dashboard link: https://syzkaller.appspot.com/bug?extid=40179a6b1f86287d2848 compiler: Debian clang version 22.1.8 (1~deb13u5), Debian LLD 22.1.8 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16cb5e6d580000 The issue was bisected by AI to: commit 67e345d17ff8c2085a54c293001ae548f7be7b21 Author: David Woodhouse Date: Sun Feb 27 23:01:36 2005 +0000 [JFFS2] Prevent ino cache removal for inodes in use reasoning: https://syzkaller.appspot.com/ai_job?id=04b4d0fa-a2b6-4d59-9054-c08c1045284f AI-generated root cause summary: `jffs2_do_read_inode()` in `fs/jffs2/readinode.c` does not handle `INO_STATE_CLEARING` (state 6) in its `switch (f->inocache->state)` statement and falls into `default: BUG();` at line 1365. When `iget_failed()` runs on a JFFS2 inode (e.g., after a failed `jffs2_iget()` or failed creation in `jffs2_create()`/`jffs2_mkdir()`/`jffs2_symlink()`/`jffs2_mknod()`), `make_bad_inode()` unhashes the VFS inode before `iput()` invokes `jffs2_evict_inode()` -> `jffs2_do_clear_inode()`, bypassing VFS `__wait_on_freeing_inode()` serialization. A concurrent `jffs2_garbage_collect_pass()` (which also omits `INO_STATE_CLEARING` from its `switch (ic->state)` at `fs/jffs2/gc.c:365`) can then call `jffs2_gc_fetch_inode()` -> `jffs2_iget()` -> `jffs2_do_read_inode()` while the `inocache` is in `INO_STATE_CLEARING`, triggering the `BUG()`. full analysis: https://syzkaller.appspot.com/x/ai_root_cause?x=40179a6b1f86287d2848 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+40179a6b1f86287d2848@syzkaller.appspotmail.com The bisection result may be wrong. If you agree with it, please also add: Fixes: 67e345d17ff8 ("[JFFS2] Prevent ino cache removal for inodes in use") jffs2: error: (6057) jffs2_do_read_inode: requested to read a nonexistent ino 2 jffs2: error: (6057) jffs2_do_read_inode: Eep. Trying to read_inode #2 when it's already in state 5! jffs2: error: (6057) jffs2_do_read_inode: requested to read a nonexistent ino 2 ------------[ cut here ]------------ kernel BUG at fs/jffs2/readinode.c:1365! Oops: invalid opcode: 0000 [#1] SMP KASAN PTI CPU: 1 UID: 0 PID: 6057 Comm: syz-executor269 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2026 RIP: 0010:jffs2_do_read_inode+0x699/0x6a0 fs/jffs2/readinode.c:1365 Code: f5 fe e9 ab fe ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c fd fe ff ff 48 89 df e8 b2 72 f5 fe e9 f0 fe ff ff e8 78 65 81 fe 90 <0f> 0b 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc900047f78a0 EFLAGS: 00010293 RAX: ffffffff8346b128 RBX: 1ffff110056609d2 RCX: ffff88802a960000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900047f79d0 R08: ffff88802a960000 R09: 0000000000000006 R10: 0000000000000100 R11: 0000000000000005 R12: 0000000000000006 R13: 1ffff920008fef20 R14: dffffc0000000000 R15: ffff88802b304e92 FS: 00007fd47b96b6c0(0000) GS:ffff8881247f6000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f13ba2a8fa4 CR3: 00000000453c8000 CR4: 00000000003526f0 Call Trace: jffs2_iget+0x228/0xcc0 fs/jffs2/fs.c:277 generic_fh_to_dentry+0x9f/0xf0 fs/libfs.c:1472 exportfs_decode_fh_raw+0x1c8/0x770 fs/exportfs/expfs.c:460 do_handle_to_path+0xa4/0x1a0 fs/fhandle.c:274 handle_to_path fs/fhandle.c:423 [inline] do_handle_open+0x6dd/0xb10 fs/fhandle.c:447 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:0x7fd4811be109 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 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 d0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd47b96b188 EFLAGS: 00000246 ORIG_RAX: 0000000000000130 RAX: ffffffffffffffda RBX: 00007fd47b96b190 RCX: 00007fd4811be109 RDX: 0000000000000000 RSI: 00007fd47b96b190 RDI: 0000000000000003 RBP: 0000000000000021 R08: 0000000100000008 R09: 0000000100000008 R10: 0000000100000008 R11: 0000000000000246 R12: ffffffffffffffd0 R13: 0000000000000016 R14: 00007ffdaca98780 R15: 00007ffdaca98868 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:jffs2_do_read_inode+0x699/0x6a0 fs/jffs2/readinode.c:1365 Code: f5 fe e9 ab fe ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c fd fe ff ff 48 89 df e8 b2 72 f5 fe e9 f0 fe ff ff e8 78 65 81 fe 90 <0f> 0b 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc900047f78a0 EFLAGS: 00010293 RAX: ffffffff8346b128 RBX: 1ffff110056609d2 RCX: ffff88802a960000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900047f79d0 R08: ffff88802a960000 R09: 0000000000000006 R10: 0000000000000100 R11: 0000000000000005 R12: 0000000000000006 R13: 1ffff920008fef20 R14: dffffc0000000000 R15: ffff88802b304e92 FS: 00007fd47b96b6c0(0000) GS:ffff8881247f6000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fff71b98000 CR3: 00000000453c8000 CR4: 00000000003526f0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/