1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:14:58 +00:00
serenity/Userland/Libraries/LibJS
Andreas Kling b6d4eea7ac LibJS: Never give back virtual memory once it belongs to a cell type
Instead of returning HeapBlock memory to the kernel (or a non-type
specific shared cache), we now keep a BlockAllocator per CellAllocator
and implement "deallocation" by basically informing the kernel that we
don't need the physical memory right now.

This is done with MADV_FREE or MADV_DONTNEED if available, but for other
platforms (including SerenityOS) we munmap and then re-mmap the memory
to achieve the same effect. It's definitely clunky, so I've added a
FIXME about implementing the madvise options on SerenityOS too.

The important outcome of this change is that GC types that use a
type-specific allocator become immune to use-after-free type confusion
attacks, since their virtual addresses will only ever be re-used for
the same exact type again and again.

Fixes #22274
2023-12-31 15:35:56 +01:00
..
Bytecode LibJS: Use existing AOs to validate bytecode/JIT TypedArray indices 2023-12-26 11:16:10 +01:00
Contrib/Test262 Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Heap LibJS: Never give back virtual memory once it belongs to a cell type 2023-12-31 15:35:56 +01:00
JIT Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Runtime LibJS: Skip redundant UTF-8 validation in rope string resolution 2023-12-30 13:49:50 +01:00
Tests LibJS: Implement missing steps from the ArrayBuffer transfer proposal 2023-12-29 09:25:41 +01:00
AST.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
AST.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
CMakeLists.txt LibJS: Skip test262 tests with the CanBlockIsFalse flag 2023-11-30 09:51:46 -05:00
Console.cpp LibJS: Make ExecutionContext::function_name a GCPtr<PrimitiveString> 2023-11-29 09:48:18 +01:00
Console.h LibJS: Begin implementing console.dir 2023-06-22 06:46:27 +02:00
CyclicModule.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
CyclicModule.h LibJS: Update import referrer's [[LoadedModules]] in place 2023-12-03 20:46:55 +01:00
Forward.h LibJS: Stop converting between Object <-> IteratorRecord all the time 2023-12-07 14:06:34 +01:00
Lexer.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Lexer.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
MarkupGenerator.cpp LibJS: Use OrderedHashMap for the Shape property table 2023-09-17 21:00:11 +02:00
MarkupGenerator.h LibJS: Fix redundancy-detection when printing raw values 2023-06-15 08:09:16 +02:00
Module.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Module.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
ModuleLoading.h LibJS+LibWeb: Another round of bringing module loading closer to spec 2023-12-03 20:46:55 +01:00
Parser.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Parser.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
ParserError.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
ParserError.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Position.h LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
Print.cpp LibJS+LibWeb: Implement resizable ArrayBuffer support for TypedArray 2023-12-26 11:16:10 +01:00
Print.h Everywhere: Remove the AK:: qualifier from Stream usages 2023-02-13 00:50:07 +00:00
SafeFunction.h LibJS: Add GC graph dumper 2023-08-17 18:27:02 +02:00
Script.cpp LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Script.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
SourceCode.cpp LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
SourceCode.h LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
SourceRange.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
SourceTextModule.cpp LibJS: Only consider VM-accessible execution contexts as strong roots 2023-12-13 11:19:13 +01:00
SourceTextModule.h LibJS: Always allocate ExecutionContext objects on the malloc heap 2023-11-29 09:48:18 +01:00
SyntaxHighlighter.cpp LibSyntax+Userland: Make LibSyntax not depend on LibGUI 2023-08-29 07:57:39 -04:00
SyntaxHighlighter.h LibSyntax: Teach each highlighter about it's comment syntax 2022-11-27 18:28:43 -07:00
SyntheticModule.cpp LibJS: Support LoadRequestedModule AO on SyntheticModule records 2023-12-03 20:46:55 +01:00
SyntheticModule.h LibJS: Support LoadRequestedModule AO on SyntheticModule records 2023-12-03 20:46:55 +01:00
Token.cpp Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
Token.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30