summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-01-11SystemMonitor: Display mount flagsSergey Bugaev
2020-01-11Userland: Support mount flagsSergey Bugaev
2020-01-11Kernel+LibC: Implement a few mount flagsSergey Bugaev
We now support these mount flags: * MS_NODEV: disallow opening any devices from this file system * MS_NOEXEC: disallow executing any executables from this file system * MS_NOSUID: ignore set-user-id bits on executables from this file system The fourth flag, MS_BIND, is defined, but currently ignored.
2020-01-11Kernel+LibC: Add O_EXEC, move exec permission checking to VFS::open()Sergey Bugaev
O_EXEC is mentioned by POSIX, so let's have it. Currently, it is only used inside the kernel to ensure the process has the right permissions when opening an executable.
2020-01-11Kernel+LibC: Add support for mount flagsSergey Bugaev
At the moment, the actual flags are ignored, but we correctly propagate them all the way from the original mount() syscall to each custody that resides on the mounted FS.
2020-01-11Kernel: Simplify VFS::Mount handlingSergey Bugaev
No need to pass around RefPtr<>s and NonnullRefPtr<>s and no need to heap-allocate them. Also remove VFS::mount(NonnullRefPtr<FS>&&, StringView path) - it has been unused for a long time.
2020-01-11WindowServer: If a menu can't fit on screen, at least put it at y=0Andreas Kling
We're gonna need to handle overflow better than this, but at least this way we can see the top of the menu, even if we can't scroll down to see the rest of it. For #1043.
2020-01-11ls: Cache the user and group names instead of looking up every timeAndreas Kling
2020-01-11Base: Run ProtocolServer as a separate "protocol" userAndreas Kling
This is probably not the final design we'll want for this, but for now let's run the HTTP client code as a separate user to reduce exposure for the standard "anon" user account. Note that "protocol" is also added to the "lookup" group, in order to allow ProtocolServer to contact LookupServer for DNS requests.
2020-01-11Kernel: Oops, recvfrom() is not quite ready for SMAP protections yetAndreas Kling
2020-01-11LibPthread: Fix incompatible pthread_setname_np(), pthread_getname_np()Andreas Kling
Other implementations of pthread_setname_np() do not take the name length as an argument. For pthread_getname_np(), other implementations take the buffer size as a size_t. This patch brings us in line with other implementations.
2020-01-11Kernel: Use the Syscall string and buffer types moreAndreas Kling
While I was updating syscalls to stop passing null-terminated strings, I added some helpful struct types: - StringArgument { const char*; size_t; } - ImmutableBuffer<Data, Size> { const Data*; Size; } - MutableBuffer<Data, Size> { Data*; Size; } The Process class has some convenience functions for validating and optionally extracting the contents from these structs: - get_syscall_path_argument(StringArgument) - validate_and_copy_string_from_user(StringArgument) - validate(ImmutableBuffer) - validate(MutableBuffer) There's still so much code around this and I'm wondering if we should generate most of it instead. Possible nice little project.
2020-01-11Kernel: Remove SmapDisabler in bind()Andreas Kling
2020-01-11Kernel: Remove SmapDisabler in clock_nanosleep()Andreas Kling
2020-01-11Kernel: Remove validate_read_str() as nothing uses it anymore :^)Andreas Kling
2020-01-11Kernel: Pass a parameter struct to mount()Andreas Kling
This was the last remaining syscall that took a null-terminated string and figured out how long it was by walking it in kernelspace *shudder*.
2020-01-11Kernel: Pass a parameter struct to rename()Andreas Kling
2020-01-11Kernel: Pass a parameter struct to symlink()Andreas Kling
2020-01-11Kernel: Pass a parameter struct to mknod()Andreas Kling
2020-01-11Kernel: Pass a parameter struct to chown()Andreas Kling
2020-01-10Kernel: Expose a process's filesystem root as a /proc/PID/root symlinkAndreas Kling
In order to preserve the absolute path of the process root, we save the custody used by chroot() before stripping it to become the new "/". There's probably a better way to do this.
2020-01-10chroot: Add a little chroot programAndreas Kling
This program changes the current filesystem root and spawns a shell.
2020-01-10Kernel: Add a basic chroot() syscall :^)Andreas Kling
The chroot() syscall now allows the superuser to isolate a process into a specific subtree of the filesystem. This is not strictly permanent, as it is also possible for a superuser to break *out* of a chroot, but it is a useful mechanism for isolating unprivileged processes. The VFS now uses the current process's root_directory() as the root for path resolution purposes. The root directory is stored as an uncached Custody in the Process object.
2020-01-10Kernel: Custody::absolute_path() should always return "/" for rootsAndreas Kling
A Custody with no parent is always *a* root (although not necessarily the *real* root.)
2020-01-10Kernel: Pass characters+length to link()Andreas Kling
2020-01-10Kernel: Rename Syscall::SyscallString => Syscall::StringArgumentAndreas Kling
2020-01-10Kernel: Pass characters+length to readlink()Andreas Kling
Note that I'm developing some helper types in the Syscall namespace as I go here. Once I settle on some nice types, I will convert all the other syscalls to use them as well.
2020-01-10Kernel: Copy Region's "is_mmap" flag when cloning regions for fork()Andreas Kling
Otherwise child processes will not be allowed to munmap(), madvise(), etc. on the cloned regions!
2020-01-10Kernel: Fix kernel null deref on process crash during join_thread()Andreas Kling
The join_thread() syscall is not supposed to be interruptible by signals, but it was. And since the process death mechanism piggybacked on signal interrupts, it was possible to interrupt a pthread_join() by killing the process that was doing it, leading to confusing due to some assumptions being made by Thread::finalize() for threads that have a pending joiner. This patch fixes the issue by making "interrupted by death" a distinct block result separate from "interrupted by signal". Then we handle that state in join_thread() and tidy things up so that thread finalization doesn't get confused by the pending joiner being gone. Test: Tests/Kernel/null-deref-crash-during-pthread_join.cpp
2020-01-10LibGUI: Fix rendering GColumnsView separatorAndreas Kling
Patch by Sergey Bugaev.
2020-01-10FileManager: Add a columns viewSergey Bugaev
This new view, backed by a GColumnsView, joins the existing table and icon views :^) Even though it displays a file tree, its data is provided by the very same GFileSystemModel that the other two views use. This commit also includes my attempt at making an icon for the new mode.
2020-01-10LibGUI: Add GColumnsViewSergey Bugaev
This is a shiny new widget that can display a tree using Miller columns ^:) In many cases, the columns view can be used as an alternative to tree view, but it has its own set of limitations: * It can only display one model column (so it cannot replace a table) * It takes up a lot of horizontal space, so it's only suitable if the item text is fairly short * It can only display one subtree at a time But as long as a usecase doesn't suffer from these limitations, a columns view can be *much* more intuitive than a tree view.
2020-01-10LibGUI+FileManager: Misc tweaks courtesy of clang-formatSergey Bugaev
2020-01-10LibGUI+FileManager: Merge GDirectoryModel into GFileSystemModelSergey Bugaev
We used to have two different models for displaying file system contents: the FileManager-grade table-like directory model, which exposed rich data (such as file icons with integrated image previews) about contents of a single directory, and the tree-like GFileSystemModel, which only exposed a tree of file names with very basic info about them. This commit unifies the two. The new GFileSystemModel can be used both as a tree-like and as a table-like model, or in fact in both ways simultaneously. It exposes rich data about a file system subtree rooted at the given root. The users of the two previous models are all ported to use this new model.
2020-01-10LibGUI: Add GAbstractView::activate_selected()Sergey Bugaev
This is a nice little utility to activate all the selected items, which is what you usually want to do.
2020-01-10LibGUI: Fix GModel::is_valid() behavior for tree-like modelsSergey Bugaev
2020-01-10LibGUI: Fix tree view column positioning when some columns are hiddenSergey Bugaev
2020-01-10Kernel: Remove SmapDisablers in fchmod() and fchown()Andreas Kling
2020-01-10Kernel: unlink() should not follow symlinksAndreas Kling
2020-01-10rm: When invoked on a symlink, remove the symlink itselfAndreas Kling
2020-01-10LibC: Remove useless retry loop in connect_to_lookup_server()Andreas Kling
2020-01-10TmpFS: Synthesize "." and ".." in traverse_as_directory()Andreas Kling
As Sergey pointed out, it's silly to have proper entries for . and .. in TmpFS when we can just synthesize them on the fly. Note that we have to tolerate removal of . and .. via remove_child() to keep VFS::rmdir() happy.
2020-01-10Kernel: Enable SMAP protection during the execve() syscallAndreas Kling
The userspace execve() wrapper now measures all the strings and puts them in a neat and tidy structure on the stack. This way we know exactly how much to copy in the kernel, and we don't have to use the SMAP-violating validate_read_str(). :^)
2020-01-10SystemServer: Expose service socket permissions to RPC clientsAndreas Kling
2020-01-10ProcFS: Don't expose kernel-only regions to users via /proc/PID/vmAndreas Kling
The superuser is still allowed to see them, but kernel-only VM regions are now excluded from /proc/PID/vm.
2020-01-10Kernel: Page allocation should not use memset_user() when zeroingAndreas Kling
We're not zeroing new pages through a userspace address, so this should not use memset_user().
2020-01-10Kernel+LibELF: Enable SMAP protection during non-syscall exec()Andreas Kling
When loading a new executable, we now map the ELF image in kernel-only memory and parse it there. Then we use copy_to_user() when initializing writable regions with data from the executable. Note that the exec() syscall still disables SMAP protection and will require additional work. This patch only affects kernel-originated process spawns.
2020-01-09Base: Let's make home directories 700 to keep things private :^)Andreas Kling
2020-01-09ls: Widen the user and group fields a little bitAndreas Kling
I didn't like looking at /tmp/portal now that lookup:lookup owns one of the sockets there :^)
2020-01-09Base: Add a "lookup" user+group that runs LookupServerAndreas Kling
LookupServer now runs as lookup:lookup, allowing connections from other members of the "lookup" group. This is enforced through file system permissions by having the service socket (/tmp/portal/lookup) be mode 0660. Now the LookupServer program can't overwrite other people's files if it starts misbehaving. That's pretty cool :^)