mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuai Liu <847807867@qq.com>
To: linux-mtd@lists.infradead.org
Cc: richard@nod.at,
	syzbot+3a8099322b09d8d073d1@syzkaller.appspotmail.com,
	luquijeffrey@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [syzbot] [jffs2?] KASAN: slab-use-after-free Read in jffs2_xattr_delete_inode
Date: Fri, 20 Nov 2026 09:04:29 +0800	[thread overview]
Message-ID: <tencent_7590135AEEA7D2DC2CE7F27E4DF5B8936208@qq.com> (raw)
In-Reply-To: <6a7bfdf7.ed659fcc.23056a.007f.GAE@google.com>

#syz test

Hi Richard,

Gentle ping.  I posted a fix for this on 2026-11-03 [1]; it resubmits
Lucas Jeffrey's September patch with credit, as his thread had gone
quiet while the bug kept reproducing.

There has been no response so far, and the bug is still live -- 44
crashes recorded in the November monthly report [2].  The fix is a
one-liner clearing f->inocache in jffs2_init_inode_info(), consistent
with the other pointer fields there: a stale inocache survives slab
recycling after the previous mount's jffs2_free_ino_caches() and is
dereferenced by jffs2_xattr_delete_inode() on the evict() error path
when jffs2_new_inode() fails after jffs2_init_inode_info() but before
jffs2_do_new_inode() assigns a fresh inocache.

I've verified with the syzbot C reproducer under QEMU + KASAN: the UAF
triggers before the patch and is absent after it.  The patch is inlined
below so syzbot can re-verify on current master.

Note that the syzbot bisection points at an unrelated block2mtd commit
(7b09acdc "mtd: block2mtd: add support for an optional custom MTD
label"); the repro mounts jffs2 on block2mtd, so that looks like
bisection noise.

Could you take a look?

Thanks,
Shuai Liu

[1] https://lore.kernel.org/all/tencent_A21BAE90D8EE04A5FB98B4168BA73C695306@qq.com/
[2] https://lore.kernel.org/all/6afbd91e.e6a8accb.234e85.000a.GAE@google.com/

---
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -55,6 +55,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
 	f->metadata = NULL;
 	f->dents = NULL;
 	f->target = NULL;
+	f->inocache = NULL;
 	f->flags = 0;
 	f->usercompr = 0;
 }
--


  parent reply	other threads:[~2026-11-20  1:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12  5:00 syzbot
2026-10-02 15:04 ` syzbot
2026-10-18 18:25 ` syzbot
2026-10-19  5:54 ` syzbot
2026-11-20  1:04 ` Shuai Liu [this message]
2026-11-20  1:04   ` syzbot

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=tencent_7590135AEEA7D2DC2CE7F27E4DF5B8936208@qq.com \
    --to=847807867@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=luquijeffrey@gmail.com \
    --cc=richard@nod.at \
    --cc=syzbot+3a8099322b09d8d073d1@syzkaller.appspotmail.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®