Commit Graph

35600 Commits

Author SHA1 Message Date
Sahan Fernando
683de841e5 Kernel: Sandbox each GPU3DDevice file description into own host context 2022-03-14 17:38:18 +03:30
Arif Orhun Uzun
fe7d801dd9 SpaceAnalyzer: Fix the crash caused by double click
With #12480, Breadcrumbbar's on_focus_change() uses
on_click(). In SpaceAnalyzer, double clicking triggers the
TreeWidgetMap's on_path_change(), which triggers Breadcrumbbar's
on_focus_change(), which also triggers the TreeWidgetMap's
on_path_change() again. This resulted in use-after-free of
Breadcrumbbar, thus resulted in the crash. Not updating the
TreeWidgetMap's viewpoint recursively solves the issue.
2022-03-14 07:40:22 -04:00
Brian Gianforcaro
01bd3c5563 LibC: Expose AK::timing_safe_compare via timingsafe_memcmp(..)
Ports / other userland often needs such an implementation to function.
Lets expose `AK::timing_safe_compare` under the same name used used in
OpenBSD / FreeBSD / Solaris and other projects.
2022-03-13 19:08:58 -07:00
Brian Gianforcaro
0a5321b3f9 LibCrypto: Use AK::timing_safe_compare to validate sensitive data
Addresses one FIXME in GCM, and another similar issue in EMSA_PSS.
We should be using constant time memory comparisons in all of our
crypto code.
2022-03-13 19:08:58 -07:00
Brian Gianforcaro
3ab2b90744 LibCore: Use timing_safe_compare to compare password hash values
This is not strictly required, as we are comparing hashes, not the
password it self. However given this is generic code that could be
used anywhere in the system, it seems prudent to be cautious and
make sure we don't inadvertently leak any information about the hash
via timing attacks in future usages of `LibCore::Account`.

Reported-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2022-03-13 19:08:58 -07:00
Brian Gianforcaro
390666b9fa AK: Add naive implementations of AK::timing_safe_compare
For security critical code we need to have some way of performing
constant time buffer comparisons.
2022-03-13 19:08:58 -07:00
Brian Gianforcaro
02b2f2787a Tests: Rename AK/TestMemMem.cpp to AK/TestMemory.cpp
Rename to create a new generic test group for the AK memory APIs.
2022-03-13 19:08:58 -07:00
Idan Horowitz
c575710e5e LibWeb: Use inline script tag source line as javascript line offset
This makes JS exception line numbers meaningful for inline script tags.
2022-03-14 00:25:33 +01:00
Luke Wilde
47d0d9fd65 Ports: Update curl to 7.82.0 2022-03-13 22:58:21 +01:00
Luke Wilde
47ec3dbf45 Ports: Update zstd to 1.5.2 2022-03-13 22:58:21 +01:00
Ben Maxwell
e435710f7c Base: Add syntax/code styling to Cupertino theme
This makes code readable in Hack Studio.

This commit also replaces the 'highlight' window colour
with one that matches theme (the previous was the default).
2022-03-13 22:57:55 +01:00
Sam Atkins
7535398dbf FileOperation: Port to Core::Stream 2022-03-13 22:38:48 +01:00
Sam Atkins
1925bde3c0 FileManager: Use Core::Stream for FileOperationProgressWidget 2022-03-13 22:38:48 +01:00
Sam Atkins
dc5a318aa9 FileManager: Use TRY in run_file_operation()
The exception is `execvp()` since that has no Core::System wrapper yet.
2022-03-13 22:38:48 +01:00
Lenny Maiorani
6a23dfbc92 LibGfx: Use common class template for PBM/PGM/PPM image loaders
PBM, PGM, and PPM image loaders are mostly common. The only difference
is how the data is read and the associated magic numbers. The magic
numbers are already made common using the loading contexts. Now make
the implementations common via a class template which accepts the
context to disambiguate.
2022-03-13 22:35:20 +01:00
Lenny Maiorani
786b02730c LibGfx: Commonize P[BGP]M file loading contexts
Much of the code in PBM, PGM, and PPM image loaders is common. The
contexts are nearly identical. Instead of writing multiple contexts,
write 1 with a template argument to pass in the details of the given
format.
2022-03-13 22:35:20 +01:00
Lenny Maiorani
5c21f963ff Libraries: Use default constructors/destructors in LibX86
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
1a59cffb00 Libraries: Use default constructors/destructors in LibWebSocket
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
8b334248e4 Libraries: Use default constructors/destructors in LibVT
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
a53c00f1df Libraries: Use default constructors/destructors in LibThreading
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
7cc6ba16be Libraries: Use default constructors/destructors in LibSyntax
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
7abb782206 Libraries: Use default constructors/destructors in LibSQL
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
dd08e84664 Libraries: Use default constructors/destructors in LibMarkdown
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
103ce2f9e9 Libraries: Use default constructors/destructors in LibLine
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
dcdc62323d Libraries: Use default constructors/destructors in LibIPC
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
79aa49d04f Libraries: Use default constructors/destructors in LibHTTP
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Lenny Maiorani
97fcbdd199 Libraries: Use default constructors/destructors in LibGemini
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-13 22:34:38 +01:00
Andreas Kling
c1e6fc67a1 LibWeb: Add a Vector::ensure_capacity() in collect_matching_rules()
Avoid some incremental Vector growth by pre-allocating enough capacity
to cover the case where every single selector matches an element.
2022-03-13 19:55:08 +01:00
Andreas Kling
afc5fade05 LibWeb: Add some fast_is<T> helpers for hot classes on GitHub :^) 2022-03-13 18:09:43 +01:00
Andreas Kling
74fda2a761 LibWeb: Make CSS::property_initial_value() use an Array internally
Since we want to store an initial value for every CSS::PropertyID,
it's pretty silly to use a HashMap when we can use an Array.

This takes the function from ~2.8% when mousing around on GitHub all the
way down to ~0.6%. :^)
2022-03-13 18:09:43 +01:00
Andreas Kling
39389b5704 LibWeb: Don't make deep copy of custom properties for every element
Previously we were making a copy of the full set of custom properties
that applied to a DOM element. This was very costly and dominated the
profile when mousing around on GitHub.

Note that this may break custom properties on pseudo elements a little
bit, and that's something we'll have to look into.
2022-03-13 18:09:43 +01:00
Andreas Kling
f88d65d9cb LibWeb: Cache CSS::Selector's pseudo element at construction time
Computing the pseudo element of a CSS::Selector was very hot when
mousing around on GitHub in Browser. A profile had it at ~10%.
After these changes, it's totally gone from the profile. :^)
2022-03-13 18:09:43 +01:00
Andreas Kling
f5c2e87965 LibWeb: Sort stacking context tree once, after fully building it
Instead of calling quick_sort() every time a StackingContext child
is added to a parent, we now do a single pass of sorting work after the
full StackingContext tree has been built.

Before this change, the quick_sort() was ~13.5% of the profile while
hovering links on GitHub in the Browser. After the change, it's down to
~0.6%. Pretty good! :^)
2022-03-13 18:09:43 +01:00
Timothy Flynn
0dfb9714fe LibCore: Use altzone for the current time zone offset during DST
Also use the daylight global to determine the current time zone name,
i.e. tzname[0] is standard time, tzname[1] is daylight savings time.

Note that altzone isn't required to be defined on all systems, so we
have to #ifdef to check if it exists in order for Lagom to build.
2022-03-13 17:50:49 +01:00
Timothy Flynn
7fceb909a5 LibC: Use altzone for the current time zone offset during DST 2022-03-13 17:50:49 +01:00
Ali Mohammad Pur
2000251333 LibJS: Implement bytecode generation for WithStatement 2022-03-13 17:50:21 +01:00
Ali Mohammad Pur
57386ca839 LibJS: Initialize 'var' bindings to undefined on declaration
This is what CreateGlobalVarBinding does, so do the same thing in BC.
2022-03-13 17:50:21 +01:00
Ali Mohammad Pur
ba9c4959d6 LibJS: Leave the unwind context on break/continue/return in bytecode
Otherwise we'd keep the old unwind context, and end up never invoking
the other handlers up the stack.
2022-03-13 17:50:21 +01:00
Ali Mohammad Pur
41184c960d LibJS: Propagate abrupt completions in Bytecode::Op::Call
This was not handling the nullary call case correctly, remove the whole
nullary check as there's nothing particularly expensive in the catch-all
case anyway.
2022-03-13 17:50:21 +01:00
mjz19910
fd8a56cdde LibJS: Add some tests for TypedArray.prototype.set 2022-03-13 16:49:25 +01:00
Andreas Kling
13c253d2ee LibWeb: Fix serialization of selectors with universal subject (*)
For seletors whose subject is unversal (i.e selectors that end in "*")
we were not serializing the asterisk. Instead "foo bar *" came out as
"foo bar foo". This patch fixes that by correctly serializing the last
simple selector if it's universal.
2022-03-13 15:41:54 +01:00
MacDue
8fbe96af45 LibVT: Use coarse scrolling animation in TerminalWidget
The smooth scrolling looks slightly off in the terminal as the
scrollbar animation lasts longer than the actual scroll.

This behaviour is also consistent with other terminal emulators.
2022-03-13 11:45:07 +01:00
MacDue
91fff3f1ae LibGUI: Allow setting smooth/coarse scrolling animation on ScrollBar 2022-03-13 11:45:07 +01:00
MacDue
9ab3ab86cb LibGUI: Add m_ prefix to gutter_click_state in ScrollBar
Quick fix, this member did not seem to follow the conventions.
2022-03-13 11:45:07 +01:00
Andrew Smith
297e095755 PixelPaint: Correctly apply flip/rotate/crop to layers' alpha mask
-Layer now has methods for flip/rotate/crop, which are responsible
for handling the alpha mask.
-Fixed crash when the display image size is out of sync with
the content image size.
-Changed API for setting content and mask image in Layer. Now, both
must be set at the same time, and it can result in an error if
you provide mismatched dimensions.
2022-03-13 10:34:38 +01:00
Brian Gianforcaro
03342876b8 Revert "Kernel: Use an ArmedScopeGuard to revert changes after failed mmap"
This reverts commit 790d620b39.
2022-03-12 21:45:57 -08:00
Brian Gianforcaro
3b39e16e8f Revert "Kernel: Don't override FramebufferDevice's memory regions on mmap"
This reverts commit 85ba70d86f.
2022-03-12 21:45:57 -08:00
Brian Gianforcaro
09673e7f13 Ports: Update vim to version 8.2.4554 2022-03-12 17:38:45 -08:00
Brian Gianforcaro
ff16da98b0 Ports: Update less to version 590 2022-03-12 17:38:45 -08:00
Brian Gianforcaro
8627d1a944 Ports: Update git to version 2.35.1 2022-03-12 17:38:45 -08:00