summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/ProcFS.h
AgeCommit message (Collapse)Author
2020-01-03Kernel: Allow passing initial UID and GID when creating new inodesAndreas Kling
If we're creating something that should have a different owner than the current process's UID/GID, we need to plumb that all the way through VFS down to the FS functions.
2019-12-31ProcFS: Reduce the amount of info accessible to non-superusersAndreas Kling
This patch hardens /proc a bit by making many things only accessible to UID 0, and also disallowing access to /proc/PID/ for anyone other than the UID of that process (and superuser, obviously.)
2019-08-17ProcFS: Do not assume there is one of itSergey Bugaev
The complication is around /proc/sys/ variables, which were attached to inodes. Now they're their own thing, and the corresponding inodes are lazily created (as all other ProcFS inodes are) and simply refer to them by index.
2019-08-05Kernel: Use KBuffers for ProcFS and SynthFSAndreas Kling
Instead of generating ByteBuffers and keeping those lying around, have these filesystems generate KBuffers instead. These are way less spooky to leave around for a while. Since FileDescription will keep a generated file buffer around until userspace has read the whole thing, this prevents trivially exhausting the kmalloc heap by opening many files in /proc for example. The code responsible for generating each /proc file is not perfectly efficient and many of them still use ByteBuffers internally but they at least go away when we return now. :^)
2019-07-16Kernel: Remove use of [[gnu::pure]].Andreas Kling
I was messing around with this to tell the compiler that these functions always return the same value no matter how many times you call them. It doesn't really seem to improve code generation and it looks weird so let's just get rid of it.
2019-07-03AK: Rename the common integer typedefs to make it obvious what they are.Andreas Kling
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
2019-06-21AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr.Andreas Kling
2019-06-09Kernel: Use StringView more in Inode and subclasses.Andreas Kling
2019-06-07Kernel: Rename FileDescriptor to FileDescription.Andreas Kling
After reading a bunch of POSIX specs, I've learned that a file descriptor is the number that refers to a file description, not the description itself. So this patch renames FileDescriptor to FileDescription, and Process now has FileDescription* file_description(int fd).
2019-06-01FileSystem: Make Inode::lookup() take a StringView.Andreas Kling
This avoids a lot of String allocation during path resolution.
2019-06-01FileSystem: Remove now-unused Inode::parent() and Inode::reverse_lookup().Andreas Kling
These were only used to implement the old path resolution algorithm.
2019-05-31FileSystem: Pass mode_t to Inode::add_child().Andreas Kling
This way the Ext2FS code can update its directory entry "file type" fields correctly based on the file mode. This fixes some e2fsck whining.
2019-05-28Add clang-format fileRobin Burchell
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
2019-05-16Kernel: Move Inode to its own files.Andreas Kling
2019-05-03Kernel+Userland: Implement mknod() syscall and add a /bin/mknod program.Andreas Kling
2019-04-23Do a pass of compiler warning fixes.Andreas Kling
This is really making me question not using 64-bit integers more.
2019-04-15Kernel: Make it possible to have kmalloc() dump call stacks.Andreas Kling
This can be enabled at any time using a sysctl: sysctl kmalloc_stacks=1 The stacks will go to the debugger output only.
2019-04-03Kernel: Move FS-related files into Kernel/FileSystem/Andreas Kling