From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60509313297 for ; Mon, 1 Dec 2025 13:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.121.94.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764595251; cv=none; b=JSzNSS9Z84g400q0O/trUhjKeVdhjHUBfxsqTRyYHyTd/VlFx969pLpnTg0V6eiNeuPN2pyhOPVTYq4XdVT2QkhTK14R9MwlHAe3V3qaceYr2JNNfll46ZWxGEJdzKNu+jVjR7eqmbwd2/gigZMVnF69Jx381LFzLSABp5EFOi8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764595251; c=relaxed/simple; bh=GW5TtXw+Y3DZlju5PzAIgz++dCQZspCLQElCKFZdgHc=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=qD8NryPcuilS/H3M497iE/bPA3NG4Z5zEc01nZVwAQBzovbDIBqdAniXlHknD0DgbhkqOBxNhk28u7jCcCuPcqsFANrxxzMqsd2l8dnDAZas/Pyn4lCgKqb8TZKjckSutZ70c7saHODWuKq9zgIMl6QV2rh2qQsg5ywf8o1yNjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xs4all.nl; spf=pass smtp.mailfrom=xs4all.nl; dkim=pass (2048-bit key) header.d=xs4all.nl header.i=@xs4all.nl header.b=rBiFNC+p; arc=none smtp.client-ip=195.121.94.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xs4all.nl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xs4all.nl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=xs4all.nl header.i=@xs4all.nl header.b="rBiFNC+p" X-KPN-MessageId: 37cad18b-ceb9-11f0-b0b9-00505699b430 Received: from mta.kpnmail.nl (unknown [10.31.161.191]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 37cad18b-ceb9-11f0-b0b9-00505699b430; Mon, 01 Dec 2025 14:25:34 +0100 (CET) Received: from mtaoutbound.kpnmail.nl (unknown [10.128.135.189]) by mta.kpnmail.nl (Halon) with ESMTP id 896ac185-ceb8-11f0-83ca-00505699891e; Mon, 01 Dec 2025 14:20:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01; h=content-type:mime-version:subject:message-id:to:from:date; bh=LT5wgVsl29pKDubx0XZlrI1RmKbShbuOlRccROLKSB8=; b=rBiFNC+pkM9pLwjnbpvWV9ovCH+VyBFqK4GjlO+IKeCjq/vb1z8KK8zOF4ku8s3J6+/a252+nNpWg wud6IbWzst6nXhdo41iv4UlULP90Gi6dI9PBEAmaTiFQBa2ECUzMTXNH2xNpcjmQXv+OVSkh51CPu0 eBU4pUw/GSsjWssbl3/dQ5bakkr2uKTz0ni/jPoWqWmg/iYjnC53rsjCS7Of9xiEHIOBBGTsjmyX46 QPqcOV2tSfclhCJaUQCetjN+4I68prwo1AdNzmLoDnQfedTXcJ+rEXUwh2i9KRRmiOF0CBhSeA2Jzz xG53q5Od/7x13Ky2k7h5gXErgmXzB/w== X-KPN-MID: 33|i1rceF0JEFqkYEb6Ky/aXBmQujVBnfUClmhwtFYI88HXmk1xr1QO4GJsI1IId2i 6VVZYN3EZ7+OXdneUDKqEtA== X-CMASSUN: 33|woIIoyuXrStV+e9kZO3zDjMDqzqwt1OF4oloXULd51PYuXw/uRikTJAMjMRaeX8 1R9urENB3+XNimtYzuw7Shw== X-KPN-VerifiedSender: Yes Received: from cpxoxapps-mh04 (cpxoxapps-mh04.personalcloud.so.kpn.org [10.128.135.210]) by mtaoutbound.kpnmail.nl (Halon) with ESMTPSA id 895cd877-ceb8-11f0-94b1-00505699eff2; Mon, 01 Dec 2025 14:20:42 +0100 (CET) Date: Mon, 1 Dec 2025 14:20:42 +0100 (CET) From: Jori Koolstra To: brauner@kernel.org, gabriel@krisman.be, jlayton@kernel.org, neil@brown.name, shaggy@kernel.org, viro@zeniv.linux.org.uk Cc: jfs-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org, syzbot+cd7590567cc388f064f3@syzkaller.appspotmail.com, skhan@linuxfoundation.org Message-ID: <918405804.66343.1764595242232@kpc.webmail.kpnmail.nl> In-Reply-To: <20251118164645.67401-1-jkoolstra@xs4all.nl> References: <20251028232329.430752-1-jkoolstra@xs4all.nl> <20251118164645.67401-1-jkoolstra@xs4all.nl> Subject: [PATCH] jfs: dtInsertEntry can result in buffer overflow on corrupted jfs filesystems Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal Below syzbot bug has not been fixed yet. If anyone has time I would greatly appreciate a review of my patch, so it can be moved along. It has been sitting for quite a few weeks. Thanks, Jori. > Op 29-10-2025 00:23 CET schreef Jori Koolstra : > > > Syzbot reported a general protection fault in inode_set_ctime_current. > This resulted from the following circumstances: when creating a new file > via dtInsert, BT_GETSEARCH may yield a pointer to a dtroot which is > embedded directly in the jfs_inode_info. When finally dtInsertEntry is > called, if the freelist field or any next field of a slot of the dtpage > is corrupted, this may result in memory corruption of the parent > directory inode. > > In this case the i_sb field was corrupted, which raised the gpf when > in inode_set_ctime_current i_sb was dereferenced to access s_time_gran. > > I tested the patch using the syzbot reproducer and doing some basic > filesystem operations on a fresh jfs fs, such as "cp -r /usr/include/ > /mnt/jfs/" and "rm -r /mnt/jfs/include/n*" > > Signed-off-by: Jori Koolstra > Reported-by: syzbot+cd7590567cc388f064f3@syzkaller.appspotmail.com > Closes: https://syzbot.org/bug?extid=cd7590567cc388f064f3