Commit graph

39234 commits

Author SHA1 Message Date
kleines Filmröllchen
41b2d37e8a AK: Always check shift amount in LEB128 read functions
Even shifting 0 by more than the value size is UB.
2022-07-09 22:04:31 +00:00
Andreas Kling
cefc931347 LibWeb: Make sure CSS::ComputedValues has initial size values
Instead of using Optional<LengthPercentage>, we now use LengthPercentage
for these values. The initial values are all `auto`.

This avoids having to check `has_value()` in a ton of places.
2022-07-09 22:16:35 +02:00
Andreas Kling
734ff422ad LibWeb: Add LengthPercentage::is_auto() convenience helper
This lets you ask if a LengthPercentage is `auto` with one call instead
of two, which will make some conditions nicer to express.
2022-07-09 22:16:32 +02:00
Andreas Kling
44025e837f LibGfx: Use float when calculating text width in ScaledFont
This fixes an issue where we'd truncate the fractional part of each
glyph width, often making the returned width slightly too short.
2022-07-09 22:16:18 +02:00
Andreas Kling
80ed7d220c LibGfx: Paint whitespace characters (including &nbsp;) as empty space
This fixes an issue where &nbsp; would sometimes render as "A" in
web content.
2022-07-09 22:16:13 +02:00
Andreas Kling
2217d91b8d AK: Make VERIFY() work in MinSizeRel builds 2022-07-09 22:15:43 +02:00
Lucas CHOLLET
dab814ea11 LibCrypto: Add the [[nodiscard]] qualifier in both BigInteger classes 2022-07-09 15:55:32 +00:00
Maciej
303be38f65 Kernel/Routing: Hide some leftover debugging under a debug flag 2022-07-09 16:53:26 +03:00
Lucas CHOLLET
6f04a3778b FileManager: Change PGID of spawned processes
Processes spawned by FileManager (e.g. through double-click) now set
their PGID to that of the session leader. It allows the filemanage
instance to be killed without propagating the signal to the new process.
2022-07-09 11:41:07 +01:00
Allan Regush
63d06458ca AK: Add equality operators to compare RefPtr to NonNullRefPtr 2022-07-09 09:32:51 +01:00
Allan Regush
ce7d868d6b AK: Add comparison operators to NonnullRefPtr 2022-07-09 09:32:51 +01:00
MacDue
61a703816c LibWeb: Base marker size on font height rather than line height
This fixes the oversized markers on GitHub
2022-07-09 09:28:31 +01:00
kleines Filmröllchen
69218b92a5 LibCore+Userland: Use StringViews when calling Core::System::open
For some reason we used raw char pointers sometimes, which caused at
least one heap buffer overflow detected in fuzzing.
2022-07-09 09:25:20 +01:00
Maciej
7dd3c5c981 Applications: Add a new NetworkSettings application 2022-07-09 09:22:25 +01:00
Maciej
df7b7cbfa4 NetworkServer: Kill running DHCPServer before starting our own
We cannot run two DHCPServers at once, let's just kill the one that was
started previously.
2022-07-09 09:22:25 +01:00
Maciej
8526c3f680 NetworkServer: Clear default gateway route entry before adding 2022-07-09 09:22:25 +01:00
Maciej
20430ffeae route: Support removing entries with unknown gateway 2022-07-09 09:22:25 +01:00
Maciej
bea1668159 Kernel/Net: Support removing route entries with unknown gateway
If you specify gateway as 0.0.0.0, the SIOCDELRT ioctl will remove all
route entries that match all the other arguments.
2022-07-09 09:22:25 +01:00
Maciej
36676a1604 AK: Add IPv4Address::netmask_from_cidr 2022-07-09 09:22:25 +01:00
Ali Mohammad Pur
b85666b3d2 LibRegex: Fix lookup table-based range checks in Compare
The lowercase version of a range is not required to be a valid range,
instead of casefolding the range and making it invalid, check twice with
both cases of the input character (which are the same as the input if
not insensitive).
This time includes an actual test :^)
2022-07-09 01:00:44 +00:00
Brian Gianforcaro
b7c50f7094 Base: Add -ftrivial-auto-var-init to man7/Mitigations.md 2022-07-09 00:53:45 +00:00
Tim Schumacher
a813b941b8 Ports: Add a QEMU port 2022-07-08 22:27:38 +00:00
Tim Schumacher
5835373fc6 Ports: Add a port for pixman 2022-07-08 22:27:38 +00:00
Tim Schumacher
b9f7966e00 LibC: Move stack canary initialization before the global constructors
Once again, QEMU creates threads while running its constructors, which
is a recipe for disaster if we switch out the stack guard while that is
already running in the background.

To solve that, move initialization to our LibC initialization stage,
which is before any actual external initialization code runs.
2022-07-08 22:27:38 +00:00
Tim Schumacher
cf0ad3715e Kernel: Implement sigsuspend using a SignalBlocker
`sigsuspend` was previously implemented using a poll on an empty set of
file descriptors. However, this broke quite a few assumptions in
`SelectBlocker`, as it verifies at least one file descriptor to be
ready after waking up and as it relies on being notified by the file
descriptor.

A bare-bones `sigsuspend` may also be implemented by relying on any of
the `sigwait` functions, but as `sigsuspend` features several (currently
unimplemented) restrictions on how returns work, it is a syscall on its
own.
2022-07-08 22:27:38 +00:00
Tim Schumacher
edbffb3c7a Kernel: Unblock SignalBlocker if a signal was just unmarked as pending
When updating the signal mask, there is a small frame where we might set
up the receiving process for handing the signal and therefore remove
that signal from the list of pending signals before SignalBlocker has a
chance to block. In turn, this might cause SignalBlocker to never notice
that the signal arrives and it will never unblock once blocked.

Track the currently handled signal separately and include it when
determining if SignalBlocker should be unblocking.
2022-07-08 22:27:38 +00:00
Tim Schumacher
cd189999d1 Kernel: Don't let locks of the same owner conflict with each other
Documentation on POSIX locks seems sparse, but this is how the Linux
kernel implementation handles it.
2022-07-08 22:27:38 +00:00
Tim Schumacher
dc6016cd18 Kernel: Don't fail on unlocking nonexistent file locks
I haven't found any POSIX specification on this, but the Linux kernel
appears to handle it like that.

This is required by QEMU, as it just bulk-unlocks all its file locking
bytes without checking first if they are held.
2022-07-08 22:27:38 +00:00
Tim Schumacher
7d3f71a648 Kernel: Do not disable userland access to the RDTSC instruction
Access to RDTSC is occasionally restricted to give malware one less
option to accurately time attacks (side-channels, etc.).

However, QEMU requires access to the timestamp counter for the exact
same reason (which is accurately timing its CPU ticks), so lets just
enable it for now.
2022-07-08 22:27:38 +00:00
Tim Schumacher
9e8c698ae8 Tests: Remove the RDTSC kernel crash test
We will remove the RDTSC instruction restriction to allow QEMU to read
an accurate time, so this will no longer crash and therefore fail the
test.
2022-07-08 22:27:38 +00:00
Tim Schumacher
5efa8e507b Kernel: Implement an axallowed mount option
Similar to `W^X` and `wxallowed`, this allows for anonymous executable
mappings.
2022-07-08 22:27:38 +00:00
Tim Schumacher
6187cf72cc LibM: Implement fma 2022-07-08 22:27:38 +00:00
Tim Schumacher
6c650d1b8d LibC: Add stubs for glob and globfree 2022-07-08 22:27:38 +00:00
Timothy Flynn
f672b4c151 LibUnicode: Remove now-unused Unicode::select_pattern_with_plurality 2022-07-08 20:33:52 +02:00
Timothy Flynn
5b68c1a06c LibJS: Use Intl.PluralRules within Intl.NumberFormat
This also allows removing a bit of a BigInt hack to resolve plurality of
BigInt numbers (because the AOs used in ResolvePlural support BigInt,
wherease the naive Unicode::select_pattern_with_plurality did not).

We use cardinal form here; the number format patterns in the CLDR align
with the cardinal form of the plural rules.
2022-07-08 20:33:52 +02:00
Timothy Flynn
6d9b779757 LibJS: Add an overload of ResolvePlural for use without PluralRules
The NumberFormat spec casually indicates the need for a PluralRules
object without explicity saying so, with text such as:

"which may depend on x in languages having different plural forms."

Other implementations actually do create a PluralRules object to resolve
those cases with ResolvePlural. However, ResolvePlural doesn't need much
from PluralRules to operate, so this can be abstracted out for use in
NumberFormat without the need to allocate a PluralRules instance.
2022-07-08 20:33:52 +02:00
Timothy Flynn
1fc87d1529 LibJS: Use Intl.PluralRules within Intl.DurationFormat 2022-07-08 20:33:52 +02:00
Timothy Flynn
232df4196b LibUnicode: Replace NumberFormat::Plurality with Unicode::PluralCategory
To prepare for using plural rules within number & duration format, this
removes the NumberFormat::Plurality enumeration.

This also adds PluralCategory::ExactlyZero & PluralCategory::ExactlyOne.
These are used in locales like French, where PluralCategory::One really
means any value from 0.00 to 1.99. PluralCategory::ExactlyOne means only
the value 1, as the name implies. These exact rules are not known by the
general plural rules, they are explicitly for number / currency format.
2022-07-08 20:33:52 +02:00
Timothy Flynn
cc5c707649 LibJS+LibUnicode: Do not generate the PluralCategory enum
The PluralCategory enum is currently generated for plural rules. Instead
of generating it, this moves the enum to the public LibUnicode header.
While it was nice to auto-discover these values, they are well defined
by TR-35, and we will need their values from within the number format
code generator (which can't rely on the plural rules generator having
run yet). Further, number format will require additional values in the
enum that plural rules doesn't know about.
2022-07-08 20:33:52 +02:00
huttongrabiel
9369610bf4 LibGUI: Unindent selected text on shift+tab press
Selected text is unindented when Shift+Tab is pressed. Select text,
indent it with Tab, then unindent with Shift+Tab.
2022-07-08 11:47:56 +01:00
huttongrabiel
2fbaa7996c LibGUI: Indent selected text on tab press
If selected text is less than a whole line, usual delete/replace takes
place. Otherwise, if the selected text is a whole line or spans
multiple lines, the selection will be indented.
2022-07-08 11:47:56 +01:00
Tim Schumacher
80705a72bd mount: Allow extending fstab via drop-in files in fstab.d 2022-07-08 12:42:23 +02:00
Tim Schumacher
e04155475d mount: Separate mounting by line into a new function 2022-07-08 12:42:23 +02:00
zzLinus
6453f74642 LibGUI: Support typing to search for ComboBox
LibGUI: Fixup missing  one charactor issue
2022-07-08 11:40:19 +01:00
Kenneth Myhra
247951e09c LibWeb: Add URLSearchParams as part of union type for XHR::send()
This patch adds support for URLSearchParams to XHR::send() and
introduces the union type XMLHttpRequestBodyInit.

XHR::send() now has support for String and URLSearchParams.
2022-07-08 12:37:01 +02:00
Yuval
bd74db157a HackStudio: Add the "Copy Full Path" TreeView context menu option
This commit adds support for the option described above.
The option can be seen after a right click on a TreeView item,
and it puts the item's full path in the clipboard.
2022-07-08 11:20:05 +01:00
Yuval
4ef0433be1 HackStudio: Add the "Copy Relative Path" TreeView context menu option
This commit adds support for the option described above.
The option can be seen after a right click on a TreeView item,
and it puts the item's relative path in the clipboard (relative
to the project's root directory).
2022-07-08 11:20:05 +01:00
Tim Schumacher
6978b53ea0 Meta: Don't disable custom Toolchain on SerenityOS
Parts of our build system and scripts rely on the fact that we are
cross-compiling. For now, remove the "try to build natively" part to get
the build running and leave a TODO for later.
2022-07-08 12:04:01 +02:00
Tim Schumacher
92bf442d83 Meta: Provide the correct path for e2fsck on SerenityOS 2022-07-08 12:04:01 +02:00
Tim Schumacher
139f871781 Meta: Use pls instead of sudo on SerenityOS 2022-07-08 12:04:01 +02:00