All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] jffs: initialize inocache to NULL when initializing a jffs2_inode_info
@ 2026-09-09  2:39 ` Lucas Jeffrey
  0 siblings, 0 replies; 12+ messages in thread
From: Lucas Jeffrey @ 2026-09-09  2:39 UTC (permalink / raw)
  To: dwmw2
  Cc: richard, linux-mtd, linux-kernel, Lucas Jeffrey,
	syzbot+3a8099322b09d8d073d1

When a jffs2_inode_info is allocated via new_inode(), due to memory reuse it
can retain stale values from its previous use.

If the new jffs2_inode_info object allocated retains an old reference to a
freed inocache, the function jffs2_new_inode may crash if either
jffs2_init_acl_pre or jffs2_do_new_inode returns an error value because
when calling iput() with the inode it will eventually attempt to free again
the inocache.

Reported-by: syzbot+3a8099322b09d8d073d1@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=3a8099322b09d8d073d1
Signed-off-by: Lucas Jeffrey <luquijeffrey@gmail.com>
---
 fs/jffs2/os-linux.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index 86ab014a349c..40f17218a276 100644
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -52,6 +52,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
 {
 	f->highest_version = 0;
 	f->fragtree = RB_ROOT;
+	f->inocache = NULL;
 	f->metadata = NULL;
 	f->dents = NULL;
 	f->target = NULL;
-- 
2.43.0


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

end of thread, other threads:[~2026-09-10  3:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09  2:39 [PATCH] jffs: initialize inocache to NULL when initializing a jffs2_inode_info Lucas Jeffrey
2026-09-09  2:39 ` Lucas Jeffrey
2026-09-09  2:54 ` sashiko-bot
2026-09-09  2:54   ` sashiko-bot
2026-09-09  5:57   ` AW: " Richard Weinberger
2026-09-09  5:57     ` Richard Weinberger
2026-09-10  2:53     ` Lucas Jeffrey
2026-09-10  2:53       ` Lucas Jeffrey
2026-09-09  5:33 ` AW: " Richard Weinberger
2026-09-09  5:33   ` Richard Weinberger
2026-09-10  3:19 ` [PATCH v2] jffs2: initialize inocache and target to NULL when allocating and initializing an jffs2_inode_info Lucas Jeffrey
2026-09-10  3:19   ` Lucas Jeffrey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.