summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
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-03Everywhere: Remove some bitrotted "#if 0" blocksAndreas Kling
2021-02-03LibWeb: Move main thread JavaScript VM to its own fileAndreas Kling
Instead of being a weird little global function in DOM/Document.cpp, you can now get the main thread JS VM via Bindings::main_thread_vm().
2021-02-03TextEditor: Implement word wrappingZac
Add a new wrapping mode to the TextEditor that will wrap lines at the spaces between words. Replace the previous menubar checkbox 'Wrapping Mode' in HackStudio and the TextEditor with an exclusive submenu which allows switching between 'No wrapping', 'Wrap anywhere' and 'Wrap at words'. 'Wrap anywhere' (the new 'Wrap lines') is still the default mode. Setting the wrapping mode in the constructors of the TextEditorWidget and HackStudio has been removed, it is now set when constructing the menubar actions.
2021-02-03LibC+LibELF: Run clang-formatAndreas Kling
2021-02-02LibELF: Make syscall region exceptions for UE and libkeyboard.soAndreas Kling
These two are currently making some syscalls so we'll have to make exceptions for them until we can clean them up.
2021-02-02LibX86: Don't assert just because insn has no immediate bytesAndreas Kling
It's perfectly fine to not have immediate bytes. Many insns don't :^)
2021-02-02LibELF: Mark libc.so and libpthread.so as syscall regionsAndreas Kling
Also, before calling the main program entry function, inform the kernel that no more syscall regions can be registered. This effectively bans syscalls from everywhere except LibC and LibPthread. Pretty neat! :^)
2021-02-02LibCore: Use serenity_readlink() instead of making syscalls directlyAndreas Kling
2021-02-02LibC: Add LibC wrapper for sys$readlink()Andreas Kling
To avoid having to make direct syscalls in LibCore, let's add a wrapper for the kernel's readlink syscall in LibC.
2021-02-02Revert "StatusBar: Allow GML files to set the number of labels to create"Andreas Kling
This reverts commit e11ec20650e5182f47675210dcd71e7301c34905. Broke FileManager, Browser, etc.
2021-02-02Revert "TextEditor: Add vim status indicators to the statusbar"Andreas Kling
This reverts commit bd6d0d229581e830c7a69cdb29252b9f63e0434a.
2021-02-02LibJS: Fix variable name coding style int{Part => _part}Linus Groh
...and rename intpart_end to int_part_end for consistency.
2021-02-02TextEditor: Add vim status indicators to the statusbarZac
When using the VimEditingEngine in the TextEditor, vim's mode and the previous key are shown in the editor's statusbar.
2021-02-02StatusBar: Allow GML files to set the number of labels to createZac
2021-02-01LibELF: Close dynamic objects after mapping and linking themAndreas Kling
Oops, we were leaving the file descriptors open.
2021-02-01LibC: Expose various option variables for later usageLiav A
These variables are used by the dmidecode utility to parse the commandline arguments that were specified by the user.
2021-02-01LibIPC: Stop sending client ID to clientsAndreas Kling
The client ID is not useful to normal clients anymore, so stop telling everyone what their ID is.
2021-02-01LibGUI+WindowServer: Don't use a WM IPC to initiate own window resizeAndreas Kling
The WM_* IPC messages are intended for "outsider" window management, not for a client's own windows. Make a separate StartWindowResize message for this. This was the only reason that every IPC client had to know its server side client ID.
2021-02-01LibJS: Use VM::names for Object::invoke() function namesLinus Groh
2021-02-01Kernel+LibKeyboard: Define the default keymap only in one placeBen Wiederhake
Because it was 'static const' and also shared with userland programs, the default keymap was defined in multiple places. This commit should save several kilobytes! :^)
2021-02-01LibKeyboard: Don't assert on failureBen Wiederhake
2021-02-01LibKeyboard+keymap: Support querying the keymap via commandlineBen Wiederhake
2021-02-01Kernel+LibKeyboard: Enable querying the current keymapBen Wiederhake
2021-02-01LibTextCodec: Avoid duplicate definition of standard encodingsBen Wiederhake
2021-01-31LibX86: sanity check for Instruction read sizeThomas Mangin
During "Emulator hacking: Let's make the userspace emulator go faster!", the switch implented in read() was inlined (toward the end of the video). This patch restore the assert check for any read other than 8, 16 or 32 bits was lost during the code conversion.
2021-01-31LibLine: Only print ascii characters in caret formAnotherTest
ctype's `iscntrl` truncates its input, making some codepoints appear as control characters. Avoid this by checking whether the character is in ascii to begin with.
2021-01-31LibWeb: Use URL::to_string_encoded() for the crash error page URL's hrefLinus Groh
Just wrapping to_string() in urlencode() will break the link as too many characters are encoded. Also wrap in escape_html_entities() as well - most relevant chars are already URL-encoded, but this will change '&' to '&', for example.
2021-01-31LibC: Don't honor LIBC_* malloc debugging flags in AT_SECURE contextAndreas Kling
Just ignore all these environment flags if the AT_SECURE flag is set in the program's auxiliary vector. This prevents a user from tricking set-uid programs into dumping debug information via environment flags.
2021-01-31LibELF: Split the DynamicLoader's loading mechanism into two stepsAndreas Kling
load_from_image() becomes map() and link(). This allows us to map an object before mapping its dependencies. This solves an issue where fixed-position executables (like GCC) would clash with the ASLR placement of their own shared libraries.
2021-01-31LibELF: Assert on multiple calls to DynamicLoader::load_from_image()Andreas Kling
It would be a mistake to recreate the cached DynamicObject.
2021-01-31LibELF: Don't validate ELF twice in DynamicLoaderAndreas Kling
Validation was happening in two steps, some in the constructor, and then some later on, in load_from_image(). This made no sense so just move all the validation to the constructor.
2021-01-31LibELF: Call mmap() before constructing the DynamicLoader objectAndreas Kling
Refactor DynamicLoader construction with a try_create() helper so that we can call mmap() before making a loader. This way the loader doesn't need to have an "mmap failed" state. This patch also takes care of determining the ELF file size in try_create() instead of expecting callers to provide it.
2021-01-31LibC: Fix bad error check after open() in dlopen()Andreas Kling
2021-01-31LibIPC: Stop exchanging client/server PIDs in greeting handshakeAndreas Kling
The PIDs were used for sharing shbufs between processes, but now that we have migrated to file descriptor passing, we no longer need to know the PID of the other side.
2021-01-31Browser+LibWeb+WebContent: Make the "Debug" menu work in multi-processAndreas Kling
This patch adds an IPC call for debugging requests. It's stringly typed and very simple, and allows us to easily implement all the features in the Browser's Debug menu.
2021-01-30LibWeb: Don't try to create GUI::TextBox inside multi-process web viewsAndreas Kling
This is a workaround until we can implement a proper <input type=text> in terms of LibWeb primitives. This makes google.com not crash in multi-process mode (but there is no search box.)
2021-01-30Kernel: Add FIBMAP ioctl to Ext2FileSystemPeter Elliott
FIBMAP is a linux ioctl that gives the location on disk of a specific block of a file
2021-01-30LibWeb: URL-encode/escape variables used in OOPWV's crash error pageLinus Groh
This fixes arbitrary HTML injections via the URL on OOPWV's crash error page - probably not a security issue, but annoying nonetheless.
2021-01-30LibWeb: Handle WebContent process crashes gracefully :^)Andreas Kling
The OOPWV will now detect WebContent process crashes/disconnections and simply create a new WebContent process in its place. We also generate a little error page with a link to the crashing URL so you can reload and try again. This a huge step forward for OOPWV since it now has a feature that IPWV can never replicate. :^)
2021-01-30LibProtocol: Bump download stream buffer to PAGE_SIZEAnotherTest
I think this should scale based on the network speed (or download rate?), but for the time being, 4K seems to be good-enough.
2021-01-30LibGUI: Handle Window::hide() during Application teardown betterAndreas Kling
If a window is being torn down during app shutdown, the global application pointer may be nulled out already. So let's handle that case gracefully in Window::hide().
2021-01-30LibELF: Add a bunch of overflow checks in ELF validationAndreas Kling
2021-01-30LibWeb: Add Frame::ViewportClient and use it for Layout::ImageBoxAndreas Kling
Image boxes want to know whether they are inside the visible viewport. This is used to pause/resume animations, and to update the purgeable memory volatility state. Previously we would traverse the entire layout tree on every resize, calling a helper on each ImageBox. Make those boxes register with the frame they are interested in instead, saving us all that traversal. This also makes it easier for other parts of the code to learn about viewport changes in the future. :^)
2021-01-30LibC: Protect the atexit() handler list when not writing to itAndreas Kling
Remap the list of atexit handlers as read-only while we're not actively writing to it. This prevents an attacker from using a memory write primitive to gain code execution via the atexit list. This is based on a technique used in OpenBSD. :^)
2021-01-30LibC: Convert remaining String::format() to formatted()/number()Andreas Kling
2021-01-30LibELF: Avoid quadratic memory usage weaknessBen Wiederhake
Section names are referred to by offset and length. We do not check (and probably should not check) whether these names overlap in any way. This opened the door to many sections (in this example: about 2700) forcing ELF::Image::m_sections to contain endless copies of the same huge string (in this case: 882K). Fix this by loading only the first PAGE_SIZE bytes of each name. Since section names are only relevant for relocations and debug information and most section names are hard-coded (and far below 4096 bytes) anyway, this should be no restriction at all for 'normal' executables. Found by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29187
2021-01-30LibGfx: Fix dynamic bitmasks in BMPsBen Wiederhake
I overlooked a corner case where we might call the built-in ctz() on zero. Furthermore, the calculation of the shift was wrong and the results were often unusable. Both issue were caused by a forgotten 36daeee34ff04f64c933e94a9cdffe9080061fb0. This time I made sure to look at bmpsuite_files first, and now they look good. Found by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28985
2021-01-30DynamicLoader: load_program_headers use variables to store regions (#5173)Jorropo
Previously regions were stored in a vector and then a pointer to regions in this vector were taken and stored. The problem is the vector were still appended after pointers were taken, if enough regions were present the vector would grow so large that it needed a resize, this cause his memory to moved and now the previous pointers are now pointing to old memory we just freed. Fixes #5160