From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (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 A0616361651 for ; Sun, 23 Aug 2026 14:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787496753; cv=none; b=obhs6QLN/gm4/U/uRe2PsbE990qdhkAd4tyo4QEPjys5L+vU5JZ0QXn3TuqfS769XYuqDaMwpUBkgEHie3xn9fXJhoNDMM4gzSl+WomZ87qyVqGIvWEZLMWFepwWuJ5/mlqyNG0LlZ/6Kj/tFn3ImHfZ3hY+l+WArvypAYG30ow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787496753; c=relaxed/simple; bh=4EgS6ATjojG1DK2w0m1zfV4sQ2buKWaUZ4drLZz0IuU=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=EGfcoz2fuKngKaUO2yJNTpI4ygxh/SxAeb8drWQrxVpccoprN1gxu46RmCHrqrPLYT7261SJj8oEFw1eTAKH4Gwyb4zYnYcVaaY1loUYQ5qwAKv0ueBDfS8f8diYYoblUSA1QyrV196W5fSZhLKemcHpMyIrfQma0xtOmDa5Jsg= 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.167.199 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-oi1-f199.google.com with SMTP id 5614622812f47-4b28d7ffab1so6225004b6e.1 for ; Sun, 23 Aug 2026 07:52:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787496750; x=1788101550; 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=njeQq2xtk68+5C+DM5ZBTbcbW0GgmAvIMLq/41FNSnM=; b=lP8MejKf3IMqDx0PiKGGRCyofHSzcmD6Kkcw5BRbHRCxXGdLzGldbuMM9eTplkqYdk C53JqSjRpLzXFkrxUj/CH5cqNmvKcbSj2Bh1BzxfCBban5l42MQIPfkrsURZorvzyUTT B5QzI92A1um5WdhTZomKZ7+hoRk8wFyHk5Wy2CFpHSBiijBH6vHjA2OqTD0K8JALUg6P UqMwtH5GoqakM9XcH2/Jh/xAA5Iy0oSnCYH6Vwa0f2MyG2XKBHeAexEpGN1eR1x1eI00 l5h9fgF52Oy3QpdFna8Cw2TfIf6mAerUmGVgisCa275K7V3hpk1VdBpWBEJe/MTDvIZK OOGQ== X-Gm-Message-State: AFuF++kqxKJUyw7LUTY6q9uuuT6AcUFsYioouTcoxbhUX/fIaRIh6Wxt wgprUxERiISxpumK4mmtydlsLdZE/zRmFNyT6sUTRi4Uen4Lbt+DdO+PQO0NV+asXyALmfPuMz3 tj+qaDDah69bUP2Sk+0ZnpaXZderLiKA4SyLiSq5T0z1sekx73HkGCuAHIhw= 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:6808:4704:b0:4ab:224d:6dd6 with SMTP id 5614622812f47-4b2cddd4647mr24225312b6e.15.1787496750571; Sun, 23 Aug 2026 07:52:30 -0700 (PDT) Date: Sun, 23 Aug 2026 07:52:30 -0700 In-Reply-To: <6a8af6b0.ae6ddae5.3da009.0066.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a8b092e.dbb3a75c.13dd47.004f.GAE@google.com> Subject: Forwarded: [PATCH] jffs2: fix double-free of f->target in jffs2_alloc_inode() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com 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] jffs2: fix double-free of f->target in jffs2_alloc_inode() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master jffs2_alloc_inode() does not initialize f->target before returning the new inode. It is normally cleared later by jffs2_init_inode_info(), called from jffs2_iget(), but that runs only after alloc_inode() has already returned successfully. If inode_init_always() fails in between, alloc_inode() calls ->free_inode() directly on the half-initialized inode. jffs2_free_inode() then does kfree(f->target) on whatever stale value was left in the reused slab object, which can be a pointer that was already freed, causing a double-free. Initialize f->target to NULL in jffs2_alloc_inode() to close this window. Reported-by: syzbot+675e84fdf3dde67b4946@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=675e84fdf3dde67b4946 Signed-off-by: Deepanshu Kartikey --- fs/jffs2/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 81396a092ba8..3c32d5c776e1 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -42,6 +42,7 @@ static struct inode *jffs2_alloc_inode(struct super_block *sb) f = alloc_inode_sb(sb, jffs2_inode_cachep, GFP_KERNEL); if (!f) return NULL; + f->target = NULL; return &f->vfs_inode; } -- 2.34.1