Commit graph

43731 commits

Author SHA1 Message Date
Hendiadyoin1 b86f1c2fe7 LibJS: Restore cached current_block on return in Bytecode
Otherwise debug prints will show the wrong block until we preform a jump
2022-12-03 17:07:30 +03:30
Hendiadyoin1 a00c421d61 LibJS: Handle FinishUnwind in GenerateCFG 2022-12-03 17:07:30 +03:30
Hendiadyoin1 6998b72d22 LibJS: Mark FinishUnwind as a terminator 2022-12-03 17:07:30 +03:30
Hendiadyoin1 ded7545db1 LibJS: Use a switch statement in GenerateCFG 2022-12-03 17:07:30 +03:30
Hendiadyoin1 7697e09660 LibJS: Don't mark blocks for unification multiple times
This would cause a UAF otherwise
2022-12-03 17:07:30 +03:30
Hendiadyoin1 35db0c5e18 js: Force optimizations when setting the -p flag 2022-12-03 17:07:30 +03:30
Sam Atkins 0fc673e759 LibCore: Mark connections to InspectorServer as MSG_NOSIGNAL
If InspectorServer closes for some reason at the wrong time, there is no
need for the inspected application to terminate.
2022-12-03 14:27:05 +01:00
Sam Atkins 9eb26ddd21 LibCore: Mark LocalServer client sockets as MSG_NOSIGNAL
Make LocalServer connections not terminate their process from SIGPIPE,
which fixes the issue where closing DisplaySettings with the[OK] button
would often crash WindowServer.
2022-12-03 14:27:05 +01:00
Sam Atkins cb5f83606a LibCore: Optionally pass MSG_NOSIGNAL to socket read/writes
When creating a `Core::Stream::Socket`, you can now choose to prevent
SIGPIPE signals from firing and terminating your process. This is done
by passing MSG_NOSIGNAL to the `System::recv()` or `System::send()`
calls when you `read()` or `write()` to that Socket.
2022-12-03 14:27:05 +01:00
Liav A 0bb7c8f4c4 Kernel+SystemServer: Don't hardcode coredump directory path
Instead, allow userspace to decide on the coredump directory path. By
default, SystemServer sets it to the /tmp/coredump directory, but users
can now change this by writing a new path to the sysfs node at
/sys/kernel/variables/coredump_directory, and also to read this node to
check where coredumps are currently generated at.
2022-12-03 05:56:59 -07:00
Liav A 7dcf8f971b Kernel: Rename SysFSSystemBoolean => SysFSSystemBooleanVariable 2022-12-03 05:56:59 -07:00
Liav A 756d2a7f63 Base: Add a description about Jails to the Mitigations(7) document
We add a new document entry to mention jailed processes' restrictions,
so it is clear which restrictions apply when using Jails.
2022-12-03 05:47:58 -07:00
Liav A 95d8aa2982 Kernel: Allow read access sparingly to some /sys/kernel directory nodes
Those nodes are not exposing any sensitive information so there's no
harm in exposing them.
2022-12-03 05:47:58 -07:00
Liav A 1ca0ac5207 Kernel: Disallow jailed processes to read files in /sys/kernel directory
By default, disallow reading of values in that directory. Later on, we
will enable sparingly read access to specific files.

The idea that led to this mechanism was suggested by Jean-Baptiste
Boric (also known as boricj in GitHub), to prevent access to sensitive
information in the SysFS if someone adds a new file in the /sys/kernel
directory.
2022-12-03 05:47:58 -07:00
Liav A 2e55956784 Kernel: Forbid access to /sys/kernel/power_state for Jailed processes
There's simply no benefit in allowing sandboxed programs to change the
power state of the machine, so disallow writes to the mentioned node to
prevent malicious programs to request that.
2022-12-03 05:47:58 -07:00
Steffen Rusitschka 1aa07d7328 AK: Implement FloatExtractor<f128>
This patch adds support for 128-bit floating points in FloatExtractor.

This is required to build SerenityOS on MacOS/aarch64. It might break
building for Raspberry Pi.
2022-12-02 16:22:51 +01:00
Idan Horowitz 2e806dab07 LibJS: Implement Set.prototype.isDisjointFrom 2022-12-02 13:09:15 +01:00
Idan Horowitz 3470f33a0f LibJS: Implement Set.prototype.isSupersetOf 2022-12-02 13:09:15 +01:00
Idan Horowitz e29be4eaa8 LibJS: Implement Set.prototype.isSubsetOf 2022-12-02 13:09:15 +01:00
Idan Horowitz e359eeabe8 LibJS: Implement Set.prototype.symmetricDifference 2022-12-02 13:09:15 +01:00
Idan Horowitz be8329d5f6 LibJS: Implement Set.prototype.difference 2022-12-02 13:09:15 +01:00
Idan Horowitz 9e693304ff LibJS: Implement Set.prototype.intersection 2022-12-02 13:09:15 +01:00
Idan Horowitz fee65f6453 LibJS: Implement Set.prototype.union 2022-12-02 13:09:15 +01:00
Idan Horowitz 8e1df36588 LibJS: Implement the Set Methods proposal abstract operations 2022-12-02 13:09:15 +01:00
Marco Cutecchia 55c5c97ab5 LibWeb: Log failures to decode image resources inside ImageResource 2022-12-02 11:26:29 +01:00
Marco Cutecchia 07fb0882bf LibWeb: Add null checks before derefencing Bitmaps in ImageStyleValue 2022-12-02 11:26:29 +01:00
Linus Groh b0e7d59b8b LibJS: Throw on conversion from TimeZone to Calendar and vice versa
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/2084e77
2022-12-02 02:04:13 +01:00
Linus Groh ca038c1a4e LibJS: Align Temporal.{Calendar,TimeZone} id getters with toString
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/0bb391a
2022-12-02 02:04:13 +01:00
Timothy Flynn 4a30446999 LibWeb: Support displaying HTMLInputElement placeholder values
This adds support for parsing the ::placeholder pseudo-element and
injecting an anonymous layout node with that element when the input
element's data is empty.
2022-12-01 11:18:11 -05:00
Timothy Flynn fddbc2e378 LibWeb: Ensure the number of pseudo elements stays up-to-date
The ::placeholder pseudo element was added in commit 1fbad9c, but the
total number of pseudo elements was not updated. Instead of this manual
bookkeeping, add a dummy value at the end of the enumeration for the
count.
2022-12-01 11:18:11 -05:00
Timothy Flynn c21e9a415d LibJS: Add missing spec link on String.prototype.toWellFormed
Missed in commit 3ee5217adc.
2022-12-01 11:17:02 -05:00
Timothy Flynn 3ee5217adc LibJS: Implement String.prototype.toWellFormed 2022-12-01 17:03:55 +01:00
Timothy Flynn 0bb46235a7 LibJS: Implement String.prototype.isWellFormed 2022-12-01 17:03:55 +01:00
Linus Groh 24237ae5bf LibJS: Add FIXME to removed SplitMatch AO 2022-12-01 13:32:47 +01:00
Linus Groh e960f9549e LibJS: Sort String.prototype methods in spec order
This is similar to these previous changes in LibJS:

- 999ad734ec
- f19c4ab693
- 5f5bcd549e
2022-12-01 13:32:47 +01:00
Timothy Flynn 69f6fbdf99 LibJS: Replace CreateDataPropertyOrThrow with Set in TypedArray toSorted
This was an errant transcription in 4dbb2c2d44.
2022-11-30 23:27:51 +01:00
Timothy Flynn 34e328e580 LibJS: Allow TypedArrays to become detached while sorting
This is a normative change in the Change Array by Copy proposal. See:
https://github.com/tc39/proposal-change-array-by-copy/commit/17d8b54
2022-11-30 23:27:51 +01:00
Mateusz Górzyński 4dfdca74e2 LibWeb: Handle <relative-size> values in the font-size CSS property 2022-11-30 19:58:17 +00:00
Mateusz Górzyński a551e02e5e LibWeb: Handle <absolute-size> values in the font-size CSS property 2022-11-30 19:58:17 +00:00
Timothy Flynn 31d315001c LibJS: Allocate concrete TypedArrays with a preallocated base TypedArray
TypedArray constructors/prototypes are currently allocating within their
C++ constructor when trying to access the intrinsic base TypedArray. To
prevent this, construct these objects with an already-allocated base
TypedArray.
2022-11-30 13:05:57 -05:00
Timothy Flynn c0952e3670 LibJS: Do not allocate in Set's constructor
We are currently allocating in Set's constructor to create the set's
underlying Map. This can cause GC to occur before the member is actually
initialized, thus we will crash in Set::visit_edges trying to visit a
member that does not exist.

Instead, create the Map in Set::initialize, where we can allocate. Also
change Map to be stored as a normal JS heap-allocated object, rather
than as a stack variable.
2022-11-30 13:05:57 -05:00
Luke Wilde 715e56a74c LibWeb: Add @@toStringTag to platform object prototypes
This was forgotten to be added in the LibWeb GC conversion.
This caused some brand checks to fail in skribbl.io's JavaScript and
thus caused unexpected exceptions.
2022-11-30 18:21:02 +01:00
MacDue cdbb2cc917 Base: Add some radial-gradient() HTML examples 2022-11-30 14:24:04 +00:00
MacDue 65acfe6c60 LibWeb: Handle degenerate radial gradients 2022-11-30 14:24:04 +00:00
MacDue 476acae04f LibWeb: Paint radial-gradient()s
This almost looks too easy now :^), but it's just another way to sample
the gradient line.
2022-11-30 14:24:04 +00:00
MacDue d1b06af307 LibWeb: Add missing equals() function for ConicGradientStyleValue
Also, tidy up the one for LinearGradientStyleValue.
2022-11-30 14:24:04 +00:00
MacDue 22a7611e1c LibWeb: Parse radial-gradient()s 2022-11-30 14:24:04 +00:00
MacDue 040dac558e LibWeb: Implement RadialGradientStyleValue
Adds a style value for `radial-gradient()`s and implements some helpers
for resolving their properties.
2022-11-30 14:24:04 +00:00
MacDue f1f1977e2d LibWeb: Move color stop list parsing to standalone functions
This makes these slightly less clunky to use for other gradient types.
2022-11-30 14:24:04 +00:00
MacDue c02163c31f LibWeb: Allow optional values to be missing when parsing <position>s 2022-11-30 14:24:04 +00:00