From nobody Sat Feb 7 21:24:45 2026 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59FE450094C for ; Sat, 17 Jan 2026 04:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768624724; cv=none; b=KHCEkTqJO3eSbFFYxcqivC1ByT1GPprCRln4r/IkzMv6nBoK/egHF2o03+MTaa8DU03k22kneDPe6uWPJ7/lCfi5T0U7TdYoH+JG6g3JjUS5raEVl1MTJwPNg/8tIGTVj+5N2Sc9rucbEARXV+xk34ChNO+uuOPI5sS5ggQeCXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768624724; c=relaxed/simple; bh=1xlk+KuCBVmnObqS1JNUBLT6gZ1Mo+4Zu/o5RG3nG8c=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=DflDCW2BL4RB0aAv1lzgVhqTwBiPD8733h0rgSfm7TGVn1ZvEujMeag9ff+zp6M9jEA6X428BJbO3bJDexseX9giY9vJX0o3BMjGvhozW9sRUjGnUGxmFeyZTqUU4w1jBPM7aZRd0YdVEUZ2lbItDVHNorDIhB6A5z5tb67nbc8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-661094d05b7so5170668eaf.1 for ; Fri, 16 Jan 2026 20:38:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768624722; x=1769229522; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UiMVm94GehdqTFjeFcyA9/rMIURkJqLDe+76XG/eFEQ=; b=FF7fPTsK9nak5+mea31mKeuaYRI/1IK3JOsVz3XiA+t52OlkewcEK3zd5O4XKiF+VF zLjCqGO9z7usqpocC+QaF4HH5TXEnoOBf1XM8gRYvB16LFQkZC0/UBkM5+4zOKkyii66 4YzuUFrB+l/h6GoSNj26X1xnhleGZZn9Z65urbybrY9X/JvcAeqEuaY7vLsTj+5UzpYY B+irv/a9oK6rqNQZgkvHJ+ysLwrq3Ecosy7r4+FzMNcieVvm7BO/KepUwFBS8VqBCMSi p0urhXpcMj8OHzzwLg/vHC6b74l5sJpk7EhhshUSjbTbDryZV+A2D4cZOcSsj0bryDfs VypA== X-Gm-Message-State: AOJu0YzCoCvozh4YBnKdwSMkxgbCtmmdGG3Ts524hk3/T9EBDbb/jtYc Khm3dpBXT7kbUHhpnkTqgQQHkgKXZ7vMB2qPeAuVdkcaqOCNGMgELVyQIoyDDDZkos80LluxGw3 ltgv4fPGc1aN/IlBRV+5/AC2VvOGlS0rztTtv77KHLR58hieGeGtn8CEvfjU= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:f00a:b0:657:56ba:7455 with SMTP id 006d021491bc7-661188d60damr1970218eaf.1.1768624722312; Fri, 16 Jan 2026 20:38:42 -0800 (PST) Date: Fri, 16 Jan 2026 20:38:42 -0800 In-Reply-To: <696aa7da.a70a0220.31956c.001a.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <696b1252.050a0220.3390f1.0004.GAE@google.com> Subject: Forwarded: [PATCH] hpfs: add debug logging to hpfs_bplus_lookup From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] hpfs: add debug logging to hpfs_bplus_lookup Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master This is a debug patch to understand the use-after-free issue reported by syzbot. It adds extensive logging to track: - Buffer head addresses and lifecycle - btree pointer values and offsets - Array access patterns before crashes - Internal vs external node processing This will help identify exactly where and why the use-after-free occurs. NOT FOR MERGE - DEBUG ONLY Reported-by: syzbot+8debf4b3f7c7391cd8eb@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=3D8debf4b3f7c7391cd8eb" --- fs/hpfs/anode.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/fs/hpfs/anode.c b/fs/hpfs/anode.c index a4f5321eafae..e55d0f5fd782 100644 --- a/fs/hpfs/anode.c +++ b/fs/hpfs/anode.c @@ -19,25 +19,57 @@ secno hpfs_bplus_lookup(struct super_block *s, struct i= node *inode, struct anode *anode; int i; int c1, c2 =3D 0; + + printk(KERN_EMERG "=3D=3D=3D BPLUS_LOOKUP ENTRY: btree=3D%px bh=3D%px bh-= >b_data=3D%px sec=3D%u =3D=3D=3D\n", + btree, bh, bh->b_data, sec); go_down: + printk(KERN_EMERG "=3D=3D=3D go_down: btree=3D%px bh=3D%px n_used_nodes= =3D%u internal=3D%d =3D=3D=3D\n", + btree, bh, btree->n_used_nodes, bp_internal(btree)); + if (hpfs_sb(s)->sb_chk) if (hpfs_stop_cycles(s, a, &c1, &c2, "hpfs_bplus_= lookup")) return -1; if (bp_internal(btree)) { - for (i =3D 0; i < btree->n_used_nodes; i++) + printk(KERN_EMERG "=3D=3D=3D Processing INTERNAL node, n_used_nodes=3D%u= =3D=3D=3D\n", btree->n_used_nodes); + for (i =3D 0; i < btree->n_used_nodes; i++) { + printk(KERN_EMERG "=3D=3D=3D internal[%d]: accessing %px =3D=3D=3D\n", = i, &btree->u.internal[i]); if (le32_to_cpu(btree->u.internal[i].file_secno) > sec) { a =3D le32_to_cpu(btree->u.internal[i].down); + printk(KERN_EMERG "=3D=3D=3D Found match, going to anode=3D%08x =3D=3D= =3D\n", a); + printk(KERN_EMERG "=3D=3D=3D RELEASING bh=3D%px =3D=3D=3D\n", bh); + brelse(bh); - if (!(anode =3D hpfs_map_anode(s, a, &bh))) return -1; + printk(KERN_EMERG "=3D=3D=3D Calling hpfs_map_anode for %08x =3D=3D=3D= \n", a); + + if (!(anode =3D hpfs_map_anode(s, a, &bh))){ + printk(KERN_EMERG "=3D=3D=3D hpfs_map_anode FAILED =3D=3D=3D\n"); + return -1; + } + printk(KERN_EMERG "=3D=3D=3D hpfs_map_anode SUCCESS: anode=3D%px new_b= h=3D%px new_bh->b_data=3D%px =3D=3D=3D\n", + anode, bh, bh->b_data); + btree =3D GET_BTREE_PTR(&anode->btree); + + printk(KERN_EMERG "=3D=3D=3D NEW btree=3D%px (offset from b_data: %ld)= =3D=3D=3D\n", + btree, (long)((void *)btree - (void *)bh->b_data)); + printk(KERN_EMERG "=3D=3D=3D Validation passed, jumping to go_down =3D= =3D=3D\n"); goto go_down; } + } hpfs_error(s, "sector %08x not found in internal anode %08x", sec, a); brelse(bh); return -1; } - for (i =3D 0; i < btree->n_used_nodes; i++) + + printk(KERN_EMERG "=3D=3D=3D Processing EXTERNAL node, n_used_nodes=3D%u = =3D=3D=3D\n", btree->n_used_nodes); + printk(KERN_EMERG "=3D=3D=3D btree=3D%px bh=3D%px bh->b_data=3D%px bh->b_= size=3D%zu =3D=3D=3D\n", + btree, bh, bh->b_data, bh->b_size); + for (i =3D 0; i < btree->n_used_nodes; i++) { + printk(KERN_EMERG "=3D=3D=3D external[%d]: about to access %px =3D=3D=3D= \n", i, &btree->u.external[i]); + printk(KERN_EMERG "=3D=3D=3D CRASH WILL HAPPEN ON NEXT LINE IF UAF =3D= =3D=3D\n"); if (le32_to_cpu(btree->u.external[i].file_secno) <=3D sec && le32_to_cpu(btree->u.external[i].file_secno) + le32_to_cpu(btree->u.= external[i].length) > sec) { a =3D le32_to_cpu(btree->u.external[i].disk_secno) + sec - le32_to_cpu(= btree->u.external[i].file_secno); + + printk(KERN_EMERG "=3D=3D=3D Found external match, returning %u =3D=3D= =3D\n", a); if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, a, 1, "data")) { brelse(bh); return -1; @@ -51,6 +83,7 @@ secno hpfs_bplus_lookup(struct super_block *s, struct ino= de *inode, brelse(bh); return a; } + } hpfs_error(s, "sector %08x not found in external anode %08x", sec, a); brelse(bh); return -1; --=20 2.43.0