linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [jfs?] WARNING: fs/jfs/jfs_dmap.c:LINE at dbAdjTree, CPU: jfsCommit/NUM
@ 2025-06-17  2:31 syzbot
  2025-06-17  3:01 ` Edward Adam Davis
  2025-06-17  3:19 ` [PATCH] jfs: Issue a warning when leafidx is too large Edward Adam Davis
  0 siblings, 2 replies; 6+ messages in thread
From: syzbot @ 2025-06-17  2:31 UTC (permalink / raw)
  To: jfs-discussion, linux-kernel, shaggy, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    050f8ad7b58d Add linux-next specific files for 20250616
git tree:       linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=11e0190c580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=d2efc7740224b93a
dashboard link: https://syzkaller.appspot.com/bug?extid=077d9ebda84f426a6a1e
compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17aa1e82580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15e0190c580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/49faa18d2f53/disk-050f8ad7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7c6f9cd7fe5d/vmlinux-050f8ad7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/84a08d6403ee/bzImage-050f8ad7.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/65c809c20ad8/mount_0.gz
  fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=178095d4580000)

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

------------[ cut here ]------------
WARNING: fs/jfs/jfs_dmap.c:2867 at dbAdjTree+0x454/0x4e0 fs/jfs/jfs_dmap.c:2867, CPU#0: jfsCommit/113
Modules linked in:
CPU: 0 UID: 0 PID: 113 Comm: jfsCommit Not tainted 6.16.0-rc2-next-20250616-syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
RIP: 0010:dbAdjTree+0x454/0x4e0 fs/jfs/jfs_dmap.c:2867
Code: 5a ff ff ff e8 dd ed 81 fe eb 05 e8 d6 ed 81 fe 48 83 c4 28 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc e8 bd ed 81 fe 90 <0f> 0b 90 eb e1 44 89 e1 80 e1 07 80 c1 03 38 c1 0f 8c e1 fb ff ff
RSP: 0018:ffffc90002de7988 EFLAGS: 00010293
RAX: ffffffff833e7c73 RBX: ffff88807806f010 RCX: ffff88801eb2bc00
RDX: 0000000000000000 RSI: 0000000000000155 RDI: 0000000000020056
RBP: 0000000000020056 R08: ffffea0001e01bc7 R09: 1ffffd40003c0378
R10: dffffc0000000000 R11: fffff940003c0379 R12: ffff88807806f018
R13: dffffc0000000000 R14: 0000000000000004 R15: 0000000000000155
FS:  0000000000000000(0000) GS:ffff888125c40000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555944916f8 CR3: 00000000736f2000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 dbJoin+0x238/0x300 fs/jfs/jfs_dmap.c:2835
 dbFreeBits+0x4e1/0xdb0 fs/jfs/jfs_dmap.c:2332
 dbFreeDmap fs/jfs/jfs_dmap.c:2081 [inline]
 dbFree+0x336/0x650 fs/jfs/jfs_dmap.c:398
 txFreeMap+0x7ff/0xde0 fs/jfs/jfs_txnmgr.c:2534
 txUpdateMap+0x308/0x9c0 fs/jfs/jfs_txnmgr.c:-1
 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline]
 jfs_lazycommit+0x43f/0xa90 fs/jfs/jfs_txnmgr.c:2733
 kthread+0x711/0x8a0 kernel/kthread.c:464
 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </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 syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

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

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

* Re: [syzbot] [jfs?] WARNING: fs/jfs/jfs_dmap.c:LINE at dbAdjTree, CPU: jfsCommit/NUM
  2025-06-17  2:31 [syzbot] [jfs?] WARNING: fs/jfs/jfs_dmap.c:LINE at dbAdjTree, CPU: jfsCommit/NUM syzbot
@ 2025-06-17  3:01 ` Edward Adam Davis
  2025-06-17  7:48   ` syzbot
  2025-06-17  3:19 ` [PATCH] jfs: Issue a warning when leafidx is too large Edward Adam Davis
  1 sibling, 1 reply; 6+ messages in thread
From: Edward Adam Davis @ 2025-06-17  3:01 UTC (permalink / raw)
  To: syzbot+077d9ebda84f426a6a1e; +Cc: linux-kernel, syzkaller-bugs

#syz test

diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 35e063c9f3a4..7e3c5f6826d8 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -2856,9 +2856,13 @@ static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl)
 static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl)
 {
 	int lp, pp, k;
-	int max, size;
+	int max, size, max_idx;
 
 	size = is_ctl ? CTLTREESIZE : TREESIZE;
+	max_idx = is_ctl ? LPERCTL : LPERDMAP;
+
+	if (le32_to_cpu(tp->dmt_leafidx) >= max_idx)
+		return;
 
 	/* pick up the index of the leaf for this leafno.
 	 */


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

* [PATCH] jfs: Issue a warning when leafidx is too large
  2025-06-17  2:31 [syzbot] [jfs?] WARNING: fs/jfs/jfs_dmap.c:LINE at dbAdjTree, CPU: jfsCommit/NUM syzbot
  2025-06-17  3:01 ` Edward Adam Davis
@ 2025-06-17  3:19 ` Edward Adam Davis
  2025-07-11 20:31   ` Dave Kleikamp
  1 sibling, 1 reply; 6+ messages in thread
From: Edward Adam Davis @ 2025-06-17  3:19 UTC (permalink / raw)
  To: syzbot+077d9ebda84f426a6a1e
  Cc: jfs-discussion, linux-kernel, shaggy, syzkaller-bugs

When it is clear that leafidx is too large, a warn is triggered to
distinguish it from other sizes.

Reported-by: syzbot+077d9ebda84f426a6a1e@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=077d9ebda84f426a6a1e
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 fs/jfs/jfs_dmap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 35e063c9f3a4..7e3c5f6826d8 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -2856,9 +2856,13 @@ static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl)
 static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl)
 {
 	int lp, pp, k;
-	int max, size;
+	int max, size, max_idx;
 
 	size = is_ctl ? CTLTREESIZE : TREESIZE;
+	max_idx = is_ctl ? LPERCTL : LPERDMAP;
+
+	if (WARN_ON_ONCE(le32_to_cpu(tp->dmt_leafidx) >= max_idx))
+		return;
 
 	/* pick up the index of the leaf for this leafno.
 	 */
-- 
2.43.0


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

* Re: [syzbot] [jfs?] WARNING: fs/jfs/jfs_dmap.c:LINE at dbAdjTree, CPU: jfsCommit/NUM
  2025-06-17  3:01 ` Edward Adam Davis
@ 2025-06-17  7:48   ` syzbot
  2025-06-17  8:07     ` Aleksandr Nogikh
  0 siblings, 1 reply; 6+ messages in thread
From: syzbot @ 2025-06-17  7:48 UTC (permalink / raw)
  To: eadavis, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+077d9ebda84f426a6a1e@syzkaller.appspotmail.com
Tested-by: syzbot+077d9ebda84f426a6a1e@syzkaller.appspotmail.com

Tested on:

commit:         4325743c Add linux-next specific files for 20250617
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=14794370580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=70c73b370b132354
dashboard link: https://syzkaller.appspot.com/bug?extid=077d9ebda84f426a6a1e
compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
patch:          https://syzkaller.appspot.com/x/patch.diff?x=10a09e82580000

Note: testing is done by a robot and is best-effort only.

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

* Re: [syzbot] [jfs?] WARNING: fs/jfs/jfs_dmap.c:LINE at dbAdjTree, CPU: jfsCommit/NUM
  2025-06-17  7:48   ` syzbot
@ 2025-06-17  8:07     ` Aleksandr Nogikh
  0 siblings, 0 replies; 6+ messages in thread
From: Aleksandr Nogikh @ 2025-06-17  8:07 UTC (permalink / raw)
  To: syzbot; +Cc: eadavis, linux-kernel, syzkaller-bugs

#syz dup: WARNING in dbAdjTree

On Tue, Jun 17, 2025 at 9:48 AM syzbot
<syzbot+077d9ebda84f426a6a1e@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot has tested the proposed patch and the reproducer did not trigger any issue:
>
> Reported-by: syzbot+077d9ebda84f426a6a1e@syzkaller.appspotmail.com
> Tested-by: syzbot+077d9ebda84f426a6a1e@syzkaller.appspotmail.com
>
> Tested on:
>
> commit:         4325743c Add linux-next specific files for 20250617
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=14794370580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=70c73b370b132354
> dashboard link: https://syzkaller.appspot.com/bug?extid=077d9ebda84f426a6a1e
> compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
> patch:          https://syzkaller.appspot.com/x/patch.diff?x=10a09e82580000
>
> Note: testing is done by a robot and is best-effort only.
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/syzkaller-bugs/68511db3.050a0220.2608ac.000f.GAE%40google.com.

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

* Re: [PATCH] jfs: Issue a warning when leafidx is too large
  2025-06-17  3:19 ` [PATCH] jfs: Issue a warning when leafidx is too large Edward Adam Davis
@ 2025-07-11 20:31   ` Dave Kleikamp
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Kleikamp @ 2025-07-11 20:31 UTC (permalink / raw)
  To: Edward Adam Davis, syzbot+077d9ebda84f426a6a1e
  Cc: jfs-discussion, linux-kernel, syzkaller-bugs

On 6/16/25 10:19PM, Edward Adam Davis wrote:
> When it is clear that leafidx is too large, a warn is triggered to
> distinguish it from other sizes.

I'm not convinced this is useful. Without this patch, we will still 
return with a WARN_ON_ONCE a couple lines of code later.

> 
> Reported-by: syzbot+077d9ebda84f426a6a1e@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=077d9ebda84f426a6a1e
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
>   fs/jfs/jfs_dmap.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
> index 35e063c9f3a4..7e3c5f6826d8 100644
> --- a/fs/jfs/jfs_dmap.c
> +++ b/fs/jfs/jfs_dmap.c
> @@ -2856,9 +2856,13 @@ static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl)
>   static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl)
>   {
>   	int lp, pp, k;
> -	int max, size;
> +	int max, size, max_idx;
>   
>   	size = is_ctl ? CTLTREESIZE : TREESIZE;
> +	max_idx = is_ctl ? LPERCTL : LPERDMAP;
> +
> +	if (WARN_ON_ONCE(le32_to_cpu(tp->dmt_leafidx) >= max_idx))
> +		return;
>   
>   	/* pick up the index of the leaf for this leafno.
>   	 */


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

end of thread, other threads:[~2025-07-11 20:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17  2:31 [syzbot] [jfs?] WARNING: fs/jfs/jfs_dmap.c:LINE at dbAdjTree, CPU: jfsCommit/NUM syzbot
2025-06-17  3:01 ` Edward Adam Davis
2025-06-17  7:48   ` syzbot
2025-06-17  8:07     ` Aleksandr Nogikh
2025-06-17  3:19 ` [PATCH] jfs: Issue a warning when leafidx is too large Edward Adam Davis
2025-07-11 20:31   ` Dave Kleikamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).