summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-06LookupServer: Rename DNSPacket -> DNSPacketHeaderSergey Bugaev
This is a more appropriate name for what the class represents, and we'll be reusing the name DNSPacket for something different soon.
2021-02-06LookupServer+LibC: Pass IP addresses in binarySergey Bugaev
Now that we no longer depend on the textual IPC format, we can pass IP addresses in the format most code actually has and needs it: in binary. The only places we actually have to deal with textual address representation is: * When reading /etc/hosts, we have to parse textual addresses & convert them to binary; * When doing reverse lookups, we have to form a pseudo-hostname of the form x.x.x.x.in-addr.arpa. So we do the conversion in those two cases. This also increases uniformity between how we handle A (IPv4 address) and other resource record types. Namely, we now store the raw binary data as received from a DNS server.
2021-02-06Kernel: And some more KUBSAN checks :^)Andreas Kling
Here comes a few more: * enum * object-size * vptr
2021-02-06Kernel: Implement some more KUBSAN checks :^)Andreas Kling
This patch enables the following -fsanitize sub-options: * bounds * bounds-strict * integer-divide-by-zero * return * shift * shift-base * shift-exponent
2021-02-06LookupServer: Switch to LibIPC :^)Sergey Bugaev
The ad-hoc IPC we were doing with LookupServer was kinda gross. With this, LookupServer is a regular IPC server. In the future, we want to add more APIs for LookupServer to talk to its clients (such as DHCPClient telling LookupServer about the DNS server discovered via DHCP, and DNS-SD client browsing for services), which calls for a more expressive IPC format; this is what LibIPC is perfect for. While the LookupServer side is using the regular LibIPC mechanics and patterns, the LibC side has to hand-roll LibIPC format serialization without actually using LibIPC. We might be able to get rid of this in the future, but for now it has to be like that. The good news is the format is not that bad at all.
2021-02-06LookupServer: Move into `LookupServer` namespaceSergey Bugaev
2021-02-06Profiler: Display timing information in ProfileTimelineWidgetSahan Fernando
Currently, there is no way to know when in a profile's duration a sample was taken. This commit adds a basic timestamp to the timeline widget, and a black bar to show where the cursor is hovering over.
2021-02-06Documentation: Clarify macOS build instructionsjarhill0
I just ran through successfully building and running SerenityOS under macOS. I ran into two main things that I struggled with, which were - properly enabling osxfuse (through System Preferences) - running the suggested command about compiler versions in such a way that would be compatible with Ninja (as it turns out, I just needed to add `-G Ninja` to the command) This commit clarifies those things for anyone who may follow
2021-02-05Kernel: Don't left-shift 1 (signed) 31 timesAndreas Kling
Found by KUBSAN :^)
2021-02-05Kernel: Don't create a zero-length VLA in Ext2FS block list walkAndreas Kling
Found by KUBSAN :^)
2021-02-05Kenrel: Implement two more KUBSAN checksAndreas Kling
This patch adds the following UndefinedBehaviorSanitizer sub-options: * signed-integer-overflow * vla-bound
2021-02-05AK: Avoid UB in TypedTransferAndreas Kling
Don't be calling __builtin_memfoo() with null pointer arguments. Found by KUBSAN :^)
2021-02-05Kernel: Add missing initializer for SharedIRQHandler::m_enabledAndreas Kling
Found by KUBSAN :^)
2021-02-05Kernel: KUBSAN! (Kernel Undefined Behavior SANitizer) :^)Andreas Kling
We now build the kernel with partial UBSAN support. The following -fsanitize sub-options are enabled: * nonnull-attribute * bool If the kernel detects UB at runtime, it will now print a debug message with a stack trace. This is very cool! I'm leaving it on by default for now, but we'll probably have to re-evaluate this as more options are enabled and slowdown increases.
2021-02-05LibJS: GlobalObject must mark builtin prototypesAndreas Kling
Failing to mark them leads to use-after-free since the GlobalObject cached prototypes are used for new NumberObject, StringObject, etc. Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30319
2021-02-05LibM: Implement nextafter() and nexttoward()Andreas Kling
Patch from Anonymous.
2021-02-05Userland: Add LibSystem and funnel all syscalls through itAndreas Kling
This achieves two things: - Programs can now intentionally perform arbitrary syscalls by calling syscall(). This allows us to work on things like syscall fuzzing. - It restricts the ability of userspace to make syscalls to a single 4KB page of code. In order to call the kernel directly, an attacker must now locate this page and call through it.
2021-02-05LibELF: Only set up PLT trampoline for objects with a PLTAndreas Kling
2021-02-05LibM: Build and install the LibM testAndreas Kling
This test seems to be full of wrong, but at least now we build it and place it in /usr/Tests/LibM/ so that we can fix it.
2021-02-05LibJS: Improve correctness of rounding and bitwise operationsAndreas Kling
Patch from Anonymous
2021-02-05LibM: Improve accuracy of rounding related functionsAndreas Kling
Patch from Anonymous.
2021-02-05Kernel: Add NE2000 network card driverJean-Baptiste Boric
Remember, friends don't let friends use NE2000 network cards :^)
2021-02-05Kernel: Clear pending interrupts before enabling IRQs of IDE ChannelLiav A
Calling detect_disks() can generate interrupts, so we must clear it to allow proper function when booting with kernel argument smp=on.
2021-02-05Kernel: Try to detect Sound Blaster 16 before creating an instanceLiav A
We shouldn't create a SB16 instance without checking if the Sound Blaster 16 card is actually installed in the system.
2021-02-05bt: Hyperlink filenames in backtraces if available :^)Andreas Kling
If we can find a matching filename in /usr/src/serenity, let's make the filenames in backtraces clickable to open that file.
2021-02-05bt: Show filenames and line numbers when available :^)Andreas Kling
2021-02-05SymbolServer: Resolve filenames and line numbers from debug info :^)Andreas Kling
This makes symbolication take a little longer the first time we load a shared library, but then the cache keeps it warm.
2021-02-04SymbolServer: Cache failed ELF loads as wellAndreas Kling
Remember which paths we've already tried to load. This stops it from whining about /boot/Kernel not being mappable.
2021-02-04SymbolServer+LibSymbolClient: Just do one symbol per IPC messageAndreas Kling
I originally wanted to batch the symbolication requests but that just makes the client logic significantly more complicated with no real benefit other than architectural feelgood points.
2021-02-04SystemMonitor: Use SymbolServer to symbolicate thread stacksAndreas Kling
2021-02-04LibSymbolClient+bt: Move bt logic to SymbolClient::symbolicate_thread()Andreas Kling
Since this is useful in many places, let's have a common implementation of walking the stack of a given thread via /proc and symbolicating each of the frames.
2021-02-04SymbolServer+bt: Symbolicate kernel addresses if /boot/Kernel availableAndreas Kling
The /boot directory is only accessible to root by default, but anyone wanting access to kernel symbols for development can get them by making /boot/Kernel accessible to the "symbol" user.
2021-02-04bt: Add a little backtrace program that uses SymbolServerAndreas Kling
Usage: bt <PID> This program will print a symbolicated backtrace for the main thread of the process with the given PID. It uses SymbolServer for the symbolication. There's a lot of room for improvement in this command, but it is pretty neat already. :^)
2021-02-04LibSymbolClient: Add helper library for interfacing with SymbolServerAndreas Kling
2021-02-04SymbolServer: Add symbolication service for out-of-process ELF parsingAndreas Kling
This patch adds SymbolServer, a service daemon that provides symbolication of ELF binaries. It has a very simple IPC API at the moment that only turns addresses into symbol names. This can be used to implement symbolication without having to do in-process ELF parsing yourself. :^)
2021-02-04Kernel: Make /proc/PID/stacks/TID a JSON arrayAndreas Kling
The contents of these files are now raw JSON arrays. We no longer symbolicate the addresses. That's up to userspace from now on.
2021-02-04Make it possible to overwrite debug macros locally.asynts
Leaking macros across headers is a terrible thing, but I can't think of a better way of achieving this. - We need some way of modifying debug macros from CMake to implement ENABLE_ALL_THE_DEBUG_MACROS. - We need some way of modifying debug macros in specific source files because otherwise we need to rebuild too many files. This was done using the following script: sed -i -E 's/#cmakedefine01 ([A-Z0-9_]+)/#ifndef \1\n\0\n#endif\n/' AK/Debug.h.in sed -i -E 's/#cmakedefine01 ([A-Z0-9_]+)/#ifndef \1\n\0\n#endif\n/' Kernel/Debug.h.in
2021-02-04LibJS: Fix obviously wrong \uXXXX serialization in JSONObjectAndreas Kling
2021-02-04LibELF: Randomize the VM reservation (so we don't break ASLR)Andreas Kling
2021-02-03LibELF: Make a dummy VM reservation before mapping dynamic objectsAndreas Kling
Using the text segment for the VM reservation ran into trouble when there was a discrepancy between the p_filesz and p_memsz. Simplify this mechanism and avoid trouble by making the reservation as a MAP_PRIVATE | MAP_NORESERVE throwaway mapping instead. Fixes #5225.
2021-02-03LibELF: Remove dynamic loader syscall exception for libkeyboard.soAndreas Kling
LibKeyboard no longer needs to make syscalls so remove the exception we were making for it. :^)
2021-02-03LibC+LibKeyboard: Move getkeymap()+setkeymap() syscall wrappers to LibCAndreas Kling
2021-02-03LibWeb: Basic implementation of global event handlers :^)Andreas Kling
Document and HTMLElement now inherit from HTML::GlobalEventHandlers which allows them to support "onfoo" event handler attributes. These are assignable both via IDL attributes and content attributes. Event listeners constructed this way get a special "attribute" flag on them so we know which one to replace if you reassign them. This also allows them to coexist with EventTarget.addEventListener(). This is all a bit sloppy, but it works decently for a first cut. The Window object should also inherit GlobalEventHandlers, but since we don't generate it from IDL, I haven't taken that step here. Also this would be a lot nicer if we supported IDL mixins.
2021-02-03LibWeb: Add enumerator macro for all the "global event handlers"Andreas Kling
2021-02-03LibWeb: Add a whole bunch of onfooevent names to HTML::AttributeNamesAndreas Kling
2021-02-03Base: Make /www read-write by defaultBen Wiederhake
Since it is owned by root anyway, there is no need for 'additional security' to prevent modification of that directory. This makes it easier to quickly export files from Serenity. Fixes #5152.
2021-02-03Revert "Meta: Enable CodeQL static analysis for Serenity"Andreas Kling
This reverts commit f0bf723424069a03a5b5f9264e2a88e35cab568d. CodeQL never finds anything and regularly crashes, failing the build.
2021-02-03Kernel: Move perf event backtrace capture out of Thread classAndreas Kling
There's no need for this to be generic and support running from an arbitrary thread context. Perf events are always generated from within the thread being profiled, so take advantage of that to simplify the code. Also use Vector capacity to avoid heap allocations.
2021-02-03Everywhere: Remove some bitrotted "#if 0" blocksAndreas Kling
2021-02-03Kernel: Don't try to symbolicate user addresses with ksymsAndreas Kling
That's just not gonna work. :^)