Commit graph

14390 commits

Author SHA1 Message Date
Andreas Kling
467f6c74a4 Kernel: Keep reading from i8042 until the buffer is empty
Otherwise we might not drain the mouse buffer until the next IRQ.
2020-11-14 17:20:17 +01:00
Andreas Kling
a5982f8605 AK: Mark SimpleIterator::operator*() as ALWAYS_INLINE
This gives the compiler enough information to optimize index validation
when using range-for to iterate over a Vector, drastically reducing the
cost of such loops.
2020-11-14 17:20:17 +01:00
Ben Wiederhake
c4933f9bd7 Meta: Fix IRC notification script
What a silly mistake. How did I manage to do that?
2020-11-14 17:14:45 +01:00
Brendan Coles
f8c980a06b Userland: chroot: Add --userspec/-u flag to set uid/gid for chroot 2020-11-14 17:14:30 +01:00
Andreas Kling
677af891b4 UserspaceEmulator: Implement FISUB_RM32 2020-11-14 15:34:53 +01:00
Andreas Kling
ca85ecc032 UserspaceEmulator: Remove some FPU debug spam 2020-11-14 15:34:53 +01:00
Andreas Kling
a031c6c754 UserspaceEmulator: Implement FABS 2020-11-14 15:34:48 +01:00
Andreas Kling
60ff27c633 UserspaceEmulator: Improve FCOMI/FCOMIP/FUCOMI/FUCOMIP
These instructions now operate on the specified FPU stack entry instead
of always using ST(0) and ST(1).

FUCOMI and FUCOMIP also handle NaN values slightly better.
2020-11-14 15:33:56 +01:00
Andreas Kling
d4509647d8 UserspaceEmulator: Honor the read/write/execute bits in mmap regions
UE will now correctly crash when accessing an mmap memory region in
some way it's not supposed to be accessed.
2020-11-14 15:33:56 +01:00
Ben Wiederhake
ef9ac8a8a2 Meta: Use SerenityBot for IRC notifications
This avoids "useless" join/part notifications.
2020-11-14 15:30:29 +01:00
Ben Wiederhake
80d1e12116 Meta: Let toolchain patches invalidate toolchain cache
Fixes #4072.
2020-11-14 15:30:29 +01:00
Ben Wiederhake
58b70e8dc8 Meta: Fix broken IRC notification for drafts and skips 2020-11-14 13:16:48 +01:00
Andreas Kling
8ee6768d11 UserspaceEmulator: Print an emulator backtrace on OOB access
This makes OOB accesses much more actionable than just having UE itself
asserting with no hint about what the emulated program was doing.
2020-11-14 11:29:14 +01:00
Andreas Kling
f568aed2e7 LibC: strtok_r() should not go past the last token
When we hit the last token, make the saved pointer point to the null
terminator instead of to the next token. This ensures that the next
call to strtok_r() returns null as expected.

Found by running GCC in UE. :^)
2020-11-14 11:24:42 +01:00
Andreas Kling
a65e7db533 LibC: Fix OOB access in strerror() with invalid input
Calling strerror() with a negative number should not access below the
error string array.

Found by running GCC in UE. :^)
2020-11-14 11:23:39 +01:00
Andreas Kling
abe9cec612 TmpFS: Set the root inode's timestamp to the current time
cc @bcoles :^)
2020-11-14 10:44:47 +01:00
AnotherTest
1172746633 LibTLS: Add support for AEAD cipher suites
And integrate AES-GCM.
2020-11-14 10:18:54 +01:00
AnotherTest
d3c52cef86 LibCrypto: Implement GCM mode 2020-11-14 10:18:54 +01:00
AnotherTest
2cc867bcba test-crypto: Silence the "creating bytebuffer..." debug 2020-11-14 10:18:54 +01:00
AnotherTest
740089d24a LibCrypto: Move out 'VerificationConsistency' into its own header file 2020-11-14 10:18:54 +01:00
AnotherTest
b9822d606d LibCrypto: Templatise CTR<T> on the increment function 2020-11-14 10:18:54 +01:00
Luke
ed2689c00a LibWeb: Use standardized encoding names, add encoding attribute to document 2020-11-14 10:14:03 +01:00
Luke
f3d2053bff LibTextCodec: Add a function to convert encodings to standardized names
https://encoding.spec.whatwg.org/#names-and-labels
2020-11-14 10:14:03 +01:00
Linus Groh
826096bac3 LibGUI: Make FileIconProvider aware of all supported image formats
By using Gfx::Bitmap::is_path_a_supported_image_format() we can
automatically provide the image icon for all supported image formats,
without keeping a second list of image file extensions.
2020-11-14 10:11:26 +01:00
Linus Groh
f0c2ee3c56 LibGUI: Add more extensions to FileIconProvider
This adds the following:

- cplusplus: .cxx, .cc, .c++
- header: .hpp, .hxx, .hh, .h++
- javascript: .mjs
2020-11-14 10:11:26 +01:00
Linus Groh
5b68ea8dde LibGfx: Make Bitmap path handling case insensitive
Bitmap::is_path_a_supported_image_format() and Bitmap::load_from_file()
now check the file extension with CaseSensitivity::CaseInsensitive.

This fixes a couple of inconsistencies, for example would
FileSystemModel::icon_for() recognize image files uppercase extensions
but couldn't create thumbnails for them (any attempt to create a bitmap
from such files would fail).
2020-11-14 10:11:26 +01:00
Linus Groh
d3ee3fc68a AK: Fix StringUtils::contains() case insensitive search
It would incorrectly return false if needle was at the end the string.
2020-11-14 10:11:26 +01:00
Linus Groh
b1754bf8f8 HackStudio: Use GUI::FileIconProvider::icon_for_path() for Locator icons
No need to duplicate file icon association logic as well as artificially
limiting the number of recognized file types.
2020-11-14 10:11:26 +01:00
Linus Groh
d773795195 HackStudio: Make Locator search case insensitive
Typing "make" should find "Makefile", for example. :^)
2020-11-14 10:11:26 +01:00
Nico Weber
39ce7251f7 Lagom: Use -fsanitize=fuzzer, not -fsanitize=fuzzer-no-link
Fuzzers don't link for me without this change.
2020-11-14 10:09:03 +01:00
Nico Weber
d775dea13c Lagom: Add a gemini fuzzer
Didn't find anything interesting, but might as well check it in.
2020-11-14 10:09:03 +01:00
Nico Weber
8ed83f9a1d Lagom: Augment fuzzing readme a bit
Recommend using asan, don't set the c compiler (c++ compiler is
sufficient), mention how to run on several cores, and how to get less
output.
2020-11-14 10:09:03 +01:00
Brendan Coles
664322d34b Userland: Add test-gfx-font for Gfx::Font tests 2020-11-14 10:08:25 +01:00
Andreas Kling
69518bd178 LibGfx: Fail PPM decode if there's not enough pixel data in the input
Fixes #3820.
2020-11-13 12:01:32 +01:00
Andreas Kling
f234b8c129 LibGfx: Add missing stream error handling in GIF frame descriptor parse
If we try to read a sentinel byte but the stream is fresh out of data,
we have to take care of the stream error and bail out right away, or
we'll hit an assertion when exiting the function soon after.

Fixes #3486.
2020-11-13 12:01:29 +01:00
Andreas Kling
c0aa455f76 LibGfx: Refuse to decode PNG images with geometry outside i32 bounds
Just fail the decode immediately when encountering an IHDR chunk with
width and/or height larger than the maximum i32 value.

Fixes #3818.
Fixes #3819.
2020-11-13 12:01:25 +01:00
Andreas Kling
ddc5ce1800 UserspaceEmulator: When auditing accesses, show nearest mallocation
Instead of always showing the preceding mallocation, prefer showing the
following one *if* it's closer to the audited address.

This makes it easier to find bugs where the access is just before an
allocation instead of just after it.
2020-11-13 11:05:46 +01:00
Andreas Kling
3a2727844c LibC: Adjust malloc size classes to ensure 8-byte aligned pointers
The pointers returned by malloc should always be 8-byte aligned on x86.
We were not consistent about this, as some ChunkedBlock size classes
were not divisible by 8.

This fixes some OOB reads found by running GCC in UE.
2020-11-13 11:05:46 +01:00
Andreas Kling
df3a70eac2 UserspaceEmulator: Support FCMOVBE and FCMOVNBE 2020-11-13 11:05:46 +01:00
Andreas Kling
ae81ced21c UserspaceEmulator: Emulate the sys$get_stack_bounds() syscall 2020-11-13 11:05:46 +01:00
Andreas Kling
04d9af79ac UserspaceEmulator: Initial FPU support (by @nico)
Start fleshing out basic support for floating-point instructions in the
UserspaceEmulator CPU.

This is all work done by @nico for #3576. I'm just merging it all in
this patch since it's a decent foundation to continue working on. :^)
2020-11-13 11:05:46 +01:00
Andreas Kling
cfc5d146d3 AK: Fix inverted condition in unsigned LEB128 decode 2020-11-13 11:05:46 +01:00
Luke
1993ccb456 LibWeb: Add default values of URL and content type in document
As per this line in the specification:
Unless stated otherwise, a document’s encoding is the utf-8 encoding,
content type is "application/xml", URL is "about:blank", origin is an
opaque origin, type is "xml", and its mode is "no-quirks".

https://dom.spec.whatwg.org/#document
2020-11-13 09:51:07 +01:00
Luke
dcb21b0c3a LibWeb: Add initial implementation of document.implementation 2020-11-13 09:51:07 +01:00
Luke
3ec54448f5 LibWeb: Add contentType attribute to Document 2020-11-13 09:51:07 +01:00
Ben Wiederhake
cf9419fc4f Meta: Nicer IRC notifications 2020-11-13 08:56:56 +01:00
Ben Wiederhake
90f55e607d Meta: Ensure availability of python 2020-11-13 08:56:56 +01:00
Nico Weber
5c2e8b6189 Lagom: Add ntpquery to lagom build 2020-11-12 21:21:33 +01:00
Andreas Kling
81add73955 LibWeb: Make Frame point weakly to Page
This patch makes Page weakable and allows page-less frames to exist.

Page is single-owner, and Frame is multiple-owner, so it's not sound
for Frame to assume its containing Page will stick around for its own
entire lifetime.

Fixes #3976.
2020-11-12 18:29:55 +01:00
Tom
e445ff670d Kernel: Implement an asynchronous device request stack
This allows issuing asynchronous requests for devices and waiting
on the completion of the request. The requests can cascade into
multiple sub-requests.

Since IRQs may complete at any time, if the current process is no
longer the same that started the process, we need to swich the
paging context before accessing user buffers.

Change the PATA driver to use this model.
2020-11-12 18:04:30 +01:00