Commit Graph

16727 Commits

Author SHA1 Message Date
AnotherTest
5204c9062c Shell: Make history index values not fitting in i32 a syntax error
A continuation of e3ec759.
Also found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30405
2021-02-07 13:12:56 +01:00
DragonAlex98
885974fc3c
WindowServer: Don't close menu when clicking on item with submenu (#5239)
When clicking on a menu item with a submenu, don't close the menu.
2021-02-07 12:28:42 +01:00
Brian Gianforcaro
d107cabf5d Ports: Fix linking of the stress-ng port 2021-02-07 12:16:37 +01:00
Andreas Kling
0eac44af49 LibWeb: Don't assert on <colgroup> & friends
Let's just construct a placeholder BlockBox layout node for now.

Fixes #5081.
2021-02-07 11:47:33 +01:00
Andreas Kling
796c31a52b LibWeb: Reorganize Element::create_layout_node() into a switch
This allows us to see which CSS::Display types are not yet handled.
2021-02-07 11:40:42 +01:00
Andreas Kling
e6712fcd82 LibWeb: Use any_of() for DOM::Element::has_class() 2021-02-07 11:35:26 +01:00
Andreas Kling
7c6de80e81 AK: Publish AK::any_of by default 2021-02-07 11:35:08 +01:00
Andreas Kling
330c3fcb59 LibWeb: Use move semantics for QualifiedName more often 2021-02-07 11:20:15 +01:00
Andreas Kling
10420dee7e LibGfx: Fix global-buffer-overflow in interlaced GIF decode
Regressed with 57e10eadac and immediately
caught by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30507
2021-02-07 11:18:55 +01:00
Andreas Kling
0c66e53544 LibWeb: Honor font sizes specified by CSS
Instead of trying to coerce them into some font size we think we might
have, let's just honor the request and do our best to find a font.
2021-02-07 10:57:07 +01:00
Andreas Kling
3620a6e054 LibJS: Function must mark its home object 2021-02-07 10:57:07 +01:00
Brian Gianforcaro
c95d48c8d6 Kernel: KUBSAN implementation of returns-nonnull-attribute
This didn't find anything in the current source.
2021-02-07 10:22:03 +01:00
Andreas Kling
57e10eadac LibGfx: Don't reject valid GIF animations with interlaced frames
We were returning early from the deinterlacing loop after the very last
pass, but we should just let the outer loop finish and return instead.

This makes the Netscape animation on https://timmorgan.dev work. :^)
2021-02-07 01:21:42 +01:00
Linus Groh
dff808d087 Base: Remove /res/pci.ids and download at build time instead
This is an external file from https://pci-ids.ucw.cz that's being updated
daily, which was imported a while ago but probably shouldn't live in the
SerenityOS repository in the first place (or else would need manual
maintenance). The legal aspects of redistributing this file as we
currently do are not quite clear to me, they require either GPL (version
2 or later) or 3-clause BSD - Serenity is 2-clause BSD...

The current version we use is 2019.08.08, so quite outdated - and while
most of these devices are obviously not supported, we're still capable
of *listing* them, so having an up-to-date version with recent additions
and fixes would be nice.

This updates the root CMakeLists.txt to check for existence of the file
and download it if not found - effectively on every fresh build. Do note
that this is not a critical file, and the system runs just fine should
this ever fail. :^)
2021-02-07 01:14:36 +01:00
Andreas Kling
ce1c8e0bde LibWeb: Anonymous table cells should have colspan=1
Otherwise the column widths calculation algorithm will assert.

Fixes #5078.
2021-02-06 23:27:03 +01:00
Andreas Kling
89483a9408 UserspaceEmulator: Implement a proper VM allocator
This patch brings Kernel::RangeAllocator to UserspaceEmulator in a
slightly simplified form.

It supports the basic three allocation types needed by virt$mmap():
allocate_anywhere, allocate_specific, and allocate_randomized.

Porting virt$mmap() and virt$munmap() to use the allocator makes
UE work correctly once again. :^)
2021-02-06 23:15:44 +01:00
Andreas Kling
9dacd7c0ec UserspaceEmulator: Stub out virt$msyscall()
This is a no-op inside UE for now.
2021-02-06 23:15:44 +01:00
William Bowling
b97d23a71f
Kernel: Use the resolved parent path when testing create veil (#5231) 2021-02-06 19:11:44 +01:00
Sergey Bugaev
1dad63824b LookupServer: Unify DNSRequest & DNSResponse
They're really the same thing: a DNS packet can contain both questions and
answers, and there's a single bit in the header that determines whether the
packet represents a query or a response. It'll be simpler for us to represent
both types of packets using the same class.

This class can be both serialized and deserialized to/from a raw DNS packet.
2021-02-06 17:52:47 +01:00
Sergey Bugaev
e3135e7ca5 LookupServer: Rename DNSPacket -> DNSPacketHeader
This is a more appropriate name for what the class represents, and we'll be
reusing the name DNSPacket for something different soon.
2021-02-06 17:52:47 +01:00
Sergey Bugaev
d8967e4dff LookupServer+LibC: Pass IP addresses in binary
Now that we no longer depend on the textual IPC format, we can pass IP addresses
in the format most code actually has and needs it: in binary. The only places we
actually have to deal with textual address representation is:

* When reading /etc/hosts, we have to parse textual addresses & convert them to
  binary;
* When doing reverse lookups, we have to form a pseudo-hostname of the form
  x.x.x.x.in-addr.arpa.

So we do the conversion in those two cases.

This also increases uniformity between how we handle A (IPv4 address) and other
resource record types. Namely, we now store the raw binary data as received from
a DNS server.
2021-02-06 17:52:47 +01:00
Andreas Kling
04ff46bff4 Kernel: And some more KUBSAN checks :^)
Here comes a few more:

* enum
* object-size
* vptr
2021-02-06 17:39:49 +01:00
Andreas Kling
fad0332898 Kernel: Implement some more KUBSAN checks :^)
This patch enables the following -fsanitize sub-options:

* bounds
* bounds-strict
* integer-divide-by-zero
* return
* shift
* shift-base
* shift-exponent
2021-02-06 17:39:49 +01:00
Sergey Bugaev
547130584c LookupServer: Switch to LibIPC :^)
The ad-hoc IPC we were doing with LookupServer was kinda gross. With this,
LookupServer is a regular IPC server. In the future, we want to add more APIs
for LookupServer to talk to its clients (such as DHCPClient telling LookupServer
about the DNS server discovered via DHCP, and DNS-SD client browsing for
services), which calls for a more expressive IPC format; this is what LibIPC is
perfect for.

While the LookupServer side is using the regular LibIPC mechanics and patterns,
the LibC side has to hand-roll LibIPC format serialization without actually
using LibIPC. We might be able to get rid of this in the future, but for now it
has to be like that. The good news is the format is not that bad at all.
2021-02-06 16:12:18 +01:00
Sergey Bugaev
314f966745 LookupServer: Move into LookupServer namespace 2021-02-06 16:12:18 +01:00
Sahan Fernando
7e9122950e Profiler: Display timing information in ProfileTimelineWidget
Currently, there is no way to know when in a profile's duration a
sample was taken. This commit adds a basic timestamp to the timeline
widget, and a black bar to show where the cursor is hovering over.
2021-02-06 08:55:34 +01:00
jarhill0
ff3ae331f7 Documentation: Clarify macOS build instructions
I just ran through successfully building and running SerenityOS under
macOS. I ran into two main things that I struggled with, which were
- properly enabling osxfuse (through System Preferences)
- running the suggested command about compiler versions in such a way
  that would be compatible with Ninja (as it turns out, I just needed
  to add `-G Ninja` to the command)
This commit clarifies those things for anyone who may follow
2021-02-06 08:51:45 +01:00
Andreas Kling
930e3ce00d Kernel: Don't left-shift 1 (signed) 31 times
Found by KUBSAN :^)
2021-02-05 21:28:06 +01:00
Andreas Kling
4c0707e56c Kernel: Don't create a zero-length VLA in Ext2FS block list walk
Found by KUBSAN :^)
2021-02-05 21:23:11 +01:00
Andreas Kling
d164f89ada Kenrel: Implement two more KUBSAN checks
This patch adds the following UndefinedBehaviorSanitizer sub-options:

* signed-integer-overflow
* vla-bound
2021-02-05 21:23:11 +01:00
Andreas Kling
8e7ad28a33 AK: Avoid UB in TypedTransfer
Don't be calling __builtin_memfoo() with null pointer arguments.

Found by KUBSAN :^)
2021-02-05 21:23:11 +01:00
Andreas Kling
f4eb1f261f Kernel: Add missing initializer for SharedIRQHandler::m_enabled
Found by KUBSAN :^)
2021-02-05 21:23:11 +01:00
Andreas Kling
d44be96893 Kernel: KUBSAN! (Kernel Undefined Behavior SANitizer) :^)
We now build the kernel with partial UBSAN support.
The following -fsanitize sub-options are enabled:

* nonnull-attribute
* bool

If the kernel detects UB at runtime, it will now print a debug message
with a stack trace. This is very cool! I'm leaving it on by default for
now, but we'll probably have to re-evaluate this as more options are
enabled and slowdown increases.
2021-02-05 21:23:11 +01:00
Andreas Kling
7df3b95126 LibJS: GlobalObject must mark builtin prototypes
Failing to mark them leads to use-after-free since the GlobalObject
cached prototypes are used for new NumberObject, StringObject, etc.

Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30319
2021-02-05 14:53:16 +01:00
Andreas Kling
0269578d3e LibM: Implement nextafter() and nexttoward()
Patch from Anonymous.
2021-02-05 12:27:23 +01:00
Andreas Kling
e87eac9273 Userland: Add LibSystem and funnel all syscalls through it
This achieves two things:

- Programs can now intentionally perform arbitrary syscalls by calling
  syscall(). This allows us to work on things like syscall fuzzing.

- It restricts the ability of userspace to make syscalls to a single
  4KB page of code. In order to call the kernel directly, an attacker
  must now locate this page and call through it.
2021-02-05 12:23:39 +01:00
Andreas Kling
4df3a34bc2 LibELF: Only set up PLT trampoline for objects with a PLT 2021-02-05 12:10:45 +01:00
Andreas Kling
9d471ea923 LibM: Build and install the LibM test
This test seems to be full of wrong, but at least now we build it and
place it in /usr/Tests/LibM/ so that we can fix it.
2021-02-05 09:50:08 +01:00
Andreas Kling
16a0e7a66d LibJS: Improve correctness of rounding and bitwise operations
Patch from Anonymous
2021-02-05 09:38:45 +01:00
Andreas Kling
6622ad8895 LibM: Improve accuracy of rounding related functions
Patch from Anonymous.
2021-02-05 09:38:45 +01:00
Jean-Baptiste Boric
edd2362f39 Kernel: Add NE2000 network card driver
Remember, friends don't let friends use NE2000 network cards :^)
2021-02-05 09:35:02 +01:00
Liav A
865aade42b Kernel: Clear pending interrupts before enabling IRQs of IDE Channel
Calling detect_disks() can generate interrupts, so we must clear it to
allow proper function when booting with kernel argument smp=on.
2021-02-05 09:10:37 +01:00
Liav A
f2faf11d61 Kernel: Try to detect Sound Blaster 16 before creating an instance
We shouldn't create a SB16 instance without checking if the Sound
Blaster 16 card is actually installed in the system.
2021-02-05 08:54:02 +01:00
Andreas Kling
5bb35da784 bt: Hyperlink filenames in backtraces if available :^)
If we can find a matching filename in /usr/src/serenity, let's make the
filenames in backtraces clickable to open that file.
2021-02-05 00:56:00 +01:00
Andreas Kling
a883784376 bt: Show filenames and line numbers when available :^) 2021-02-05 00:25:05 +01:00
Andreas Kling
a4e087e685 SymbolServer: Resolve filenames and line numbers from debug info :^)
This makes symbolication take a little longer the first time we load a
shared library, but then the cache keeps it warm.
2021-02-05 00:23:58 +01:00
Andreas Kling
72f96941f2 SymbolServer: Cache failed ELF loads as well
Remember which paths we've already tried to load. This stops it from
whining about /boot/Kernel not being mappable.
2021-02-04 23:44:01 +01:00
Andreas Kling
acabc37c24 SymbolServer+LibSymbolClient: Just do one symbol per IPC message
I originally wanted to batch the symbolication requests but that just
makes the client logic significantly more complicated with no real
benefit other than architectural feelgood points.
2021-02-04 23:35:10 +01:00
Andreas Kling
5dd555fe2f SystemMonitor: Use SymbolServer to symbolicate thread stacks 2021-02-04 23:20:39 +01:00
Andreas Kling
b7d16e3496 LibSymbolClient+bt: Move bt logic to SymbolClient::symbolicate_thread()
Since this is useful in many places, let's have a common implementation
of walking the stack of a given thread via /proc and symbolicating each
of the frames.
2021-02-04 23:20:39 +01:00