Commit Graph

16934 Commits

Author SHA1 Message Date
belginul
4f80bb6ce3 DisplaySettings: Show revert dialog only for resolution/dpi changes. 2021-02-19 12:19:03 +01:00
jonno85uk
a4d4571522 Ports: Add libjpeg 9d 2021-02-19 12:18:46 +01:00
Andreas Kling
6e83be67b8 Kernel: Release ptrace lock in exec before stopping due to PT_TRACE_ME
If we have a tracer process waiting for us to exec, we need to release
the ptrace lock before stopping ourselves, since otherwise the tracer
will block forever on the lock.

Fixes #5409.
2021-02-19 12:13:54 +01:00
Andreas Kling
37d8faf1b4 ProcFS: Fix /proc/PID/* hardening bypass
This enabled trivial ASLR bypass for non-dumpable programs by simply
opening /proc/PID/vm before exec'ing.

We now hold the target process's ptrace lock across the refresh/write
operations, and deny access if the process is non-dumpable. The lock
is necessary to prevent a TOCTOU race on Process::is_dumpable() while
the target is exec'ing.

Fixes #5270.
2021-02-19 09:46:36 +01:00
Andreas Kling
7142562310 Everywhere: Build with -fstack-clash-protection
This option causes GCC to generate code to prevent "stack clash" style
attacks where a very large stack allocation is used in to jump over the
stack guard page and into whatever's next to it.
2021-02-19 09:12:30 +01:00
Andreas Kling
1e6d04c746 LibC: Remove text relocation
Tweak the PLT trampoline to avoid generating textrels in LibC.
This allows us to share all the LibC mappings, reducing per-process
memory consumption by ~200 KB. :^)

Patch originally by @nico.
2021-02-19 09:04:05 +01:00
Andreas Kling
713b3b36be DynamicLoader+Userland: Enable RELRO for shared libraries as well :^)
To support this, I had to reorganize the "load_elf" function into two
passes. First we map all the dynamic objects, to get their symbols
into the global lookup table. Then we link all the dynamic objects.

So many read-only GOT's! :^)
2021-02-19 00:03:03 +01:00
Andreas Kling
fa4c249425 LibELF+Userland: Enable RELRO for all userland executables :^)
The dynamic loader will now mark RELRO segments read-only after
performing relocations. This is pretty cool!

Note that this only applies to main executables so far,.
RELRO support for shared libraries will require some reorganizing
of the dynamic loader.
2021-02-18 18:55:19 +01:00
Andreas Kling
0d3866e84c DynamicLoader: Some ELF data segments were allocated too small
For a data segment that starts at a non-zero offset into a 4KB page and
crosses a 4KB page boundary, we were failing to pad the VM allocation,
which would cause the memcpy() to fail.

Make sure we round the segment bases down, and segment ends up, and the
issue goes away.
2021-02-18 18:14:59 +01:00
Andreas Kling
eb92ec3149 Kernel: Factor out mmap & friends range expansion to a helper function
sys$mmap() and related syscalls must pad to the nearest page boundary
below the base address *and* above the end address of the specified
range. Since we have to do this in many places, let's make a helper.
2021-02-18 18:04:58 +01:00
Brendan Coles
44aeab43a0 Chess: Allow right click to cancel drag move while dragging a piece 2021-02-18 12:52:11 +01:00
Andreas Kling
c2c7c7368b Website: Add @cees-elzinga's ptrace race + ASLR bypass to bounty page 2021-02-18 12:51:13 +01:00
Brendan Coles
a11c065e82 Chess: pledge thread
`thread` is required by the file browse dialog
when importing or exporting PGN files.
2021-02-18 10:23:08 +01:00
Andreas Kling
55a9a4f57a Kernel: Use KResult a bit more in sys$execve() 2021-02-18 09:37:33 +01:00
Linus Groh
edec5e29a3 LibC: Remove serenity.h.rej 2021-02-18 09:23:11 +01:00
Brendan Coles
0f084e0531 LibChess: SetOptionCommand: Set provided option name and value 2021-02-18 08:00:02 +01:00
Tom
06ee8c5aa8 WindowServer: Ignore other button presses while moving/resizing windows
Fixes #5334
2021-02-18 07:45:44 +01:00
Tom
6af4d35e8e WindowServer: Apply the backing bitmap's scale when alpha hit-testing
Fixes #5390
2021-02-18 07:45:22 +01:00
Linus Groh
b55c9f6bba Conway: Set minumum window size to game columns x rows
The game renders no cells when the game widget height is < rows or width
is < columns, so let's set a minimum window size here.
2021-02-18 07:34:47 +01:00
Breno Silva
cfb0f3309d LibJS: Implement tests for Array.prototype.flat 2021-02-18 00:22:45 +01:00
Kesse Jones
3940635ed3 LibJS: Implement Array.prototype.flat 2021-02-18 00:22:45 +01:00
jonno85uk
83d880180e
LibC: Use "static inline" for inline functions in arpa/inet.h (#5392)
This makes it work when compiling as C.
2021-02-18 00:02:47 +01:00
Andreas Kling
8aec1cd232 LibTTF: ScaledFont should have a NonnullRefPtr<TTF::Font>
A ScaledFont without an underlying TTF::Font would not be valid.
2021-02-17 23:45:21 +01:00
Linus Groh
13867600c3 LibWeb: Add constructor to XMLHttpRequest IDL interface 2021-02-17 23:45:07 +01:00
Linus Groh
8f8f7bfd0f LibWeb: Add constructor to Range IDL interface 2021-02-17 23:45:07 +01:00
Linus Groh
0ac07c7351 LibWeb: Add constructor to Event IDL interface 2021-02-17 23:45:07 +01:00
Linus Groh
0f1da7d40c LibWeb: Add constructor to Document IDL interface 2021-02-17 23:45:07 +01:00
Linus Groh
8c7d1986b8 LibWeb: Actually construct impl and wrapper in construct() :^)
FooConstructor::construct() is no longer a dummy but now generates
either code to throw an exception (for interfaces without constructor)
or code to construct the wrapper and its impl object.

Constructor overloads are not currenly handled, but that's not something
we need right now anyway. Instead of  regular create() this uses a new
static function create_with_global_object() and passes the WindowObject,
which may be needed - e.g. for XMLHttpRequest, which has an IDL and
JavaScript constructor with no arguments, but needs a DOM::Window in its
create().
2021-02-17 23:45:07 +01:00
Linus Groh
e3577f871b LibWeb: Parse IDL interface constructors
WrapperGenerator will now parse and store IDL interface constructors,
including parameters and overloads.
See https://heycam.github.io/webidl/#idl-constructors.
2021-02-17 23:45:07 +01:00
Linus Groh
ff324fe989 LibWeb: Fix .length of functions generated from IDL
Function::length() is computing the right function length based on its
parameters, but we never called it - instead the *function name length*
was being used, which is obviously wrong. How silly! :^)
2021-02-17 23:45:07 +01:00
Marcel Hernandez
b07799060f
Ports: Add tinyscheme 1.42 (#5387) 2021-02-17 23:07:34 +01:00
Nick Vella
bafb8b0be6 Run: Store and present recent Run command history in a ComboBox.
We now store the last 25 inputs ran in Run in a simple text file under
.config (~/.config/RunHistory.txt)
2021-02-17 23:06:19 +01:00
Nick Vella
05914d2e9a LibGUI: Correctly handle ComboBox list windows of less than three items (~50px) in height.
By default, a Window has a minimum size of 50x50 - ComboBox lists aren't
always this tall. We now set the minimum height of the ComboBox Window
according to the height of three items, or the total height of all the
items in the list, whichever is smaller.
This means there is no longer any unpainted space in the list window
due to the shortfall between the ListBox widget and Window heights,
and the ComboBox list window always remains a comfortable height for
viewing. :^)
2021-02-17 23:06:19 +01:00
jonno85uk
2d1cfa7d11
Ports: Add bison 1.25 (#5382)
bison -h works. Not tried with any grammar files
2021-02-17 22:54:37 +01:00
jonno85uk
6e1117a688
Ports: Add libtiff (#5383) 2021-02-17 22:54:04 +01:00
Linus Groh
fe266e03b6 PixelPaint: Open image file passed as argument
This is obviously a requirement for #5374, oops :^)

Also handle errors gracefully, opening a file that isn't PixelPaint JSON
would previously crash.

Closes #5388.
2021-02-17 19:39:37 +01:00
Andreas Kling
c4438d6fd4 WindowServer: Unbreak "pick new active window" algorithm
We lost the ability to pick a suitable new active window when I added
the support for tool windows.
2021-02-17 16:52:08 +01:00
Andreas Kling
6c2f0316d9 Kernel: Convert snprintf() => String::formatted()/number() 2021-02-17 16:37:11 +01:00
Andreas Kling
5f610417d0 Kernel: Remove kprintf()
There are no remaining users of this API.
2021-02-17 16:33:43 +01:00
Andreas Kling
40e5210036 Kernel: Convert dbgprintf()/klog() => dbgln()/dmesgln() in UHCI code 2021-02-17 16:30:55 +01:00
Andreas Kling
e4d84b5e79 Kernel: Remove dbgprintf() from kernel
There are no remaining users of this API in the kernel.
2021-02-17 16:22:34 +01:00
Andreas Kling
d9bf4b4d41 Shell: Convert dbgprintf() => dbgln() 2021-02-17 16:18:53 +01:00
Andreas Kling
2d64ba7b9d LibWeb: Convert dbgprintf() => dbgln() 2021-02-17 15:59:13 +01:00
Andreas Kling
1a4136c4ac PreprocessorTest: Convert dbgprintf() => dbgln() 2021-02-17 15:50:34 +01:00
Andreas Kling
403b34d38e LibC: Convert dbgprintf() => dbgln() in SSP handler 2021-02-17 15:48:55 +01:00
Andreas Kling
304f0fe5ee LibGUI: Convert dbgprintf() => dbgln() 2021-02-17 15:47:00 +01:00
Andreas Kling
25a69d2b18 LibPthread: Convert dbgprintf() => dbgln_if() 2021-02-17 15:46:21 +01:00
Andreas Kling
c1dd5553a8 LibCore: Convert dbgprintf() => dbgln() 2021-02-17 15:40:52 +01:00
Andreas Kling
dffab4e034 LibC: Convert dbgprintf() => dbgln() 2021-02-17 15:39:32 +01:00
Andreas Kling
5a595ef134 Kernel: Use dbgln_if() in sys$fork() 2021-02-17 15:34:32 +01:00