Commit Graph

49246 Commits

Author SHA1 Message Date
MacDue
5acd40c525 AK+Everywhere: Add ApplyPercentDecoding option to URL getters
The defaults selected for this are based on the behaviour of URL
when it applied percent decoding during parsing. This does mean now
in some cases the getters will allocate, but percent_decode() checks
if there's anything to decode first, so in many cases still won't.
2023-04-15 06:37:04 +02:00
MacDue
b9e03071cc AK: Remove unnecessary parameter names in URL.h 2023-04-15 06:37:04 +02:00
Tim Schumacher
f47f5ff473 Tests: Add a test for LZMA repetition lengths beyond the distance 2023-04-14 22:52:08 +02:00
EWouters
68c313dcd9 Ports/openrtc2: Update OpenRTC2 to version 0.4.4 2023-04-14 21:44:40 +02:00
Cubic Love
d82b9553b5 Base: Complete Mathematical Operators in Katica Regular 10
https://www.unicode.org/charts/PDF/U2190.pdf
21E7

https://www.unicode.org/charts/PDF/U2200.pdf
2201, 2203-4, 2208-220E, 2213-221D, 221F-2226, 222D-223F, 2241-224F,
225D-225F, 2262, 226D-228E, 22A2-22A8, 22AC-22AF, 22B2-22B9, 22BB-22BD,
22C4-22C5, 22C8-22CA, 22CE-22D4, 22D6-22FE
2023-04-14 21:43:40 +02:00
Liav A
7c1f645e27 Kernel/Net: Iron out the locking mechanism across the subsystem
There is a big mix of LockRefPtrs all over the Networking subsystem, as
well as lots of room for improvements with our locking patterns, which
this commit will not pursue, but will give a good start for such work.

To deal with this situation, we change the following things:
- Creating instances of NetworkAdapter should always yield a non-locking
  NonnullRefPtr. Acquiring an instance from the NetworkingManagement
  should give a simple RefPtr,as giving LockRefPtr does not really
  protect from concurrency problems in such case.
- Since NetworkingManagement works with normal RefPtrs we should
  protect all instances of RefPtr<NetworkAdapter> with SpinlockProtected
  to ensure references are gone unexpectedly.
- Protect the so_error class member with a proper spinlock. This happens
  to be important because the clear_so_error() method lacked any proper
  locking measures. It also helps preventing a possible TOCTOU when we
  might do a more fine-grained locking in the Socket code, so this could
  be definitely a start for this.
- Change unnecessary LockRefPtr<PacketWithTimestamp> in the structure
  of OutgoingPacket to a simple RefPtr<PacketWithTimestamp> as the whole
  list should be MutexProtected.
2023-04-14 19:27:56 +02:00
Liav A
bd7d4513bf Kernel/Net: Make the LoopbackAdapter initializer to use ErrorOr pattern
This looks much more nice, and also matches our pattern for other types
of network adapters' initializers.
2023-04-14 19:27:56 +02:00
Liav A
9f011592be Kernel/Net: Convert initializers to return NonnullRefPtr<NetworkAdapter>
There's no need for using NonnullLockRefPtr here.
2023-04-14 19:27:56 +02:00
Liav A
b02ee664e7 Kernel: Get rid of *LockRefPtr in the SysFS filesystem code
To do this we also need to get rid of LockRefPtrs in the USB code as
well.
Most of the SysFS nodes are statically generated during boot and are not
mutated afterwards.

The same goes for general device code - once we generate the appropriate
SysFS nodes, we almost never mutate the node pointers afterwards, making
locking unnecessary.
2023-04-14 19:24:54 +02:00
Liav A
dd7633c5f4 Kernel/Audio: Propagate errors when creating AudioChannels
While doing this, we can also just return a normal RefPtr instead of a
LockRefPtr, because we create these channels when initializing an audio
controller, and never change the pointer in AudioController instances
after their initialization, hence no locking is necessary.
2023-04-14 19:23:12 +02:00
Liav A
4921561687 Kernel/Audio: Simplify initialization sequence for drivers
Instead of enumerating all available controllers and then ask each to
find its audio channels, we change the initialization sequence to match
what happens in the Networking subsystem and Graphics subsystem - we
essentially probe for a matching driver on a PCI device, create a device
instance, and immediately initialize it.

This in fact allows us to immediately find any hardware initialization
issues and report it, and then dropping the created instance, as usually
being done in other initialization paths in the Kernel.

This also opens the opportunity to propagate errors when failed to
initialize an AudioChannel instance, and it will be addressed in a
future commit.
2023-04-14 19:23:12 +02:00
Liav A
0050358cd3 Kernel/Storage: Modernize ATA IDE controller initialization code
This is done by 2 ways which both fit very well together:
- We stop use LockRefPtrs. We also don't allow expansion of the
  m_channels member, by setting it to be a fixed Array of 2
  IDEChannels.
- More error propagation through the code, in the construction point of
  IDEChannel(s). This means that in the future we could technically do
  something meaningful with OOM conditions when initializing an IDE
  controller.
2023-04-14 19:20:43 +02:00
Liav A
dac7e911e6 Kernel/Storage: Remove unused IDEController::initialize() method 2023-04-14 19:20:43 +02:00
Liav A
93fceb1890 Kernel: Stop using LockRefPtrs in the Jail code
Each Jail object within the list is already protected by the global list
spinlock, therefore there's no need for using LockRefPtrs at all.
2023-04-14 19:17:49 +02:00
Liav A
e8510b6415 Kernel: Make Jail class to be AtomicRefCounted instead of RefCounted
This will help ensuring that taking and dropping a reference, hence
changing the ref-count, will be done in a safe manner in terms of
concurrency.
2023-04-14 19:17:49 +02:00
Nico Weber
afcbdad1e3 AK: Remove workaround for old macOS SDK
https://github.com/SerenityOS/serenity/pull/9716#issuecomment-1508606204
has details.
2023-04-14 19:15:42 +02:00
Nico Weber
eae1e61a88 AK: Remove unused AK_ARCH_ defines
ARCH() uses the AK_IS_ARCH_ macros internally since 349e54d5375a4a,
and all user code uses the ARCH() macro instead of AK_ARCH_.

(Why it's called ARCH() and not AK_ARCH(), I don't know.)

If any ports not in the main repo use AK_ARCH_, they should switch
to using ARCH() instead.
2023-04-14 19:15:19 +02:00
Nico Weber
97b7e494e4 Everywhere: Use ARCH(AARCH64) instead of AK_ARCH_AARCH64
The former is typo-resistant after 349e54d5375a4a, so make use of that.
2023-04-14 19:15:19 +02:00
Tim Schumacher
50f42407f6 Documentation: Add build dependencies for SerenityOS :^) 2023-04-14 19:00:46 +02:00
Timothy Flynn
781287c1e3 LibWeb: Do not dereference empty Optional in ReadableStream::visit_edges
There are quite a few steps between a ReadableStream being created and
its controller being set. If GC occurs between those points, we will
have an empty Optional in ReadableStream::visit_edges. Seen on YouTube.
2023-04-14 18:55:59 +02:00
Tim Schumacher
9be5dcfd89 Kernel: Also search the main program for stack size requests 2023-04-14 16:12:04 +01:00
Tim Schumacher
ed74f792e2 Kernel: Pick the maximum out of the requested stack sizes 2023-04-14 16:12:04 +01:00
Tim Schumacher
dcd462a050 Lagom: Add an option for standalone fuzzers to BuildFuzzers.sh
This builds simple fuzzing binaries without any oss-fuzz specific
configuration and without any LibFuzzer instrumentation.
2023-04-14 16:08:00 +01:00
Tim Ledbetter
bebcf71bdc LibMarkdown: Avoid catastrophic backtracking in thematic break regex
Fixes #17937
2023-04-14 16:02:59 +01:00
Linus Groh
0abdffc33d LibWeb/Streams: Rename one instance of 'e' to 'exception'
This is what we call it everywhere else.
2023-04-14 16:35:17 +02:00
Linus Groh
6b35cca65b LibWeb/Streams: Add FIXMEs to incorrect invoke_callback() invocations 2023-04-14 16:35:17 +02:00
Linus Groh
1c165b67ef LibWeb/Streams: Use MUST_OR_THROW_OOM() when creating JS exceptions
This cannot throw unless we OOM.
2023-04-14 16:35:17 +02:00
Linus Groh
d192f44523 LibWeb/Streams: Make most algorithms return a NonnullGCPtr
Only the 'start algorithm' ever returns undefined (as a null GCPtr), so
let's type the others more strictly.
2023-04-14 16:35:17 +02:00
Nico Weber
fc15fc36ce AK: Make math work on arm hosts again
957f89ce4a added some tweaks for serenity-on-aarch64.
It broke anythingelse-on-aarch64 hosts though, so only do these tweaks
when targeting serenity.

(I wonder if AK/Math.h should fall back to the system math routines
when not targeting serenity in general. Would probably help ladybird
performance. On the other hand, the serenity routines would see less
use and hence exposure and love.)
2023-04-14 16:16:42 +02:00
Ethan Yeager
bf5a18babb PixelPaint: Correct gradient tool's position during preview 2023-04-14 13:42:45 +01:00
Karol Kosek
e8fe35b1e5 LibWeb: Resolve more background-related properties
This change adds rules for background-attachment, background-clip,
background-image, background-origin, and background-repeat.

As a result, Window.getComputedStyle() will no longer return empty
strings on these properties after a page is loaded, and the background
shorthand will show the resolved values instead of the default ones for
these values. :^)
2023-04-14 12:44:59 +01:00
Julian Offenhäuser
e32ab161ae WindowServer: Fix alt shortcut navigation for non-default keymaps
Some keymaps will bind key presses with the alt modifier to characters
other than the unmodified one, in which case you couldn't activate the
alt shortcuts in the menu bar before.

We now ask the current keymap for the code point that is mapped to the
pressed (unmodified) key instead.
2023-04-14 12:38:40 +01:00
stelar7
e59137d4f6 LibTLS: Add RFC explanation of AlertDescription values 2023-04-14 12:32:04 +01:00
stelar7
9059694216 LibTLS: Show enum value instead of underlying value where possible 2023-04-14 12:32:04 +01:00
stelar7
5853d9642a LibTLS: Move AlertDescription to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7
e8945f15f4 LibTLS: Move CipherSuite to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7
da8edece29 LibTLS: Move HashAlgorithm to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7
fba7695dcc LibTLS: Move SignatureAlgorithm to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7
e5f81475e5 LibTLS: Move ECPointFormat to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7
a4855aef17 LibTLS: Rename NamedCurve to SupportedGroup
This matches the wording used in the IANA registry and TLS 1.3
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7
6df3ffaf45 LibTLS: Move ECCurveType to Extensions.h
Also add missing values from the IANA registry
2023-04-14 12:32:04 +01:00
stelar7
0fea6e7f13 LibTLS: Move NameType to Extensions.h 2023-04-14 12:32:04 +01:00
stelar7
9110f26c79 LibTLS: Rename HandshakeExtension to ExtensionType
This matches the wording used in the TLS RFC
2023-04-14 12:32:04 +01:00
stelar7
c30ee1b89b LibTLS: Update HandshakeType value names to match IANA registry values 2023-04-14 12:32:04 +01:00
stelar7
611a235a52 LibTLS: Rename AlertLevel Critial to FATAL
This matches the wording used in the TLS RFC
2023-04-14 12:32:04 +01:00
stelar7
ca6b8bfe7f LibTLS: Rename Version to ProtocolVersion
This matches the wording used in the TLS RFC
Also define GREASE values as specified in RFC8701
2023-04-14 12:32:04 +01:00
stelar7
082e64e167 LibTLS: Rename MessageType to ContentType
This matches the wording used in the TLS RFC
2023-04-14 12:32:04 +01:00
Arda Cinar
1cfc630d13 LibC: Implement if_indextoname and if_nametoindex 2023-04-14 12:29:03 +01:00
Arda Cinar
38dc54317c Kernel/Net: Implement SIOCGIFINDEX and SIOCGIFNAME for sockets
These ioctls exist on Linux and can be used to implement libc functions
if_indextoname and if_nametoindex (without needing to parse any JSON).
2023-04-14 12:29:03 +01:00
Andreas Kling
47c21cc349 LibWeb: Honor column-gap and row-gap CSS properties in flex layout
This isn't actually part of CSS-FLEXBOX-1, but all major engines honor
these properties in flex layout, and it's widely used on the web.

There's a bug open against the flexbox spec where fantasai says the
algorithm will be updated in CSS-FLEXBOX-2:
https://github.com/w3c/csswg-drafts/issues/2336

I've added comments to all the places where we adjust calculations for
gaps with "CSS-FLEXBOX-2" so we can find them easily. When that spec
becomes available, we can add proper spec links.
2023-04-14 13:22:07 +02:00