Commit graph

42664 commits

Author SHA1 Message Date
Tim Schumacher
678db534ff LibC: Properly implement stack protectors
The shared parts are now firmly compiled into LibC instead of being
defined as a static library and then being copied over manually.
The non-shared ("local") parts are kept as a static library that is
linked into each binary on demand.

This finally allows us to support linking with the -fstack-protector
flag, which now replaces the `ssp` target being linked into each binary
accidentally via CMake.
2022-11-01 14:49:09 +00:00
Tim Schumacher
7834e26ddb Everywhere: Explicitly link all binaries against the LibC target
Even though the toolchain implicitly links against -lc, it does not know
where it should get LibC from except for the sysroot. In the case of
Clang this causes it to pick up the LibC stub instead, which might be
slightly outdated and feature missing symbols.

This is currently not an issue that manifests because we pass through
the dependency on LibC and other libraries by accident, which causes
CMake to link against the LibC target (instead of just the library),
and thus points the linker at the build output directory.

Since we are looking to fix that in the upcoming commits, let's make
sure that everything will still be able to find the proper LibC first.
2022-11-01 14:49:09 +00:00
Tim Schumacher
39fca21e11 LibC: Link against the full LibSystem target
I'm not sure why this wasn't done to begin with, but let's see if this
resolves our "can't find libsystem.so while double-checking undefined
symbols" issues.
2022-11-01 14:49:09 +00:00
Tim Schumacher
ac40197047 LibCrypt: Define it as a normal library
LibCrypt has no need for being -nostdlib, especially since we just link
in LibC manually anyways.
2022-11-01 14:49:09 +00:00
Timothy Flynn
4686989582 LibJS: Map DurationFormat's list style to "short" when it is "digital"
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/7495e32
2022-11-01 14:33:07 +00:00
Timothy Flynn
84e6833203 LibJS: Alphabetically sort the collations returned by CollationsOfLocale
This is a normative change in the Intl Locale Info proposal. See:
https://github.com/tc39/proposal-intl-locale-info/commit/171d3ad

Note this doesn't affect us because we don't have collation info from
the CLDR; we just return ["default"] here.
2022-11-01 14:33:07 +00:00
Timothy Flynn
d515929134 Browser: Update Storage Inspector's cookie model when deleting cookies
We currently get a list of cookies when the Storage Inspector is opened
and never update that list when deleting cookies. This updates the
inspector to actually take cookies out of the model when deleting them,
rather than deleting a copy of them.
2022-11-01 14:32:26 +00:00
Gunnar Beutner
a9888d4ea0 AK+Kernel: Handle some allocation failures in IPv4Socket and TCPSocket
This adds try_* methods to AK::SinglyLinkedList and
AK::SinglyLinkedListWithCount and updates the network stack to use
those to gracefully handle allocation failures.

Refs #6369.
2022-11-01 14:31:48 +00:00
Gunnar Beutner
ab8b043684 AK+Kernel: Handle allocation failures in Device::try_make_request
This adds try_* methods to AK::DoublyLinkedList and updates the Device
class to use those to gracefully handle allocation failures.

Refs #6369.
2022-11-01 14:31:34 +00:00
Gunnar Beutner
b33834ca3a Kernel: Remove unused #includes 2022-11-01 14:31:34 +00:00
kamp
8b0a464f5c HexEditor: Implement undo and redo actions 2022-11-01 12:07:28 +00:00
kamp
24f729d0ef HexEditor: Only mark window as modified when document is actually dirty 2022-11-01 12:07:28 +00:00
Gunnar Beutner
e44ccddba3 AK+Kernel: Don't allow allocations in AK::Function in kernel mode
Refs #6369.
Fixes #15053.

Co-authored-by: Brian Gianforcaro <bgianf@serenityos.org>
2022-11-01 12:07:15 +00:00
Gunnar Beutner
2a840a538c Kernel: Decrease number of captured variables for lambda
This decreases the number of bytes necessary to capture the variables
for this lambda. The next step will be to remove dynamic allocations
from AK::Function which depends on this change to keep the size of
AK::Function objects reasonable.
2022-11-01 12:07:15 +00:00
Gunnar Beutner
d1bc157e9f AK: Allow destruction of JsonObjectSerializer objects after errors
Previously we'd VERIFY() that the user had called finish(). This makes
the following code incorrect though:

auto json = TRY(JsonObjectSerializer<>::try_create(builder));
TRY(json.add("total_time"sv, total_time_scheduled.total));
TRY(json.finish());
return ...;

If the second TRY() returns early we'd fail at the VERIFY() call in the
destructor.

Calling finish() in the destructor - like we had done earlier - is also
not helpful because we have no idea whether the builder is still valid.
Plus we wouldn't be able to handle any errors for that call.

Verifying that either finish() was called or an error occurred doesn't
work either because the caller might have multiple Json*Serializer
objects, e.g. when inserting a JSON array into a JSON object. Forcing
the user to call finish() on their "main" object when a sub-object
caused an error seems unnecessarily tedious.
2022-11-01 11:57:08 +00:00
premek
92efa21727 Base: Add Black&White Square Button emoji
🔲 - U+1F532 Black Square Button
🔳 - U+1F533 White Square Button
2022-11-01 11:00:17 +00:00
martinfalisse
76da0c6c54 WebDriver: Implement GET /session/{id}/element/{id}/text endpoint 2022-11-01 10:55:34 +00:00
martinfalisse
5ffff09e05 WebContent+Friends: Add get_element_text IPC and plumbing 2022-11-01 10:55:34 +00:00
Andreas Kling
67236d9573 LibJS: Disable bytecode optimizations again
Bytecode optimizations still break test262, so let's not enable this
until they have been confirmed to work there.
2022-11-01 11:44:41 +01:00
Hendiadyoin1
4a06e68ecd LibJS: Set default bytecode optimization level to Optimize 2022-11-01 11:21:18 +01:00
Hendiadyoin1
1e1bf84e6d LibJS: Add a sanity check to bytecodes argument_list_evaluation 2022-11-01 11:21:18 +01:00
Hendiadyoin1
c9e7d452c5 LibJS: Add a note about inaccuracies to UnifySameBlocks 2022-11-01 11:21:18 +01:00
Hendiadyoin1
c66284ab0b LibJS: Fix MergeBlocks emitting some blocks twice 2022-11-01 11:21:18 +01:00
Hendiadyoin1
28e2467b48 LibJS: Minor cleanups in MergeBlocks 2022-11-01 11:21:18 +01:00
Hendiadyoin1
1ac1a5bd58 LibJS: Don't memcpy NewBigInt instruction
These aren't trivially copyable, so we have to be a bit more careful
2022-11-01 11:21:18 +01:00
Hendiadyoin1
a1f1d9e4a7 LibJS: Expose some information about the bytecode interpreters state
This is quite helpful, when reporting internal errors.
2022-11-01 11:21:18 +01:00
martinfalisse
937fcfc75c LibWeb+Base: Use line names for positioning grid items
When there are grid tracks with line names, use these to resolve
line-names passed to positioned grid items.
2022-11-01 11:19:41 +01:00
martinfalisse
829f56572d LibWeb: Parse line names in grid track position properties
Parse line names when passed to the grid-column/row-start/end CSS
properties.
2022-11-01 11:19:41 +01:00
martinfalisse
78a573d678 LibWeb: Parse line names in grid track size declarations
Parse line names in the grid-template-* CSS properties.
2022-11-01 11:19:41 +01:00
martinfalisse
93211f45a6 LibWeb: Use w3.org for specs and include new ones
Include new w3.org specs for the grid and correct others so they use
w3.org instead of drafts.
2022-11-01 11:19:41 +01:00
martinfalisse
1a4f2dca38 LibWeb: Refactor GridTrackPlacement
Refactor this class for quality-of-life reasons as well as to better
prepare for the addition of line names.
2022-11-01 11:19:41 +01:00
martinfalisse
b2b677e984 LibWeb: Refactor GridTrackSize classes
Refactor various classes in the GridTrackSize file for the incoming
named_tracks feature.

Previously the ExplicitTrackSizing had mixed responsiblities with the
newly-named GridRepeat class. This made it so it was not possible to
have multiple repeats within a single 'GridTrackSizeList' definition.

The MetaGridTrackSize class had both the responsibilities of being a
container for minmax values as well as for simple GridSizes. By uniting
the different possible values (repeat, minmax, default) into the
ExplicitGridTrack class are able to be more expressive as to the
different grid size modalities.

The GridTrackSizeList will be useful as compared to a
Vector<ExplicitGridTrack> since this way can keep track of the declared
line names. These same line names are able to be declared within the
values of a repeat function, hence the presence of a GridTrackSizeList
inside the GridRepeat class.
2022-11-01 11:19:41 +01:00
martinfalisse
9441515312 LibWeb: Rename GridTrackSizedConstraints
In order to avoid naming conflicts with the many trial-and-error name
changes going on in the GridTrackSize file, rename this to a unique name
that is unlikely to be troublesome.
2022-11-01 11:19:41 +01:00
martinfalisse
dc9f8218a9 LibWeb: Fix bug in placing grid items
Before were resetting the auto_placement_cursor_x to 0 at the end of
the row but this was incorrect, especially since the
auto_placement_cursor_y wasn't being incremented.

This made it so that auto-placed items were occasionally placed before
absolutely-placed ones even after the latter had already been placed.
2022-11-01 11:19:41 +01:00
Marco Rebhan
e773b9abe9 Toolchain: Use pkg-config instead of pkgconfig in serenity.nix
pkgconfig was renamed to pkg-config in nixpkgs.
2022-11-01 00:16:11 +00:00
Marco Rebhan
9c9ca8a8be Toolchain: Update gcc11 to gcc12 in serenity.nix 2022-11-01 00:15:53 +00:00
Timothy Flynn
2d7ad6dbe6 CI: Remove the manpage generator error file upon success
On some systems, just specifying "2> error_file" will create the file,
even if nothing is logged to it.
2022-10-31 18:25:01 -04:00
Peter Elliott
83e62e8c4f Utilities+LibArchive: Don't follow symlinks 2022-10-31 22:10:22 +00:00
Peter Elliott
415eb17490 LibCore: Add Core::System::readlink 2022-10-31 22:10:22 +00:00
Peter Elliott
612a3324d7 LibArchive: Support writing paths up to 255 characters
The POSIX.1-1988 limit was 100, but with the ustar prefix field it's 255
(kinda).
2022-10-31 22:10:22 +00:00
Peter Elliott
9ae36e2035 LibArchive: Refactor null-termination logic in TarFileHeader
Before this change the behavior was, confusingly:
- never null-terminate if set_field() is passed a StringView.
  - which would also not fail if the StringView is too large.
- require null-termination if set_field() is passed a String.

Not only are both of these wrong, having different behavior for those is
very confusing, and creating a String copy to force a type checker to
cause a string to be null-terminated is extremely weird.

The new behavior is to always null-terminate when possible, never
null-terminate if the last byte is used, and always verify that the
string will fit.
2022-10-31 22:10:22 +00:00
Timothy Flynn
a53749bc9d ntpquery: Unveil paths after parsing arguments
This allows running `ntpquery --help` in environments that do not have
the LookupServer service running, e.g. when generating man pages. The
same was done for netstat in commit 7fba413.
2022-10-31 22:10:14 +00:00
Timothy Flynn
9e9a07415e CI: Ensure the manpage generation step shuts down the VM on failure
Currently, if the script fails, it simply runs "exit 1". This exits the
script, but keeps the VM running, so CI hangs until it times out.

Instead of exiting, write a failure status to an error log and shutdown.
CI can then read that error log and fail the run if needed.
2022-10-31 22:10:14 +00:00
Luke Wilde
5ebfa8d620 CI: Make the test262 worker use GCC 12 2022-10-31 16:14:41 -04:00
Tim Schumacher
6382b174dc LibELF: Drop the "resolve and map" all-in-one
Both users of this function now have to do their resolving separately
before anyways, so let's just drop the resolving part inside the
function and require absolute paths to be fed in instead.
2022-10-31 19:23:02 +00:00
Tim Schumacher
d4a4fe68f9 LibELF: Track libraries using their full path 2022-10-31 19:23:02 +00:00
Tim Schumacher
2f4c06b13b LibELF: Handle absolute and relative paths for all resolve requests 2022-10-31 19:23:02 +00:00
Tim Schumacher
5e2a146860 LibELF: Sift down "library name only"-strings as far as possible
I might have gone a bit overboard with the `VERIFY`s, but this allows
for very easy tracking of where we start to leak in non-absolute paths.
2022-10-31 19:23:02 +00:00
Tim Schumacher
e7d0fb50a1 LibELF: Use a bit of TRY in DynamicLinker
`TRY` also works for `Result<>`. Who knew?
2022-10-31 19:23:02 +00:00
Tim Schumacher
31643c4ee3 LibELF: Prepend resolve_and to one of the map_library overloads
Having two functions that are named the same and whose behavior
regarding "should probably get a full path" and "does explicitly not
require a full path" is quite confusing, especially since that
difference is dictated through the other passed arguments.
2022-10-31 19:23:02 +00:00