Commit Graph

25983 Commits

Author SHA1 Message Date
Linus Groh
31f65b8c50 LibJS: Implement Temporal.Calendar.prototype.monthDayFromFields() 2021-08-16 20:40:21 +01:00
pyunbiwi
68d07320cf Userland: Add as-user execution to the pls utility
Commands may be executed as a specific user by passing the user's UID to
the '-u' flag in pls.
2021-08-16 21:16:30 +02:00
Ali Mohammad Pur
64bc5f668d Kernel: Avoid enumerating all the fds to find a specific one in procfs 2021-08-16 21:16:14 +02:00
Ali Mohammad Pur
e9feced041 Kernel: Add a Process::FileDescriptions::get_if_valid(index) API
Note that this is not the same as ::at(index), which has a different
precondition ("allocated" vs "valid").
2021-08-16 21:16:14 +02:00
Linus Groh
c1ffc17134 LibJS: Implement Temporal.Calendar.prototype.fields() 2021-08-16 20:02:02 +01:00
Timothy Flynn
7d23d9d557 CI: Remove NO_FUZZ Lagom builds from GitHub Actions 2021-08-16 18:04:33 +01:00
Timothy Flynn
27804a6e67 CI: Build and test Lagom (non-fuzzer) on Azure 2021-08-16 18:04:33 +01:00
Linus Groh
6709c915aa LibJS: Implement Temporal.PlainDate.prototype.toPlainYearMonth() 2021-08-16 14:10:41 +01:00
Linus Groh
ed9d37bd40 LibJS: Implement Temporal.Calendar.prototype.yearMonthFromFields() 2021-08-16 14:10:41 +01:00
Andreas Kling
c1c12497b5 Kernel: Don't hold thread list lock while invoking ~Thread()
There is no need for this, and it can cause deadlocks if ~Thread()
ends up doing something else that requires a lock (e.g ~Process())
2021-08-16 02:22:42 +02:00
Andreas Kling
29a58459ab Kernel: Use ProtectedValue for VirtualFileSystem::m_mounts
This is what VirtualFileSystem::m_lock was actually guarding, and
wrapping it in a ProtectedValue makes it so much more obvious how it
all works. :^)
2021-08-16 01:41:26 +02:00
Samuel Bowman
7089135a07 LibTLS: Add DHE_RSA AES GCM cipher suites
This adds the following cipher suites:
  * DHE_RSA_WITH_AES_128_GCM_SHA256
  * DHE_RSA_WITH_AES_256_GCM_SHA384
2021-08-16 03:50:53 +04:30
Samuel Bowman
b288016bbc LibTLS: Implement the DHE_RSA key exchange algorithm
This adds two methods, handle_dhe_rsa_server_key_exchange and
build_dhe_rsa_pre_master_secret, to TLSv12 and a struct,
server_diffie_hellman_params, to Context, which are used to implement
the DHE_RSA key exchange algorithm. This grants us the benefits of
forward secrecy and access to sites which support DHE_RSA.

It is worth noting that the signature of the server provided
Diffie-Hellman parameters is not currently validated. This will need to
be addressed to prevent man-in-the-middle attacks.
2021-08-16 03:50:53 +04:30
davidot
020bfc9d93 LibJS: Parse and partially execute import and export statements
We produce the import and export entries as per the spec. However we do
not yet verify that named things that are exported are declared
somewhere.
2021-08-15 23:51:47 +01:00
davidot
7613c22b06 LibJS: Add a mode to parse JS as a module
In a module strict mode should be enabled at the start of parsing and we
allow import and export statements.
2021-08-15 23:51:47 +01:00
Andreas Kling
d6d7d11590 Kernel: Cache Custody objects (weakly) to avoid expensive reconstruction
This patch adds a (spinlock-protected) custody cache. It's a simple
intrusive list containing all currently live custody objects.

This allows us to re-use existing custodies instead of creating them
again and again.

This gives a pretty decent performance improvement on "find /" :^)
2021-08-15 23:30:52 +02:00
Andreas Kling
a412fd2ed8 Kernel/ProcFS: Avoid two unnecessary number-to-string conversions
We don't need to create a new string from a number in order to compare
an existing string to that number. Converting the existing string to a
number is much cheaper, since it does not require any heap allocations.

Ran into this while profiling "find /" :^)
2021-08-15 23:30:52 +02:00
Andreas Kling
9c373b646b Kernel/SysFS: Don't compute exact size of PCI files
There's no need for generated files in SysFS to tell you their precise
file size when you stat() them.

I noticed when profiling "find /" that we were spending a chunk of time
generating and throwing away SysFS content just so we could tell you
exactly how large it would be. :^)
2021-08-15 23:30:52 +02:00
brapru
f633ef2af7 Kernel: Move ARP debug information to ARP_DEBUG
Previously when trying to debug the system's routing, the ARP
information would clutter the output and make it difficult to focus on
the routing decisions. It would be better to specify these
debug messages under ARP_DEBUG.
2021-08-15 21:53:29 +02:00
Idan Horowitz
6602ab27e1 CI: Disable variable substitution on input to the twitter script
This prevents command injection through backticks in commit messages.
2021-08-15 23:21:20 +04:30
Nico Weber
788472f91a Ports: Add libsixel
This contains `img2sixel`.
2021-08-15 19:48:11 +01:00
Jesse Buhagiar
8157e7740b LibGL: Implement glColorMask 2021-08-15 19:04:10 +01:00
Linus Groh
fa8e9cb683 LibJS/Tests: Skip flaky FinalizationRegistry.prototype.cleanupSome test 2021-08-15 16:44:01 +01:00
Andreas Kling
cda69704dc Kernel: Remove unused FIFO::all_fifos() table 2021-08-15 16:53:03 +02:00
Andreas Kling
6a20733fcd Kernel: Convert TCP retransmit queue from HashTable to IntrusiveList 2021-08-15 16:53:03 +02:00
Andreas Kling
7063303022 Kernel: Convert IPv4 socket list from HashTable to IntrusiveList
There was no reason whatsoever to use a HashTable here. IntrusiveList
removes all the heap allocations and does everything more efficiently.
2021-08-15 16:53:03 +02:00
Andreas Kling
a154faebb7 Kernel: Use NonnullRefPtr<PhysicalPage> in PageDirectory::m_page_tables
We don't care to store null page pointers in the page table map.
2021-08-15 16:53:03 +02:00
sin-ack
ff0f67b3f0 Meta: Add sin-ack to the contributors list :^) 2021-08-15 14:59:28 +01:00
sin-ack
06a6b68690 Ports: Make the build step messages use ellipsis rather than excl. point
This stops the port build system from yelling at the user. This commit
also adds a "success" message after the "Adding to database" message.
2021-08-15 14:50:39 +01:00
sin-ack
0a18425cbb Kernel: Make Memory::Region allocation functions return KResultOr
This makes for some nicer handling of errors compared to checking an
OwnPtr for null state.
2021-08-15 15:41:02 +02:00
sin-ack
4bfd6e41b9 Kernel: Make Kernel::VMObject allocation functions return KResultOr
This makes for nicer handling of errors compared to checking whether a
RefPtr is null. Additionally, this will give way to return different
types of errors in the future.
2021-08-15 15:41:02 +02:00
sin-ack
61c0e3ca92 Kernel: Simplify OOM handling in ISO9660FileSystem 2021-08-15 15:41:02 +02:00
sin-ack
8d90ecb280 Kernel: Simplify OOM handling in ProcessProcFSTraits 2021-08-15 15:41:02 +02:00
sin-ack
8269e1a197 AK: Add adopt_nonnull_own_or_enomem
This is basically a complement to adopt_nonnull_ref_or_enomem, and
simplifies boilerplate for try_create functions which just return ENOMEM
or the object based on whether it was able to allocate.
2021-08-15 15:41:02 +02:00
vdjagilev
05ecbd9535 Documentation: Add genext2fs package for BuildInstructions 2021-08-15 15:29:03 +02:00
Tetsui Ohkubo
2edf4b7f61 LibWeb: Return correct selection_rect when the node is at the end
When the selection state of the node is SelectionState::End, the end
position of the selection within the fragment is not properly
calculated, because it forgets to subtract m_start from index_in_node,
unlike SelectionState::StartAndEnd. This resulted in a wrong selection
shadow being painted when the node is at the end of the selection.

This change resolves #5880.
2021-08-15 15:14:37 +02:00
Lenny Maiorani
c27abaabc4 AK: Stop publishing detail namespaced functions
Problem:
- `AK::Detail::integer_sequence_generate_array` is published via a
  `using` directive in the `Array.h` header, but this is a `Detail`
  function.

Solution:
- Remove the `using` declaration.
2021-08-15 15:14:19 +02:00
DoubleNegation
0fdfdbed9f LibWeb: Ensure inline CSS loaded from HTML is ElementInline
This commit changes inline CSS loaded from style attributes of HTML
elements to be loaded as CSS::ElementInlineCSSStyleDeclaration instead
of CSS::CSSStyleDeclaration, fixing a crash when the style of that
element is changed from JavaScript.
2021-08-15 15:11:59 +02:00
Andreas Kling
afcd053b68 Documentation: Amend FAQ about the system being 32-bit only
People still ask about this all the time, so let's keep the question but
amend it with the fact that we now have 64-bit support as well.
2021-08-15 13:02:48 +02:00
Andreas Kling
5416fa252a Kernel: Add tightly typed ISO9660Inode::fs() overload
We know the fs() is always an ISO9660FS, so let's be nice and make fs()
return that when called on an ISO9660Inode. :^)
2021-08-15 12:50:22 +02:00
Andreas Kling
37304203dd Kernel: Lock thread list while in Thread::unref()
This patch does three things:

- Convert the global thread list from a HashMap to an IntrusiveList
- Combine the thread list and its lock into a SpinLockProtectedValue
- Customize Thread::unref() so it locks the list while unreffing

This closes the same race window for Thread as @sin-ack's recent changes
did for Process.

Note that the HashMap->IntrusiveList conversion means that we lose O(1)
lookups, but the majority of clients of this list are doing traversal,
not lookup. Once we have an intrusive hashing solution, we should port
this to use that, but for now, this gets rid of heap allocations during
a sensitive time.
2021-08-15 12:44:35 +02:00
Andreas Kling
90c7307c6c AK: Pull RefCountedBase into the global namespace 2021-08-15 12:44:35 +02:00
Andreas Kling
1b739a72c2 Kernel+Userland: Remove chroot functionality
We are not using this for anything and it's just been sitting there
gathering dust for well over a year, so let's stop carrying all this
complexity around for no good reason.
2021-08-15 12:44:35 +02:00
Andreas Kling
96d5d017b7 Kernel: Remove copy_string_from_user() as it's no longer used 2021-08-15 12:44:35 +02:00
Andreas Kling
0f6f863382 Kernel: Convert remaining users of copy_string_from_user()
This patch replaces the remaining users of this API with the new
try_copy_kstring_from_user() instead. Note that we still convert to a
String for continued processing, and I've added FIXME about continuing
work on using KString all the way.
2021-08-15 12:44:35 +02:00
Timothy Flynn
9509433e25 LibRegex: Implement and use a REPEAT operation for bytecode repetition
Currently, when we need to repeat an instruction N times, we simply add
that instruction N times in a for-loop. This doesn't scale well with
extremely large values of N, and ECMA-262 allows up to N = 2^53 - 1.

Instead, add a new REPEAT bytecode operation to defer this loop from the
parser to the runtime executor. This allows the parser to complete sans
any loops (for this instruction), and allows the executor to bail early
if the repeated bytecode fails.

Note: The templated ByteCode methods are to allow the Posix parsers to
continue using u32 because they are limited to N = 2^20.
2021-08-15 11:43:45 +01:00
Timothy Flynn
a0b72f5ad3 LibRegex: Remove (mostly) unused regex::MatchOutput
This struct holds a counter for the number of executed operations, and
vectors for matches, captures groups, and named capture groups. Each of
the vectors is unused. Remove the struct and just keep a separate
counter for the executed operations.
2021-08-15 11:43:45 +01:00
Timothy Flynn
f1ce998d73 LibRegex+LibJS: Combine named and unnamed capture groups in MatchState
Combining these into one list helps reduce the size of MatchState, and
as a result, reduces the amount of memory consumed during execution of
very large regex matches.

Doing this also allows us to remove a few regex byte code instructions:
ClearNamedCaptureGroup, SaveLeftNamedCaptureGroup, and NamedReference.
Named groups now behave the same as unnamed groups for these operations.
Note that SaveRightNamedCaptureGroup still exists to cache the matched
group name.

This also removes the recursion level from the MatchState, as it can
exist as a local variable in Matcher::execute instead.
2021-08-15 11:43:45 +01:00
Timothy Flynn
fea181bde3 LibRegex: Reduce RegexMatcher's BumpAllocator chunk size
Before the BumpAllocator OOB access issue was understood and fixed, the
chunk size was increased to 8MiB as a workaround in commit:
27d555bab0.

The issue is now resolved by: 0f1425c895.

We can reduce the chunk size to 2MiB, which has the added benefit of
reducing runtime of the RegExp.prototype.exec test.
2021-08-15 11:43:45 +01:00
Timothy Flynn
1a173be29d LibRegex: Disallow unescaped quantifiers in Unicode mode 2021-08-15 11:43:45 +01:00