summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-03-11crash: Fix typo in check logicBen Wiederhake
The remainder of the code assumes that the mmap was successful, so the 'unexpected error' case is that we see MAP_FAILED.
2021-03-11Userland: Remove superfluous headersBen Wiederhake
Userland has no reason to access 'kmalloc'.
2021-03-11xargs: Fix boring memory leakBen Wiederhake
It's only 1K (BUFSIZ), and it's immediately before xargs finishes anyway. However, I ran into it and know how to fix it, so let's clean this up.
2021-03-11UserspaceEmulator: Handle MAP_FIXED with invalid addresses betterBen Wiederhake
Old behavior: Crash due to VERIFY, unless we're completely and entirely out of memory (m_available_ranges being empty), in which case it would return -ENOMEM. New behavior: Return ENOMEM (and don't crash). In the case of nullptr, also emit a helpful diagnostic. Note that MAP_FIXED with nullptr is technically okay, but tends to be a sign that something went wrong. Also, this should improve mmap performance marginally, as it pulls the check out of a loop that does not modify any parts of the check. UE is now self-hosting! Fixes #5709. However, this still needs some love: "ue UserspaceEmulator true" spits out tons of error messages, probably false-positives, and takes about 229 seconds to run. Then again, true-in-ue-in-ue-in-Qemu is three levels of emulation, so no wonder it takes a long time! :D
2021-03-11UserspaceEmulator: Do not pass MAP_FIXED to KernelBen Wiederhake
Since there is usually no correlation between guest memory-layout and UE memory-layout, this option does not make any sense. Especially since we provide nullptr.
2021-03-11UserspaceEmulator: Implement set_process_name syscallBen Wiederhake
2021-03-11UserspaceEmulator: Split large file into logical piecesBen Wiederhake
2021-03-11LibWeb: Remove FIXME in is_javascript_mime_type_essence_matchLuke
This was misleading. The spec just wants us to check a string matches a string in the JavaScript MIME type essence list. It doesn't want us to parse the string as a MIME type to then use its essence for the check. Renames "mime_type" to "string" to make this less misleading.
2021-03-11Meta: Add gdb command to serenity.shTom
This uses tmux for a split screen setup, which makes it easy do debug the kernel while viewing the QEMU output in the same terminal.
2021-03-10Kernel: Move process pledge promises into protected dataAndreas Kling
2021-03-10Kernel: Move process "dumpable" flag into protected dataAndreas Kling
2021-03-10Kernel: Move process parent PID into protected data :^)Andreas Kling
2021-03-10Kernel: Move process extra_gids into protected data :^)Andreas Kling
2021-03-10Kernel: Move select Process members into protected memoryAndreas Kling
Process member variable like m_euid are very valuable targets for kernel exploits and until now they have been writable at all times. This patch moves m_euid along with a whole bunch of other members into a new Process::ProtectedData struct. This struct is remapped as read-only memory whenever we don't need to write to it. This means that a kernel write primitive is no longer enough to overwrite a process's effective UID, you must first unprotect the protected data where the UID is stored. :^)
2021-03-10Kernel: Add non-const KBuffer::impl() getterAndreas Kling
2021-03-10fuzz-syscalls: Mark sys$emuctl() as someone who returns ENOSYSAndreas Kling
This syscall is only relevant inside UserspaceEmulator and the kernel will just return ENOSYS for it.
2021-03-10Kernel: Build with -WvlaAndreas Kling
Now that all use of VLA's (variable-length arrays) has been purged from the kernel, let's make sure we don't reintroduce them.
2021-03-10Kernel: Remove VLA usage in Ext2FS block traversal codeAndreas Kling
This was using up to 12KB of kernel stack in the triply indirect case and looks generally spooky. Let's just allocate a ByteBuffer for now and take the performance hit (of heap allocation). Longer term we can reorganize the code to reduce the majority of the heap churn.
2021-03-10Kernel: Turn a VLA into a statically-sized array in dump_backtrace()Andreas Kling
2021-03-10UserspaceEmulator: Remove debug spam about tracked malloc blocksAndreas Kling
2021-03-10Documentation: Add Serenity installation guide for VMwareBrendan Coles
2021-03-09Kernel: Convert klog() => dmesgln() in TCPSocketAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in MemoryManagerAndreas Kling
2021-03-09Kernel: Use dbgln_if() and PANIC() in Thread.cppAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in IPv4SocketAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in PageDirectoryAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in E1000NetworkAdapterAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in init()Andreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in ARP/routing codeAndreas Kling
2021-03-09Kernel: Convert klog() to dmesgln() in RegionAndreas Kling
2021-03-09AK: Add Formatter for RefPtrAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in AnonymousVMObjectAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in HPETAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in KernelRngAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in VMWareBackdoorAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in PS2MouseDeviceAndreas Kling
2021-03-09Kernel: Remove some unused things in kmalloc.cppAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in kmallocAndreas Kling
2021-03-09Kernel: Convert klog() => dmesgln() in filesystem codeAndreas Kling
2021-03-09Kernel: Remove ancient FIFO_DEBUG codeAndreas Kling
2021-03-09Utilities: Add a quotes database and 'fortunes' programBen Wiederhake
I told you, we need a quotes ~~page~~ file! :D
2021-03-09LibWeb: Run clang-format on CSS/Parser/StyleComponentValueRule.hAndreas Kling
2021-03-09LibWeb: Run clang-format on CSS/Parser/Token.hAndreas Kling
2021-03-09LibX86: Don't use "if (foo) [[unlikely]] { }" for now (to please clang)Andreas Kling
2021-03-09LibWeb: Add a whole bunch of rule classes for the new CSS parserAndreas Kling
Original work by @stelar7.
2021-03-09LibWeb: Rename CSSParser => DeprecatedCSSParserAndreas Kling
2021-03-09LibWeb: Add specification-based CSS tokenizerAndreas Kling
Original work by @stelar7 for #2628.
2021-03-09UserspaceEmulator: Add fast-path for is<MmapRegion>()Andreas Kling
Don't use default RTTI for these since they are performance-sensitive.
2021-03-09UserspaceEmulator+LibX86: Sprinkle some [[unlikely]] and ALWAYS_INLINEAndreas Kling
2021-03-09Emulator: Use libc.so bounds to fast-reject non-malloc addressesAndreas Kling
The auditing code always starts by checking if we're in one of the ignored code ranges (malloc, free, realloc, syscall, etc.) To reduce the number of checks needed, we can cache the bounds of the LibC text segment. This allows us to fast-reject addresses that cannot possibly be a LibC function.