Commit graph

64580 commits

Author SHA1 Message Date
Nico Weber
ed8f0a6263 LibGfx/ISOBMFF: Add JPEG2000BitsPerComponentBox
I haven't seen this in the wild yet, but it's the only missing
box type in I.5.3 and it's similar to to a subset of palette box
in I.5.3.4, so maybe the implementation is not completely wrong.
2025-01-20 17:22:13 -05:00
Nico Weber
68bf57bd8a LibGfx/ISOBMFF: Add JPEG2000ComponentMappingBox 2025-01-20 17:22:13 -05:00
Nico Weber
c5aac68295 LibPDF: Check DecodeParms array element type before casting
0000337.pdf contains:

    /DecodeParms[(null)<</K -1/Columns 2545>>]

where the array's first entry `(null)` is a string with
the characters `"null"`. Casting the string to a dict used to crash.
Instead, treat non-dict array entries as if no decode parms were present
for the filter at that array position.

This will fix a crash for 0000337.pdf once we can decode /JPXDecode
filters.
2025-01-20 17:21:50 -05:00
Kusekushi
6a7b6444d4 Ports/boost: Fix download link, fix paths in patches
Boostorg's artifactory instance is down, let's switch
to github instead.
2025-01-19 20:48:37 +01:00
butter1125
4bdda0f6bb Ports/openjpeg: Update to 2.5.3 2025-01-19 11:28:48 +01:00
MacDue
d3cafeb9d3 Taskbar: Fix applet/clock area background color
To be consistent with WindowServer, the background color should be
"button", not "window". This fixes the painting for themes like Nord.
2025-01-18 09:40:05 -05:00
Nico Weber
083cf95813 LibGfx/ISOBMFF: Add JPEG2000PaletteBox 2025-01-18 07:34:27 -05:00
Nico Weber
fe597e7c63 LibGfx: Add a few spec comments to ISOBMFF/JPEG2000Boxes.cpp
The .h file has them too, but I missed them in the .cpp when touching
this file just now.
2025-01-18 07:34:27 -05:00
butter1125
1efd01228d Ports/libxmp: Update to 4.6.1 2025-01-18 07:34:02 -05:00
Luke Wilde
f5980ee094 LibJS: Propagate direct eval presence if the current scope is screwed
Previously it only deoptimized the parent scope if the current scope
contains direct eval, which is incorrect because code ran in direct
eval mode has access to the entire scope chain it was executed in.
The fix is to also propagate direct eval's presence if the current
scope is marked as being screwed by direct eval.

This fixes Google's botguard failing to complete on Google sign in, as
it tried to access local variables outside of a direct parent function
with eval, causing it throw "unhandled" exceptions. Unhandled is in
quotes because their bytecode VM _technically_ caught it, but it was
considered an unhandled exception. This was determined by removing get
optimizations and then adding debug output for every get operation.
Using this, I noticed that for these errors, it would access the
'message' and 'stack' properties. This is because their error handler
function noticed this was not a synthesised error, which is never
expected to happen. That was determined by using Chrome Devtools 'pause
on handled exception' feature, and noticing it never threw a '[var] is
not defined' exception, but only synthesized error objects which
contained a sentinel value to let it know it was synthesized.

I added debug output to eval to print out what was being eval'd because
it makes heavy use of eval. This revealed that the exceptions only came
from eval.

I then dumped every generated executable and noticed the variables it
was trying to access were generated as local variables in the top
scope. This led to checking what makes a variable considered local or
not, which then lead to this block of code in ~ScopePusher that
propagates eval presence only to the immediate parent scope. This
variable directly controls whether to create all variables properly
with variable environments and bindings or allow them to be stored as
local registers tied to that function's executable.

Since this now lets botguard run to completion, it no longer considers
us to be an insecure/potential bot browser when signing in, now
allowing us to be able to sign in to Google.

(cherry picked from commit 5f33383a7bf1b4277e15d4b21fbafcece9302614)
2025-01-17 18:33:06 -05:00
butter1125
f7ba87954a Ports/libunistring: Update to 1.3 2025-01-17 07:58:46 -05:00
butter1125
3e1095a3b3 Ports/libslirp: Update to 4.8.0 2025-01-17 06:35:52 -05:00
RatcheT2497
62a25aa46d Kernel/RTL8168: Change wrong u32 mmio reads to u8
Crash caused by erroneous reading of a few 8bit registers as 32bit,
causing an unaligned access panic.
2025-01-15 21:32:54 -05:00
butter1125
7c4ad478a7 Ports/libmikmod: Update to 3.3.12 2025-01-15 10:28:46 -05:00
butter1125
edeeff8562 Ports/libarchive: Update to 3.7.7 2025-01-15 10:02:38 -05:00
butter1125
09cf91780a Ports/stockfish: Update to 17 2025-01-15 10:02:22 -05:00
butter1125
5f5b25bd0e Ports/libexpat: Update to 2.6.4 2025-01-15 10:02:05 -05:00
Sönke Holz
6127f03108 Kernel/GPU: Add a simple-framebuffer devicetree driver
simple-framebuffer nodes describe pre-initialized framebuffers that we
can use without any special setup code.
2025-01-14 00:16:43 +01:00
Sönke Holz
60bb8edd7b Kernel/xHCI: Support xHCI controllers defined in the devicetree 2025-01-13 19:30:54 +01:00
Sönke Holz
980bc4ddf0 Kernel/xHCI: Split PCI-specific code into a new subclass
This will allow us to add support for xHCI controllers that are not
connected via PCI.
2025-01-13 19:30:54 +01:00
Sönke Holz
e88594005b Kernel/DeviceTree: Ignore nodes with status != "okay"
status = "okay" means the device is operational. We should ignore
devices that have a different status property value.

The BCM2835TimerDriver force disable hack can be removed, since that
timer is disabled in the Pi 4 devicetree.

But we have to introduce another hack that force enables the Pi 3 system
timer, as we otherwise wouldn't have any timer that we support for the
Pi 3.
2025-01-13 19:30:54 +01:00
Sönke Holz
0d11e70cfe Kernel/MM: Set the correct memory type for mmap()s
Make the MemoryType used by mmap() configurable by
File::vmobject_and_memory_type_for_mmap overrides (previously called
vmobject_for_mmap).

All mmap()s were previously MemoryType::Normal.
2025-01-13 19:30:54 +01:00
Sönke Holz
b92907f339 Kernel/MM: Make allocate_region_with_vmobject MemoryType-aware 2025-01-13 19:30:54 +01:00
Sönke Holz
d73a8fe750 Kernel/MM: Synchronize executable memory after handling an inode fault
ARM requires an explicit cache flush when modifying executable memory:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/caches-and-self-modifying-code

__builtin___clear_cache compiles to a no-op if no explicit flushing is
needed (like on x86):
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005f_005f_005fclear_005fcache
2025-01-13 19:30:54 +01:00
Sönke Holz
1d29f02274 Kernel/SDHC: Return ENOTSUP if no base clock frequency provided
We would otherwise crash here on the Raspberry Pi 4.
2025-01-13 19:30:54 +01:00
Sönke Holz
6fa8165d91 Kernel/MM: Use same memory type for zeroing pages as the actual mapping
On some architectures like ARM, using mismatched memory types for
different aliases of the same physical memory can lead to unexpected
behavior.
(https://developer.arm.com/documentation/102376/0200/Memory-aliasing-and-mismatched-memory-types)

Flushing the data cache and using appropriate memory barriers might be
enough, but should have worse performance.
2025-01-13 19:30:54 +01:00
Sönke Holz
6cdd659c94 Meta: Correct the Pi 3 devicetree blob path
ee891462b8 accidentally changed the path to the Pi 3 devicetree blob to
an incorrect one.
2025-01-13 16:06:07 +01:00
Marek Knápek
6073ad189a LibCrypto: Smaller stack usage
in portable version of SHA-1, SHA-256 and SHA-512.
2025-01-13 09:19:10 -05:00
Pavlo Ivashkov
31daabcf0a AK: Improve performance of u64 randoms 2025-01-13 09:08:55 -05:00
butter1125
1e935911f0 Ports/lcms2: Update to 2.16 2025-01-13 09:05:37 -05:00
butter1125
a59e22000a Ports/imagemagick: Update to 7.1.1-43 2025-01-12 19:37:09 -05:00
butter1125
0f24112e91 Ports/mawk: Update to 1.3.4-20240905 2025-01-12 19:36:45 -05:00
butter1125
b1bfe4448a Ports/gawk: Update to 5.3.1 2025-01-12 19:36:45 -05:00
butter1125
d3cc7a3135 Ports/libopus: Update to 1.5.2 2025-01-12 19:36:06 -05:00
butter1125
961191996a Ports/libffi: Update to 3.4.5 2025-01-12 19:36:06 -05:00
djwisdom
db31758768 Base+Fonts: Add Lucidity Mono Regular terminal font 2025-01-12 19:34:22 -05:00
djwisdom
a2fc8bbd36 Base+Fonts: Add Lucidity Mono Bold terminal font 2025-01-12 19:33:36 -05:00
butter1125
9bd47a85e2 Ports/file: Update to 5.46 2025-01-12 19:32:30 -05:00
butter1125
56c8c7cc42 Ports/ca-certificates: Update to version 2024-12-31 2025-01-12 19:32:00 -05:00
butter1125
6399069128 Ports/giflib: Update to 5.2.2 2025-01-12 19:31:26 -05:00
Nico Weber
bc469c3dd0 LibGfx: Only use draw_scaled_bitmap() fast path when not flipping image
If we're drawing a transform with a negative scale, we have to go
through the slow path since draw_scaled_bitmap() is unable to flip
images.

Fixes a regression from the 2nd commit in #24465.
2025-01-12 18:54:31 -05:00
Sönke Holz
524f699ae2 Kernel+LibC: Clean up assembly code
Some assembly files were previously inconsistently formatted.

- Use 4 spaces for indentation
- Use `.L` as the local label prefix
- Remove trailing whitespace
2025-01-10 12:31:16 +01:00
Sönke Holz
1e0e569273 Kernel: Don't allow text relocations
We don't have any text relocations in the kernel anymore.
This linker argument was added in bd6dc5ccec as a temporary workaround.

Removing this argument won't cause text relocations to be reported for
aarch64 and riscv64, as we currently compile the kernel with `--no-pie`
on those architectures.
2025-01-10 12:31:16 +01:00
Sönke Holz
95ec8d7f78 Kernel/aarch64: Don't use the ldr Rd, =label pseudoinstruction
This pseudoinstruction causes text relocations, as it stores the target
address in literal pools inside .text.

The bss clearing code now also matches the RISC-V implementation.
2025-01-10 12:31:16 +01:00
Sönke Holz
cfa16b767c Kernel/riscv64: Avoid generation of a text relocation in enable_paging
Manually calculate the target address instead of storing the target
address in .text.
2025-01-10 12:31:16 +01:00
Nico Weber
b50f3132ef imgcmp: Add a --write-diff-image option
This writes a bitmap that has pixels that are identical between
the two input images blended with 0.5 alpha against white, and
differing pixels are highlighted in red.

Use like so:

    imgcmp --write-diff-image diff.webp image1.png image2.webp
2025-01-10 06:22:01 -05:00
Nico Weber
bd5e5c1a0c Utilities+Meta: Add a simple imgcmp utility
For now, it checks if two images are completely identical, and if not,
it prints the first differing pixel.
2025-01-10 06:22:01 -05:00
Kevin F. Konrad
d46e90ce0f Meta: Omit -cpu arguments on windows for qemu 9 compatibility 2025-01-09 13:42:56 +01:00
Nico Weber
801d7e2ced LibGfx/JPEG2000: Add LRCP and RLCP progression iterators 2025-01-07 08:23:28 -05:00
Nico Weber
e99fe94cfb LibGfx: Add some tile math from the spec to JPEG2000Loader.cpp
Not used for anything yet, but will be used to figure out number of
codeblocks (and hence, size of tag trees) in a packet.
2025-01-07 08:23:28 -05:00