Commit Graph

26042 Commits

Author SHA1 Message Date
davidot
4cc95ae39d LibJS: Fix that a windows-style new line was not escaped properly 2021-08-16 23:20:04 +01:00
kleines Filmröllchen
ba622cffe4 LibAudio: Fix overflow on 24-bit FLAC LPC data
When computing sample values from a linear predictor, the repeated
multiplication and addition can lead to very large values that may
overflow a 32-bit integer. This was never discovered with 16-bit FLAC
test files used to create and validate the first version of the FLAC
loader. However, 24-bit audio, especially with large LPC shifts, will
regularly exceed and overflow i32. Therefore, we now use 64 bits
temporarily. If the resulting value is too large for 32 bits, something
else has gone wrong :^)

This fixes playback noise on 24-bit FLACs.
2021-08-17 00:16:00 +02:00
kleines Filmröllchen
c974be91ab LibAudio: Rescale integer samples correctly in FLAC loader
The FLAC samples are signed, so we need to rescale them not by their bit
depth, but by half of the bit depth. For example, a 24-bit sample
extends from -2^23 to 2^23-1, and therefore needs to be rescaled by 2^23
to conform to the [-1, 1] double sample range.
2021-08-17 00:16:00 +02:00
kleines Filmröllchen
442aa48a61 LibAudio: Use size_t in loops
This is more idiomatic :^)
2021-08-17 00:16:00 +02:00
Itamar
f3aa87c436 Kernel: Make makedev()/minor()/major() static
This was originally done in 7274037 and for some reason reverted in
740140a.

This avoids "multiple definitions" link errors and fixes the libuv port.
2021-08-16 23:26:52 +02:00
Sam Atkins
0fba71a655 LibWeb: Replace is_inherited_property() with generated code
We already include the inheritance for each property in Properties.json,
so made sense to use that instead of a list in StyleResolver.

Added `inherited: true` to a couple of properties to match the previous
code's behavior. One of those had a FIXME which I've moved to the JSON
file, which is hacky, but it works.
2021-08-16 23:26:16 +02:00
Tetsui Ohkubo
ea2b02186c Base: Associate obj files with 3DFileViewer
With this change, a user can open .obj files from FileManager.
2021-08-16 22:13:20 +02:00
Linus Groh
cbe7015c0c LibJS: Add missing spec link to YearMonthFromFields 2021-08-16 20:40:21 +01:00
Linus Groh
795e077eb8 LibJS: Implement Temporal.PlainDate.prototype.toPlainMonthDay() 2021-08-16 20:40:21 +01:00
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