Commit graph

38811 commits

Author SHA1 Message Date
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
Tim Schumacher
d2b87419ac LibELF: Only collect region sizes before reserving memory
This keeps us from needlessly allocating storage via `malloc` as part
of the `Vector`s that early, which we might conflict on while reserving
memory for the main executable.
2022-06-21 22:38:15 +01:00
Tim Schumacher
c0b31796a8 LibELF: Unmap the source file temporarily while reserving space
This further reduces the chance that we will conflict with data that is
already present at the target location.
2022-06-21 22:38:15 +01:00
Tim Schumacher
c1d8612eb5 LibELF: Store DynamicLoader ELF images using an OwnPtr
This is preparation work for the next commit, where we will replace the
stored ELF image mid-load.
2022-06-21 22:38:15 +01:00
Tim Schumacher
07208feae7 LibELF: Actually do the library mapping as early as possible
We previously trusted the `map` part in `map_library` too much, and
assumed that this would already lock in the binary at its final place.

However, the `map()` function of the loader was only called in
`load_main_library`, which ran only right before jumping to the
entrypoint.

Make our binary loading a bit more stable by actually mapping the binary
right after we read its information, and only do the linking right
before jumping to the entrypoint.
2022-06-21 22:38:15 +01:00
Tim Schumacher
cedec9751a Kernel: Decrease the amount of address space offset randomization
This is basically unchanged since the beginning of 2020, which is a year
before we had proper ASLR.

Now that we have a proper ASLR implementation, we can turn this down a
bit, as it is no longer our only protection against predictable dynamic
loader addresses, and it actually obstructs the default loading address
of x86_64 quite frequently.
2022-06-21 22:38:15 +01:00
Tim Schumacher
cead476816 LibC: Make scanf read an unsigned long when using %lu 2022-06-21 22:38:15 +01:00
Tim Schumacher
a880457380 LibC: Don't change the stack canary across function boundaries 2022-06-21 22:38:15 +01:00
Andreas Kling
75e8b1305d LibWeb: Actually distribute free space to flex items with auto margins
We were not applying the distributed space to the used offset of flex
items, as we were only assigning the margins to the layout state of the
box, not the internal FlexItem::margins.
2022-06-21 21:18:00 +02:00
Andreas Kling
99e96f951f LibWeb: Implement (some of) "automatic minimum size" for flex items 2022-06-21 21:06:19 +02:00
Andreas Kling
967b257518 LibWeb: Make FFC prepare replaced child boxes for layout
Before we ask a replaced box about its intrinsic dimensions, we have
to "prepare" the box, which tells it to go and work out what its
intrinsic dimensions are.

I've added a FIXME about how this is silly (and clearly bug-prone)
but this patch only patches it locally in FFC for now.
2022-06-21 20:40:26 +02:00
Andreas Kling
85f2f8ab3f LibWeb: Make sure we layout absolutely positioned children of FFC 2022-06-21 20:17:28 +02:00
Torstennator
5aeb6552f0 PixelPaint: Add level sliders for brightness, contrast and gamma
This patch adds a basic dialog to change brightness, contrast and gamma
correction for the selected layer.
2022-06-21 18:23:01 +01:00
Luke Wilde
69c451e485 Ports: Update OpenSSL to 1.1.1p
This also changes the source to fetch OpenSSL from the OpenSSL site, as
1.1.1p is not currently available from the usual source.
2022-06-21 18:14:55 +01:00
Linus Groh
83ae4ee767 Meta: Add Benjamin Maxwell to the contributors list :^) 2022-06-21 17:29:47 +01:00
Kenneth Myhra
c805987329 LibWeb: Add timeout functionality to ResourceLoader
Add timeout functionality to ResourceLoader and use it from
XMLHttpRequest.
2022-06-21 10:29:14 +01:00
Kenneth Myhra
8b42c05648 LibWeb: Add XMLHttpRequest::timeout setter and getter 2022-06-21 10:29:14 +01:00
Kenneth Myhra
1e1d59cc25 RequestServer: Do not VERIFY(request.total_size.has_value())
If the request is stopped RequestServer::did_finish_request() will crash
on the VERIFY() call since request.total_size.has_value() returns false.

Let us instead use a conditional expression to verify if it has a value
and then call async_request_finished().
2022-06-21 10:29:14 +01:00
Grigoris Pavlakis
2fa907b31a Ports/gltron: Use sdl12-compat instead of SDL2 2022-06-20 23:24:45 +01:00
Grigoris Pavlakis
c98a275931 Ports: Add SDL_sound for SDL 1.2 2022-06-20 23:24:45 +01:00
Grigoris Pavlakis
de31f51bbe Ports: Move SDL_sound to SDL2_sound 2022-06-20 23:24:45 +01:00
Mike Akers
27f93a3052 LibGUI: Prevent CenterWithinParent Dialogs from appearing offscreen
When a dialog is created the position is checked against the Desktop's
rect and repositioned to be entirely visible. If the dialog is larger
than the desktop's rect it is just centered.
2022-06-20 16:50:25 +01:00
Mike Akers
9a908748e0 WindowServer: Prevent menubar menus from appearing off screen
Adds some logic to reposition menus that would appear off the right or
bottom edge of the screen so they appear completely on screen.

Co-authored-by: Sam Atkins <atkinssj@gmail.com>
2022-06-20 16:49:31 +01:00
Karol Kosek
c6eaa39b99 LibWeb: Make doubleclicking select the nearest word 2022-06-20 12:55:50 +01:00
Karol Kosek
237a5bedd2 LibWeb: Dispatch dblclick UI Events on double click 2022-06-20 12:55:50 +01:00
Karol Kosek
03cda8a013 LibWeb+LibWebView+WebContent: Get doubleclick events from LibGUI 2022-06-20 12:55:50 +01:00
Karol Kosek
0e04532623 LibWeb: Add stub implementation for handling doubleclicks 2022-06-20 12:55:50 +01:00
FrHun
565f68f8bb LibGUI: Reimplement Painter::draw_triangle to be more symmetrical
This is a reimplementation of draw_triangle that manages without
floating point arithmetic.
It's most important property, compared to the previous implementation is
that rotating the same triangle 90 degrees won't drastically change the
appearance of that triangle. (it did before)
2022-06-20 12:40:51 +01:00
FrHun
586a94818d LibGUI: Draw ScrollBar arrows with draw_triangle
This doesn't actually change anything in appearance, but it lays the
groundwork to have these graphics scaling compatible once the window
backstores support that.
2022-06-20 12:40:51 +01:00
FrHun
325042f2b7 AK: Make Point constructors constexpr 2022-06-20 12:40:51 +01:00
FrHun
b3d1fa4c54 LibGUI: Add drawing triangle from coordinate list 2022-06-20 12:40:51 +01:00
SeekingBlues
dafea57fe2 Ports/ncurses: Disable mixed-case directory names when building on macOS
Since macOS's filesystem is case-insensitive, its `tic` only generates
terminfo directory names that are hex numbers instead of letters, such
as 78/xterm instead of x/xterm. However, the configure script still
enables the mixed-case directory name feature by default. As a result,
ncurses will fail when trying to find terminfo entries like x/xterm if
they are generated on macOS.

It seems like there is no way to change the behavior of `tic` to create
alphabetical directories, so we can only disable this option explicitly.
2022-06-19 19:50:23 +01:00
Luke Wilde
0a989d1bfd LibWeb: Implement HTMLBaseElement.href 2022-06-19 16:35:43 +01:00
Luke Wilde
1f820f8840 LibWeb: Add support for the <base> element changing the base URL
Used by Google seemingly almost all around account sign in and
management. The modern sign in page has this near the beginning:
```html
<base href="https://accounts.google.com">
```
All of the XHRs performed by sign in are relative URLs to this
base URL. Previously we ignored this and did it relative to the
current URL, causing the XHRs to 404 and sign in to fall apart.

I presume they do this because you can access the sign in page
from multiple endpoints, such as `/ServiceLogin` and
`/o/oauth2/auth/identifier`
2022-06-19 16:35:43 +01:00
kleines Filmröllchen
b3d87f8e37 Ports: Update mold to 1.0.3 2022-06-19 15:45:14 +01:00
kleines Filmröllchen
026cea990a Toolchain: Update mold to 1.0.3 2022-06-19 15:45:14 +01:00