public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [Bug 219254] New: Missing memory barrier in __ext4_remount for checking ext4_forced_shutdown
@ 2024-09-09 18:05 bugzilla-daemon
  0 siblings, 0 replies; only message in thread
From: bugzilla-daemon @ 2024-09-09 18:05 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=219254

            Bug ID: 219254
           Summary: Missing memory barrier in __ext4_remount for checking
                    ext4_forced_shutdown
           Product: File System
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: ext4
          Assignee: fs_ext4@kernel-bugs.osdl.org
          Reporter: fanqi.yu@columbia.edu
        Regression: No

Hi,

In other places of the kernel, accesses to SB_RDONLY and EXT4_FLAGS_SHUTDOWN
are ordered by smp_wmb() for writes and smp_rmb() for reads:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4418e14112e3ca85e8492a4489a3552b0cc526a8

There seems to be a missing smp_rmb() here between sb_rdonly(sb) and
ext4_forced_shutdown(sb):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/super.c?h=v6.11-rc7#n6506

The affected scenario:
Normally a remount-ro-after-error file system would not be able to be remounted
as rw again because the ext4_forced_shutdown(sb) check will return -EROFS. On a
relaxed memory architecture, it is possible to see ext4_forced_shutdown(sb) as
false despite sb_rdonly(sb) being true (i.e. the write to EXT4_FLAGS_SHUTDOWN
not being propagated in time to the reader). __ext4_remount therefore misses
the shutdown check and can remount the fs as rw without giving any errors.

I am not sure about the severity of this but it is probably something hard to
find otherwise so I thought it might be useful to share it here and see what
you guys think.

Thank you very much for your time!

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-09 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09 18:05 [Bug 219254] New: Missing memory barrier in __ext4_remount for checking ext4_forced_shutdown bugzilla-daemon

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