summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-01-03LibCore: Fix crash on RPC client disconnectAndreas Kling
The RPC client management was not updated for the changes that made CObject reference-counted it seems. :^)
2020-01-03LibCore: Stop making the RPC sockets go=rwAndreas Kling
Now that we can fchmod() on a pre-bind() socket, use that to lock down the RPC sockets we publish in all CEventLoop-driven programs.
2020-01-03SystemServer: Make service sockets owned by the configured userAndreas Kling
Also make the sockets readable and writable only by that user. This fixes a bug where anyone could connect to anyone else's services, most obviously WindowServer.
2020-01-03Kernel: Allow fchmod() and fchown() on pre-bind() local socketsAndreas Kling
In order to ensure a specific owner and mode when the local socket filesystem endpoint is instantiated, we need to be able to call fchmod() and fchown() on a socket fd between socket() and bind(). This is because until we call bind(), there is no filesystem inode for the socket yet.
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.
2020-01-03Ext2FS: Take the inode lock in Ext2FSInode::metadata()Andreas Kling
Remove an unnecessary InterruptDisabler to make this not assert. :^)
2020-01-03Kernel: InodeVMObject can't call Inode::size() with interrupts disabledAndreas Kling
Inode::size() may try to take a lock, so we can't be calling it with interrupts disabled. This fixes a kernel hang when trying to execute a binary in a TmpFS.
2020-01-03Kernel: Remove unnecessary logic in kill() and killpg() syscallsAndreas Kling
As Sergey pointed out, do_killpg() already interprets PID 0 as the PGID of the calling process.
2020-01-03Kernel: Use get_fast_random() for the random syscall stack offsetAndreas Kling
2020-01-03Kernel: Add a more expressive API for getting random bytesAndreas Kling
We now have these API's in <Kernel/Random.h>: - get_fast_random_bytes(u8* buffer, size_t buffer_size) - get_good_random_bytes(u8* buffer, size_t buffer_size) - get_fast_random<T>() - get_good_random<T>() Internally they both use x86 RDRAND if available, otherwise they fall back to the same LCG we had in RandomDevice all along. The main purpose of this patch is to give kernel code a way to better express its needs for random data. Randomness is something that will require a lot more work, but this is hopefully a step in the right direction.
2020-01-03Kernel: Remove read_tsc() syscallAndreas Kling
Since nothing is using this, let's just remove it. That's one less thing to worry about.
2020-01-03Lib: Remove Stopwatch classAndreas Kling
This was a hack used to profile things before we had a proper profiler. Since RDTSC is not available in userspace, this is not useful anymore.
2020-01-03Kernel: The superuser is allowed to utime() on any fileAndreas Kling
Before this patch, root was not able to "touch" someone else's file.
2020-01-03Kernel: rename() should fail with EXDEV for cross-device requestsAndreas Kling
POSIX does not support rename() from one file system to another.
2020-01-03test_io: Test that seeking past EOF and then reading returns 0Andreas Kling
2020-01-03Kernel: Fix awkward bug where "touch /foo/bar/baz" could create "/baz"Andreas Kling
To accomodate file creation, path resolution optionally returns the last valid parent directory seen while traversing the path. Clients will then interpret "ENOENT, but I have a parent for you" as meaning that the file doesn't exist, but its immediate parent directory does. The client then goes ahead and creates a new file. In the case of "/foo/bar/baz" where there is no "/foo", it would fail with ENOENT and "/" as the last seen parent directory, causing e.g the open() syscall to create "/baz". Covered by test_io.
2020-01-03Kernel: Unbreak module loading (broke with NX bit changes)Andreas Kling
Modules are now mapped fully RWX. This can definitely be improved, but at least it unbreaks the feature for now.
2020-01-03test_io: Verify that write() on an O_RDONLY fd fails with EBADFAndreas Kling
2020-01-03test_io: Verify that read() on an O_WRONLY fd fails with EBADFAndreas Kling
2020-01-03Kernel: read() and write() should fail with EBADF for wrong mode fd'sAndreas Kling
It was previously possible to write to read-only file descriptors, and read from write-only file descriptors. All FileDescription objects now start out non-readable + non-writable, and whoever is creating them has to "manually" enable reading/writing by calling set_readable() and/or set_writable() on them.
2020-01-03test_io: Add a simple test program that abuses some I/O syscallsAndreas Kling
This exposes some very bad behaviors that will need fixing.
2020-01-03Kernel: Don't allow open() with (O_CREAT | O_DIRECTORY)Andreas Kling
2020-01-03Kernel: Handle O_DIRECTORY in VFS::open() instead of in each syscallAndreas Kling
Just taking care of some FIXMEs.
2020-01-03Kernel: killpg() with pgrp=0 should signal every process in the groupAndreas Kling
In the same group as the calling process, that is.
2020-01-03Kernel: kill() with signal 0 should not actually send anythingAndreas Kling
Also kill() with pid 0 should send to everyone in the same process group as the calling process.
2020-01-03Kernel: Remove unnecessary wraparound check in Process::validate_read()Andreas Kling
This will be checked moments later by MM.validate_user_read().
2020-01-03Ports: Add missing ' after timestamp in GCC patch (#1004)elodotwe
Looks like this got missed, maybe a messy `git add --patch` job? It caused packaging of the gcc port to fail.
2020-01-03Keymap+Base: Keycode fixes, remove workaroundTibor Nagy
Add missing keymap entries for the dollar sign and escape key and reformat the Hungarian keymap. Remove the workaround for "0x08", replace it with '\b'. Fix the octal/hex mixup in the value of escape key. (033 != 0x33, 033 == 0x1B)
2020-01-02Kernel: Don't include the process GID in the "extra GIDs" tableAndreas Kling
Process::m_extra_gids is for supplementary GIDs only.
2020-01-02SystemServer: Call setgid() before setuid() when dropping privilegesAndreas Kling
Also add error checking and bail out if either call fails. Doing it the wrong way around was causing us to retain GID=0 for all processes (oops!) Thanks to Chris Ball for reporting the bug. :^)
2020-01-02Kernel: Make the loop that marks the bottom 1MB NX a little less busyAndreas Kling
2020-01-02Kernel: Fixing PCI MMIO access mechanismLiav A
During initialization of PCI MMIO access mechanism we ensure that we have an allocation from the kernel virtual address space that cannot be taken by other components in the OS. Also, now we ensure that interrupts are disabled so mapping the region doesn't fail. In order to reduce overhead, map_device() will map the requested PCI address only if it's not mapped already. The run script has been changed so now we can boot a Q35 machine, that supports PCI ECAM. To ensure we will be able to load the machine, a PIIX3 IDE controller was added to the Q35 machine configuration in the run script. An AHCI controller was added to the i440fx machine configuration.
2020-01-02Build: add support for building on OpenBSDjoshua stein
This requires gcc8 from ports to build the Toolchain.
2020-01-02Build: HOST_CXX -> USE_HOST_CXXjoshua stein
Allow HOST_CXX to be passed to make which will be the actual host C++ compiler used, such as 'make HOST_CXX=clang++'.
2020-01-02LibGUI: Clear out a GJsonArrayModel if it fails to open the JSON sourceAndreas Kling
This fixes an issue in SystemMonitor where old data would linger in the table views after selecting a process owned by another user. Since we can no longer read /proc/PID/* unless PID belongs to us, we will now present empty views for these processes. :^)
2020-01-02ProfileViewer: Interpret addresses >= 0xc0000000 as kernel framesAndreas Kling
2020-01-02Kernel: Mask kernel addresses in backtraces and profilesAndreas Kling
Addresses outside the userspace virtual range will now show up as 0xdeadc0de in backtraces and profiles generated by unprivileged users.
2020-01-02Kernel: Move kernel symbols to /res/kernel.map and make it root-onlyAndreas Kling
Let's lock down access to the kernel symbol table, since it trivializes learning where the kernel functions are. Of course, you can just build the same revision yourself locally and learn the information, but we're taking one step at a time here. :^)
2020-01-02WindowServer: Make tiled windows actually centered.Chyza
The right window had a few pixels on the right cut off, i don't know how i didn't notice this earlier.
2020-01-02PaintBrush: Select tool button on context menu eventShannon Booth
This means that (for example) if you change the line width of the line tool, you now switch to the line tool, instead of sticking with the currently "checked" tool.
2020-01-02WindowServer: Close all menus belonging to a client when it disconnectsAndreas Kling
Previously we would be left with a menu stack containing nulled-out WeakPtr's to menus in the now-disconnected clients. This was tripping up an assertion when clicking anywhere after shutting down a program while it had a menu open.
2020-01-02Kernel: Add some missing error checks to the setpgid() syscallAndreas Kling
2020-01-02Browser+LibHTML: Add resolved element style to the DOM inspectorAndreas Kling
When selecting an element in the browser's DOM inspector, we now also show the resolved CSS properties (and their values) for that element. Since the inspector was growing a bit more complex, I moved it out of the "show inspector" action callback and into its own class. In the future, we will probably want to migrate the inspector down to LibHTML to make it accessible to other clients of the library, but for now we can keep working on it inside Browser. :^)
2020-01-02LibHTML: Include element attributes in the DOMTreeModelAndreas Kling
We simply expand the attributes inside the element item name, so they look like natural "tags" :^)
2020-01-02LibHTML: Have element keep a pointer to their resolved styleAndreas Kling
This will make it easy to implement a simple element style inspector.
2020-01-02Kernel: Remove debug spam about marking threads for deathAndreas Kling
2020-01-02Kernel: Make the purge() syscall superuser-onlyAndreas Kling
I don't think we need to give unprivileged users access to what is essentially a kernel testing mechanism.
2020-01-02LibC+Userland: Add a proper syscall wrapper for purge()Andreas Kling
2020-01-02Kernel: writev() should fail with EINVAL if total length > INT32_MAXAndreas Kling
2020-01-02Kernel: Remove broken implementation of Unix SHMAndreas Kling
This code never worked, as was never used for anything. We can build a much better SHM implementation on top of TmpFS or similar when we get to the point when we need one.