1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00
serenity/Kernel/FileSystem
Andreas Kling 9eef39d68a Kernel: Start implementing x86 SMAP support
Supervisor Mode Access Prevention (SMAP) is an x86 CPU feature that
prevents the kernel from accessing userspace memory. With SMAP enabled,
trying to read/write a userspace memory address while in the kernel
will now generate a page fault.

Since it's sometimes necessary to read/write userspace memory, there
are two new instructions that quickly switch the protection on/off:
STAC (disables protection) and CLAC (enables protection.)
These are exposed in kernel code via the stac() and clac() helpers.

There's also a SmapDisabler RAII object that can be used to ensure
that you don't forget to re-enable protection before returning to
userspace code.

THis patch also adds copy_to_user(), copy_from_user() and memset_user()
which are the "correct" way of doing things. These functions allow us
to briefly disable protection for a specific purpose, and then turn it
back on immediately after it's done. Going forward all kernel code
should be moved to using these and all uses of SmapDisabler are to be
considered FIXME's.

Note that we're not realizing the full potential of this feature since
I've used SmapDisabler quite liberally in this initial bring-up patch.
2020-01-05 18:14:51 +01:00
..
Custody.cpp Kernel: Don't create a String every time we look up a Custody by name 2019-08-25 06:45:14 +02:00
Custody.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
DevPtsFS.cpp Kernel: Entries in /dev/pts should be accessible only to the owner 2020-01-04 12:46:48 +01:00
DevPtsFS.h Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00
DiskBackedFileSystem.cpp Kernel: Implement O_DIRECT open() flag to bypass disk caches 2019-11-05 19:35:12 +01:00
DiskBackedFileSystem.h Kernel: Implement O_DIRECT open() flag to bypass disk caches 2019-11-05 19:35:12 +01:00
ext2_fs.h Add clang-format file 2019-05-28 17:31:20 +02:00
ext2_types.h Add clang-format file 2019-05-28 17:31:20 +02:00
Ext2FileSystem.cpp Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00
Ext2FileSystem.h Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00
FIFO.cpp Kernel: Make File's can_read/can_write take a const FileDescription& 2019-11-04 14:03:14 +01:00
FIFO.h Kernel: Make File's can_read/can_write take a const FileDescription& 2019-11-04 14:03:14 +01:00
File.cpp Kernel: File::open() should apply r/w mode from the provided options 2020-01-04 12:30:55 +01:00
File.h Kernel: Allow fchmod() and fchown() on pre-bind() local sockets 2020-01-03 20:14:56 +01:00
FileDescription.cpp Kernel: Start implementing x86 SMAP support 2020-01-05 18:14:51 +01:00
FileDescription.h Kernel: Allow fchmod() and fchown() on pre-bind() local sockets 2020-01-03 20:14:56 +01:00
FileSystem.cpp AK: Use size_t for the length of strings 2019-12-09 17:51:21 +01:00
FileSystem.h Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00
Inode.cpp Kernel: Rename vmo => vmobject everywhere 2019-12-19 19:15:27 +01:00
Inode.h Kernel: Rename vmo => vmobject everywhere 2019-12-19 19:15:27 +01:00
InodeFile.cpp Kernel: Allow fchmod() and fchown() on pre-bind() local sockets 2020-01-03 20:14:56 +01:00
InodeFile.h Kernel: Allow fchmod() and fchown() on pre-bind() local sockets 2020-01-03 20:14:56 +01:00
InodeIdentifier.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
InodeMetadata.h Kernel: Don't include the process GID in the "extra GIDs" table 2020-01-02 23:45:52 +01:00
InodeWatcher.cpp Kernel: Make File's can_read/can_write take a const FileDescription& 2019-11-04 14:03:14 +01:00
InodeWatcher.h Kernel: Make File's can_read/can_write take a const FileDescription& 2019-11-04 14:03:14 +01:00
ProcFS.cpp Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00
ProcFS.h Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00
TmpFS.cpp Kernel: The root inode of a TmpFS should have the sticky bit set 2020-01-04 11:33:36 +01:00
TmpFS.h Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00
VirtualFileSystem.cpp Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00
VirtualFileSystem.h Kernel: Allow passing initial UID and GID when creating new inodes 2020-01-03 20:13:21 +01:00