1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00
serenity/Kernel/FileSystem
Sergey Bugaev fdb71cdf8f Kernel: Support read-only filesystem mounts
This adds support for MS_RDONLY, a mount flag that tells the kernel to disallow
any attempts to write to the newly mounted filesystem. As this flag is
per-mount, and different mounts of the same filesystems (such as in case of bind
mounts) can have different mutability settings, you have to go though a custody
to find out if the filesystem is mounted read-only, instead of just asking the
filesystem itself whether it's inherently read-only.

This also adds a lot of checks we were previously missing; and moves some of
them to happen after more specific checks (such as regular permission checks).

One outstanding hole in this system is sys$mprotect(PROT_WRITE), as there's no
way we can know if the original file description this region has been mounted
from had been opened through a readonly mount point. Currently, we always allow
such sys$mprotect() calls to succeed, which effectively allows anyone to
circumvent the effect of MS_RDONLY. We should solve this one way or another.
2020-05-29 07:53:30 +02:00
..
Custody.cpp Kernel: Support read-only filesystem mounts 2020-05-29 07:53:30 +02:00
Custody.h Kernel: Support read-only filesystem mounts 2020-05-29 07:53:30 +02:00
DevPtsFS.cpp Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
DevPtsFS.h Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
ext2_fs.h Meta: Remove some copyright headers added in error 2020-01-25 10:34:32 +01:00
ext2_types.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
Ext2FileSystem.cpp Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
Ext2FileSystem.h Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
FIFO.cpp Kernel: Add explicit offset parameter to File::read etc 2020-04-10 11:59:30 +02:00
FIFO.h Kernel: Add explicit offset parameter to File::read etc 2020-04-10 11:59:30 +02:00
File.cpp Kernel: Use a FlatPtr for the "argument" to ioctl() 2020-05-23 15:25:43 +02:00
File.h Kernel: Pass a FileDescription to File::chmod() and File::chown() 2020-05-29 07:53:30 +02:00
FileBackedFileSystem.cpp Kernel: Tweak FileBackedFS API to avoid intermediary copies 2020-05-19 11:07:35 +02:00
FileBackedFileSystem.h Kernel: Tweak FileBackedFS API to avoid intermediary copies 2020-05-19 11:07:35 +02:00
FileDescription.cpp Kernel: Pass a FileDescription to File::chmod() and File::chown() 2020-05-29 07:53:30 +02:00
FileDescription.h Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
FileSystem.cpp Kernel: Make FS::block_size a size_t 2020-05-19 11:07:35 +02:00
FileSystem.h Kernel: Clang format file system in prep for changes. 2020-05-26 10:15:40 +02:00
Inode.cpp Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
Inode.h Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
InodeFile.cpp Kernel: Pass a Custody instead of Inode to VFS methods 2020-05-29 07:53:30 +02:00
InodeFile.h Kernel: Pass a FileDescription to File::chmod() and File::chown() 2020-05-29 07:53:30 +02:00
InodeIdentifier.h Kernel: Move all code into the Kernel namespace 2020-02-16 01:27:42 +01:00
InodeMetadata.h Kernel: Use a FixedArray for a process's extra GIDs 2020-02-18 11:35:47 +01:00
InodeWatcher.cpp Kernel: Add explicit offset parameter to File::read etc 2020-04-10 11:59:30 +02:00
InodeWatcher.h Kernel: Add explicit offset parameter to File::read etc 2020-04-10 11:59:30 +02:00
ProcFS.cpp Kernel: Report source of synthetic filesystems as "none" 2020-05-29 07:53:30 +02:00
ProcFS.h Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
TmpFS.cpp Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
TmpFS.h Kernel: Plumb KResult through FileDescription::read_entire_file() implementation. 2020-05-26 10:15:40 +02:00
VirtualFileSystem.cpp Kernel: Support read-only filesystem mounts 2020-05-29 07:53:30 +02:00
VirtualFileSystem.h Kernel+LibC: Move O_* and MS_* flags to UnixTypes.h 2020-05-29 07:53:30 +02:00