Commit graph

38846 commits

Author SHA1 Message Date
Linus Groh
709e16004d LibJS: Assert RoundISODateTime is called with values within the limits
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/eaa7042
2022-06-24 22:12:03 +01:00
Linus Groh
f54ed48ef1 LibJS: Assert AddTime is called with a valid time
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/0ead23c
2022-06-24 22:12:03 +01:00
Linus Groh
416f94eb3b LibJS: Add Number conversion in PrepareTemporalFields
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/687d06c
2022-06-24 22:12:03 +01:00
Linus Groh
78bfeca643 LibJS: Add Number conversion in ZonedDateTime.prototype.getISOFields()
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/bc59d8d
2022-06-24 22:12:03 +01:00
Linus Groh
ea023ac62c LibJS: Add Number conversion in AddDu/ToOrSubtractDu/FromPlainYearMonth
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/823300c
2022-06-24 22:12:03 +01:00
Linus Groh
98dc964649 LibJS: Add conversion to mathematical number in ToTemporalTimeRecord
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/9f37d10
2022-06-24 22:12:03 +01:00
Linus Groh
7138f10c30 LibJS: Check for invalid epoch ns in DisambiguatePossibleInstants
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/c12d20d
2022-06-24 22:12:03 +01:00
Linus Groh
7b5a7e7759 LibJS: Check for invalid epoch nanoseconds in NanosecondsToDays
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/f1f016e
2022-06-24 22:12:03 +01:00
Linus Groh
ddea6d451b LibJS: Check for invalid epoch nanoseconds in InterpretISODateTimeOffset
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/cdfe4a5
2022-06-24 22:12:03 +01:00
Linus Groh
d10e0f0e3e LibJS: Check for invalid epoch nanoseconds in getPossibleInstantsFor()
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/439e6af
2022-06-24 22:12:03 +01:00
Linus Groh
61bdbe712e LibJS: Remove duplicate steps for offset-only time zones
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/7813599
2022-06-24 22:12:03 +01:00
Linus Groh
34f02bed17 LibJS: Remove check for Instant range before subtracting UTC offset
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/5e2fecb
2022-06-24 22:12:03 +01:00
Linus Groh
9c31fee4b5 LibJS: Remove unnecessary modulo operation in GetISOPartsFromEpoch
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/fc3f80d
2022-06-24 22:12:03 +01:00
Linus Groh
0ff6260afb LibJS: Use ToTemporalDuration in AddDu/ToOrSubtractDu/FromPlainYearMonth
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/a454134
2022-06-24 22:12:03 +01:00
Brian Gianforcaro
458244c0c1 Kernel: Enable -ftrivial-auto-var-init as a security mitigation
The flag will automatically initialize all variables to a pattern based
on it's type. The goal being here is to eradicate an entire bug class
of issues that can originate from uninitialized stack memory.

Some examples include:

 - Kernel information disclosure, where uninitialized struct members
   or struct padding is copied back to usermode, leaking kernel
   information such as stack or heap addresses, or secret data like
   stack cookies.

 - Control flow based on uninitialized memory can cause a variety of
   issues at runtime, including stack corruptions like buffer
   overflows, heap corruptions due to deleting stray pointers.
   Even basic logic bugs can result from control flow operating on
   uninitialized data.

As of GCC 12 this flag is now supported.
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a25e0b5e6ac8a77a71c229e0a7b744603365b0e9

Clang has already supported it for a few releases.
https://reviews.llvm.org/D54604
2022-06-24 12:35:36 +01:00
Andrew Kaster
a0eb0a275d Tests: Add test for dlsym(RTLD_DEFAULT) for symbols from dlopen'd libs
This broke with recent changes to library loading and mapping order.
2022-06-24 11:28:05 +01:00
Tim Schumacher
6732fec8b8 LibELF: Warn on self-dlopening libraries while initializing 2022-06-24 11:28:05 +01:00
Tim Schumacher
082a7baa3b LibELF: Check if initializers ran instead of trusting s_global_objects
The original heuristic of "a library being in `s_global_objects` means
that it was fully initialized already" doesn't hold up anymore since we
changed the loading order. This was causing us to skip parts of the
initialization of dependency libraries when running dlopen (since it was
the only user of that setting).

Instead, set a flag after we run stage 4 (which is the "run the global
initializers" stage) and check that flag when determining unfinished
dependencies. This entirely replaces the `skip_global_objects` logic.
2022-06-24 11:28:05 +01:00
kleines Filmröllchen
ef1c97e3d8 AudioServer: Reduce hardware audio buffer to 512 samples 2022-06-23 23:26:33 +01:00
kleines Filmröllchen
1c23a222b2 AudioServer: Make hardware write buffer size flexible
This removes some old cruft to refactor the hardware buffer-related
datastructures into depending on a single constant, which determines the
number of samples per hardware buffer that the audio server mixes. This
is set to 1024 as before, so there are no functional changes.
2022-06-23 23:26:33 +01:00
kleines Filmröllchen
f6af357763 Kernel/Audio: Fix buffer size underflow for non-page-aligned sizes
When the size of the audio data was not a multiple of a page size,
subtracting the page size from this unsigned variable would underflow it
close to 2^32 and be clamped to the page size again. This would lead to
writes into garbage addresses because of an incorrect write size,
interestingly only causing the write() call to error out.

Using saturating math neatly fixes this problem and allows buffer
lengths that are not a multiple of a page size.
2022-06-23 23:26:33 +01:00
kleines Filmröllchen
07d712ea00 AK: Add saturating addition and subtraction to Checked 2022-06-23 23:26:33 +01:00
kleines Filmröllchen
746d3c1131 AudioServer: Explicitly cast between numeric types in the mixer 2022-06-23 23:26:33 +01:00
kleines Filmröllchen
cb8e37d436 LibAudio: Add spec comments to the FlacLoader
This way the FlacLoader can be more easily understood by someone that
doesn't already know the format inside out.
2022-06-23 23:16:34 +01:00
Andreas Kling
c03a0e7260 LibWeb: Fix unsafe capture of ref-to-local when setting up load timeout
We were capturing a reference to a stack local and then persisting the
closure, causing it to dereference a long-gone object when invoked.
2022-06-23 20:37:29 +02:00
CodeforEvolution
a02ee29af9 LibWeb/CSS: Check for NULL block statement when parsing font-face rule
This prevents font-face rules without a block statement from crashing
LibWeb during CSS parsing.

The issue was discovered by Lubrsi during CSS parser fuzzing. :)
Fixes #14141.
2022-06-23 19:14:24 +01:00
MacDue
f807fe6f6c Base: Add box-shadow + border-radius HTML examples
This now also shows the same box-shadows on the right on top of a
background to test the clipping underneath the content.
2022-06-23 19:13:24 +01:00
MacDue
4ffbe9284e LibGfx: Slap an -O3 optimization #pragma on FastBoxBlurFilter
This is done elsewhere in LibGfx, but adding it here is more of a
prayer for speed.
2022-06-23 19:13:24 +01:00
MacDue
30a0ed6678 LibGfx: Avoid AK::Function indirection in FastBoxBlurFilter + flatten it
This dropped a few percent when profiling Lubrsi's test.
2022-06-23 19:13:24 +01:00
MacDue
bb48a61d50 LibGfx: Flatten AntiAliasingPainter::draw_ellipse_part()
This seemed to drop the time spent here a few percent in profiling.
2022-06-23 19:13:24 +01:00
MacDue
ff1e61bd11 LibWeb: Support using a border-radius with a box-shadow
This commit adds support for using all your favorite border radii with
box-shadow, that is elliptical, circular, rounded rectangle etc. :^)

There is some work needed to make this more performant. The larger
your border radius is the larger the corner bitmap needs to be,
which means more time spent in FastBoxBlurFilter. There are probably
some tricks to bring this down.

Fixes #14325
2022-06-23 19:13:24 +01:00
MacDue
13c4c735b8 LibWeb: Add 'inside' clip mode to BorderRadiusCornerClipper
The default clip mode 'outside' clips everything outside the corner,
'inside' does the opposite :^)
2022-06-23 19:13:24 +01:00
MacDue
08baeb1e7d LibWeb: Pass border radii data to shadow painting
This is not used yet, but will be needed for painting shadows on
elements that have a border-radius.
2022-06-23 19:13:24 +01:00
Hendiadyoin1
5bf84a5b0e AK: Zero previous pointer *after* fixing the insertion list in HashTable 2022-06-23 20:25:12 +03:00
Tim Schumacher
f03838fac8 Tests: Add tests for wcsftime 2022-06-23 15:45:04 +01:00
Tim Schumacher
ffb95bace4 LibC: Implement wcsftime using a makeshift solution 2022-06-23 15:45:04 +01:00
Idan Horowitz
a79796ea4a LibJS: Implement stage 3 proposal FinalizationRegistry changes
Specifically the 'Symbol as WeakMap Keys Proposal'.
2022-06-23 10:57:52 +03:00
Idan Horowitz
53ed8decaf LibJS: Implement WeakRef changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00
Idan Horowitz
dbd0110721 LibJS: Implement WeakSet changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00
Idan Horowitz
a80d3fdf49 LibJS: Implement WeakMap changes from 'Symbol as WeakMap Keys Proposal' 2022-06-23 10:57:52 +03:00
Idan Horowitz
22a78e8a2c LibJS: Implement the CanBeHeldWeakly abstract operation
This AO is required for implementing the rest of the stage 3 'Symbol as
WeakMap Keys Proposal'.
2022-06-23 10:57:52 +03:00
Ali Mohammad Pur
8e26edc8de Base: Add a quote to the fortunes database 2022-06-22 20:58:14 +01:00
Idan Horowitz
eb02425ef9 AK: Clear the previous and next pointers of deleted HashTable buckets
Usually the values of the previous and next pointers of deleted buckets
are never used, as they're not part of the main ordered bucket chain,
but if an in-place rehashing is done, which results in the bucket being
turned into a free bucket, the stale pointers will remain, at which
point any item that is inserted into said free-bucket will have either
a stale previous pointer if the HashTable was empty on insertion, or a
stale next pointer, resulting in undefined behaviour.

This commit also includes a new HashMap test that reproduces this issue
2022-06-22 21:53:13 +02:00
Andreas Kling
7953bd8391 LibWeb: Implement "transferred size suggestion" for flex items 2022-06-22 18:36:17 +02:00
Ali Mohammad Pur
910a44d5f2 LibLine: Use the real shown line count around in cleanup()
Previously we would leave artifacts on screen if a change caused the
buffer to span fewer lines than the current buffer.
This commit records the shown line count and uses that instead of trying
to guess the previous line count (and failing most of the time).
2022-06-22 15:45:27 +02:00
MacDue
92a1e9607d Base: Document /proc/{pid}/children in proc(7) manpage 2022-06-22 13:29:17 +01:00
Michał Lach
e9dae38f38 Terminal+TerminalSettings: Add caret customization 2022-06-22 12:12:00 +01:00
Michał Lach
e2b0f6795f LibVT+Kernel: Separate the caret shapes and its steadiness
Currently CursorStyle enum handles both the styles and the steadiness or
blinking of the terminal caret, which doubles the amount of its entries.
This commit changes CursorStyle to CursorShape and moves the blinking
option to a seperate boolean value.
2022-06-22 12:12:00 +01:00
Idan Horowitz
1950e79d48 Kernel: Eliminate possible KASLR leak by disabling CR4.FSGSBASE
The RDGSBASE userspace instruction allows programs to read the contents
of the gs segment register which contains a kernel pointer to the base
of the current Processor struct.

Since we don't use this instruction in Serenity at the moment, we can
simply disable it for now to ensure we don't break KASLR. Support can
later be restored once proper swapping of the contents of gs is done on
userspace/kernel boundaries.
2022-06-22 07:52:35 +03:00
Tim Schumacher
2df56f840f Revert "Toolchain: Load x64 executables at a higher address"
Now that the lower pages can be unmapped and more of the virtual
address range is available to us, we can actually use the default
mapping address of x86_64 again.

This reverts commit 292398b585.
2022-06-21 22:38:15 +01:00