public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG REPORT] ext4: “errors=remount-ro” has become “errors=shutdown”?
@ 2024-12-30  7:27 Baokun Li
  2025-01-02 15:58 ` Jan Kara
  0 siblings, 1 reply; 14+ messages in thread
From: Baokun Li @ 2024-12-30  7:27 UTC (permalink / raw)
  To: linux-ext4@vger.kernel.org, Theodore Ts'o, Jan Kara
  Cc: Christian Brauner, sunyongjian1, Yang Erkun, Baokun Li

After commit d3476f3dad4a (“ext4: don't set SB_RDONLY after filesystem
errors”) in v6.12-rc1, the “errors=remount-ro” mode no longer sets
SB_RDONLY on errors, which results in us seeing the filesystem is still
in rw state after errors. The issue fixed by this patch is reported as
CVE-2024-50191.

https://lore.kernel.org/all/2024110851-CVE-2024-50191-f31c@gregkh/

This has actually changed the remount-ro semantics. We have some fault
injection test cases where we unmount the filesystem after detecting
a ro state and then check for consistency. Our customer has a similar
scenario. In "errors=remount-ro" mode, some operations are performed
after the file system becomes read-only.

We reported similar issues to the community in 2020,
https://lore.kernel.org/all/20210104160457.GG4018@quack2.suse.cz/
Jan Kara provides a simple and effective patch. This patch somehow
didn't end up merged into upstream, but this patch has been merged into
our internal version for a couple years now and it works fine, is it
possible to revert the patch that no longer sets SB_RDONLY and use
the patch in the link above?


What's worse is that after commit
   95257987a638 ("ext4: drop EXT4_MF_FS_ABORTED flag")
was merged in v6.6-rc1, the EXT4_FLAGS_SHUTDOWN bit is set in
ext4_handle_error(). This causes the file system to not be read-only
when an error is triggered in "errors=remount-ro" mode, because
EXT4_FLAGS_SHUTDOWN prevents both writing and reading. I'm not sure
if this is the intended behavior. But if the intention is to shut down
the file system upon an error, I feel it would be better to add an
"errors=shutdown" option.


Regards,
Baokun


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

end of thread, other threads:[~2025-01-08  2:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-30  7:27 [BUG REPORT] ext4: “errors=remount-ro” has become “errors=shutdown”? Baokun Li
2025-01-02 15:58 ` Jan Kara
2025-01-03  9:26   ` Baokun Li
2025-01-03 10:42     ` Jan Kara
2025-01-03 13:19       ` Baokun Li
2025-01-03 14:34         ` Jan Kara
2025-01-04  3:15           ` Baokun Li
2025-01-03 15:35       ` Theodore Ts'o
2025-01-03 15:54         ` Theodore Ts'o
2025-01-04  2:41           ` Baokun Li
2025-01-06 23:49             ` Darrick J. Wong
2025-01-07  2:01               ` Baokun Li
2025-01-07  7:08                 ` Darrick J. Wong
2025-01-08  2:08                   ` Baokun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox