From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 95D38768E1 for ; Tue, 5 Nov 2024 16:17:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730823467; cv=none; b=ANmWWaQV4k0JhErGM28bWoY8YaA+Htiby0IRNDaVeLtTorMhJFxUK+03sFy92bcFozo11phVHWwyaXpSrVJMIILOz44UHWfANUlAjwwMypDogWi4RdT36k4yoeSOsRab43rgewQHve2N58lD3ms2volfqByuRlvDfscRHUlLn+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730823467; c=relaxed/simple; bh=UeCNDg8JtGpVKhThy64qSqhqBiDXq6e13wE4RU07Q8A=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=I5hUbxlgYezp9AKrZ/iSHcpv59UkZQ1jygrkDvE1m1H9R9HXB2I8/Usu+JyBNBxqg8186Zn0ixtS7Pp3DVgJl9qiSO8GZxrHLeFvYqmkWiQfSYt7Xr0H/+pXjCjPIjN5Eh+tDv9AYtjOJs4WwbIyO00cG2QU6/VtA25/0iY+2NU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KKlgVIuo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KKlgVIuo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4E92C4CECF; Tue, 5 Nov 2024 16:17:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730823467; bh=UeCNDg8JtGpVKhThy64qSqhqBiDXq6e13wE4RU07Q8A=; h=Subject:To:Cc:From:Date:From; b=KKlgVIuobcB6CvVcmXUh0MRDXkQrt5VeOr3qweBOMe7cEZAitmHiBDFDj8GL4v6Yr aQwf3GZDTnUJND8YZ0hk0aYbqUKW/IxwOJBD2NEz2Fbo83jv8Ra59ssL1NTs12f87G H4pYZZbN8BGntAG94LmBenJcxBvxmb+Qs2Cjglt4= Subject: FAILED: patch "[PATCH] nilfs2: fix kernel bug due to missing clearing of checked" failed to apply to 6.6-stable tree To: konishi.ryusuke@gmail.com,akpm@linux-foundation.org,stable@vger.kernel.org Cc: From: Date: Tue, 05 Nov 2024 17:17:29 +0100 Message-ID: <2024110529-clapper-deferred-1146@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 41e192ad2779cae0102879612dfe46726e4396aa # git commit -s git send-email --to '' --in-reply-to '2024110529-clapper-deferred-1146@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 41e192ad2779cae0102879612dfe46726e4396aa Mon Sep 17 00:00:00 2001 From: Ryusuke Konishi Date: Fri, 18 Oct 2024 04:33:10 +0900 Subject: [PATCH] nilfs2: fix kernel bug due to missing clearing of checked flag Syzbot reported that in directory operations after nilfs2 detects filesystem corruption and degrades to read-only, __block_write_begin_int(), which is called to prepare block writes, may fail the BUG_ON check for accesses exceeding the folio/page size, triggering a kernel bug. This was found to be because the "checked" flag of a page/folio was not cleared when it was discarded by nilfs2's own routine, which causes the sanity check of directory entries to be skipped when the directory page/folio is reloaded. So, fix that. This was necessary when the use of nilfs2's own page discard routine was applied to more than just metadata files. Link: https://lkml.kernel.org/r/20241017193359.5051-1-konishi.ryusuke@gmail.com Fixes: 8c26c4e2694a ("nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption") Signed-off-by: Ryusuke Konishi Reported-by: syzbot+d6ca2daf692c7a82f959@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=d6ca2daf692c7a82f959 Cc: Signed-off-by: Andrew Morton diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c index 5436eb0424bd..10def4b55995 100644 --- a/fs/nilfs2/page.c +++ b/fs/nilfs2/page.c @@ -401,6 +401,7 @@ void nilfs_clear_folio_dirty(struct folio *folio) folio_clear_uptodate(folio); folio_clear_mappedtodisk(folio); + folio_clear_checked(folio); head = folio_buffers(folio); if (head) {