Andreas Kling
e7512ae2d1
GFileSystemModel: Don't copy the null-terminator after readlink()
2020-01-28 10:52:10 +01:00
Andreas Kling
8131875da6
Kernel: Remove outdated comment in MemoryManager
...
Regions *do* zero-fill on demand now. :^)
2020-01-28 10:28:04 +01:00
Andreas Kling
c5db596c78
LibGUI: Fix crash when trying to scroll above the head of the document
...
We can't go higher than line 0. Can't rely on max() here since line
numbers are unsigned.
Fixes #1145 .
2020-01-27 22:59:46 +01:00
Andreas Kling
169a38113e
FileManager: Show symlink targets in status bar message
...
When a single item is selected and it happens to be a symlink pointing
somewhere, we now show where it points to in the status bar. :^)
There is a big ugly FIXME here about how DirectoryView has to work
around the fact that there's a GSortingProxyModel attached to the table
view widget.
2020-01-27 22:45:31 +01:00
Andreas Kling
f7b394af7d
LibGUI: Add symlink targets as a column in GFileSystemModel
...
Also make sure to hide this column by default where we don't expect
to see it.
2020-01-27 22:19:05 +01:00
Andreas Kling
fcb7f6f233
FileManager: Use stat() when activating a file/directory
...
This makes it possible to open symlinks to directories by activating
them (via double click, for example.) :^)
Fixes #21 .
2020-01-27 22:11:26 +01:00
Andreas Kling
f2f0965edd
LibGUI: Have GFileSystemModel use stat instead of lstat for the root
...
This allows you to set the GFileSystemModel root to a symlink to a
directory and it nicely opens that directory like you would expect.
2020-01-27 22:10:19 +01:00
Andreas Kling
c64904a483
Kernel: sys$readlink() should return the number of bytes written out
2020-01-27 21:50:51 +01:00
Andreas Kling
a7b984ec49
sleep: Use pledge()
2020-01-27 21:39:35 +01:00
Andreas Kling
8f6dc3e9a0
mknod: Use pledge()
2020-01-27 21:38:36 +01:00
Andreas Kling
8b49804895
Kernel: sys$waitpid() only needs the waitee thread in the stopped case
...
If the waitee process is dead, we don't need to inspect the thread.
This fixes an issue with sys$waitpid() failing before reap() since
dead processes will have no remaining threads alive.
2020-01-27 21:21:48 +01:00
Andreas Kling
f4302b58fb
Kernel: Remove SmapDisablers in sys$getsockname() and sys$getpeername()
...
Instead use the user/kernel copy helpers to only copy the minimum stuff
needed from to/from userspace.
Based on work started by Brian Gianforcaro.
2020-01-27 21:11:36 +01:00
Andreas Kling
7454926765
Shell: If a command process is stopped, print the stop signal to stderr
2020-01-27 20:48:42 +01:00
Andreas Kling
65961d3ffc
LibC: Add WSTOPSIG macro
...
This macro can be used on the "status" output from sys$waitpid() to
find out which signal caused the waitee process to stop.
Fixes #794 .
2020-01-27 20:47:56 +01:00
Andreas Kling
5163c5cc63
Kernel: Expose the signal that stopped a thread via sys$waitpid()
2020-01-27 20:47:10 +01:00
Andreas Kling
638fe6f84a
Kernel: Disable interrupts while looking into the thread table
...
There was a race window in a bunch of syscalls between calling
Thread::from_tid() and checking if the found thread was in the same
process as the calling thread.
If the found thread object was destroyed at that point, there was a
use-after-free that could be exploited by filling the kernel heap with
something that looked like a thread object.
2020-01-27 14:04:57 +01:00
Andreas Kling
17210a39e4
Kernel: Remove ancient hack that put the current PID in TSS.SS2
...
While I was bringing up multitasking, I put the current PID in the SS2
(ring 2 stack segment) slot of the TSS. This was so I could see which
PID was currently running when just inspecting the CPU state.
2020-01-27 13:10:24 +01:00
Andreas Kling
ae0f92a0a1
Kernel: Simplify kernel thread stack allocation
...
We had two identical code paths doing this for some reason.
2020-01-27 12:52:45 +01:00
Andreas Kling
c1f74bf327
Kernel: Never validate access to the kmalloc memory range
...
Memory validation is used to verify that user syscalls are allowed to
access a given memory range. Ring 0 threads never make syscalls, and
so will never end up in validation anyway.
The reason we were allowing kmalloc memory accesses is because kernel
thread stacks used to be allocated in kmalloc memory. Since that's no
longer the case, we can stop making exceptions for kmalloc in the
validation code.
2020-01-27 12:43:21 +01:00
Andreas Kling
23ffd6c319
Kernel+LibC+Userland: Switch to 64-bit time_t
...
Let's not have that 2038 problem people are talking about. :^)
2020-01-27 10:59:29 +01:00
Andreas Kling
6906edee9a
LibGUI: Add 64-bit signed integer support to GVariant
...
What was previously the "Int" type is now "Int32" and "Int64".
2020-01-27 10:55:10 +01:00
Andreas Kling
137a45dff2
Kernel: read()/write() should respect timeouts when used on a sockets
...
Move timeout management to the ReadBlocker and WriteBlocker classes.
Also get rid of the specialized ReceiveBlocker since it no longer does
anything that ReadBlocker can't do.
2020-01-26 17:54:23 +01:00
Andreas Kling
d1721c761e
LookupServer: Don't cache already-expired DNS answers
2020-01-26 16:25:12 +01:00
Linus Groh
174583cda5
LibVT: Add parameter names in function signatures for clarity
2020-01-26 15:58:06 +01:00
Linus Groh
3549623dc6
LibVT: Rename escape$r to DECSTBM (Set Top and Bottom Margins)
2020-01-26 15:58:06 +01:00
Linus Groh
79f88db6fb
LibVT: Remove empty line
2020-01-26 15:58:06 +01:00
Linus Groh
fd8c250866
LibVT: Replace escape$h_l with SM (Set Mode) / RM (Reset Mode)
2020-01-26 15:58:06 +01:00
Linus Groh
be57b81336
LibVT: Rename escape$f to HVP (Horizontal and Vertical Position)
2020-01-26 15:58:06 +01:00
Linus Groh
2edd8e37ae
LibVT: Rename escape$c to DA (Device Attributes)
2020-01-26 15:58:06 +01:00
Linus Groh
dcb5bf9e50
LibVT: Rename escape$m to SGR (Select Graphic Rendition)
2020-01-26 15:58:06 +01:00
Linus Groh
296afbe624
LibVT: Rename escape$H to CUP (Cursor Position)
2020-01-26 15:58:06 +01:00
Linus Groh
5cdfc58242
LibVT: Rename escape$D to CUB (Cursor Backward)
2020-01-26 15:58:06 +01:00
Linus Groh
428a55a196
LibVT: Rename escape$C to CUF (Cursor Forward)
2020-01-26 15:58:06 +01:00
Linus Groh
35310dbd22
LibVT: Rename escape$B to CUD (Cursor Down)
2020-01-26 15:58:06 +01:00
Linus Groh
cc73284c64
LibVT: Rename escape$A to CUU (Cursor Up)
2020-01-26 15:58:06 +01:00
Andreas Kling
5e47508672
LookupServer: Cache DNS answers for TTL seconds
...
We now keep DNS answers around in a cache for TTL seconds after getting
them the first time. The cache is capped at 256 responses for now.
Suggested by @zecke in #10 .
2020-01-26 15:44:51 +01:00
Andreas Kling
90a5907b44
LookupServer: Rename "custom_hosts" => "etc_hosts"
...
This makes it more obvious that these mappings come from /etc/hosts.
2020-01-26 15:44:51 +01:00
Andreas Kling
c26560ec26
LookupServer: Rename setting "DNS/IPAddress" => "DNS/Nameserver"
2020-01-26 15:44:51 +01:00
MWGuy
0c544052a5
Ports+OpenSSL: Fix RAND_poll patch
2020-01-26 15:27:12 +01:00
Andreas Kling
e335d730d6
LookupServer: Use CUdpSocket instead of the POSIX API
...
LibCore's UDP socket is a bit more comfortable to work with. :^)
2020-01-26 14:47:03 +01:00
Andreas Kling
3c129172d4
LibCore: Add UDP socket and server classes
2020-01-26 14:45:07 +01:00
Andreas Kling
2ce9a705e3
IPv4: Mark UDP sockets as connected immediately upon connect()
...
This makes it possible to write() to a blocking UDPSocket. Previously
this was not possible since can_write() depends on is_connected().
2020-01-26 14:43:08 +01:00
Andreas Kling
388d40d755
IPv4: Fix bitrot in IPv4Socket debug logging
2020-01-26 14:42:44 +01:00
Andreas Kling
8e7e502f37
LibCore: CSocket::set_blocking() was backwards
2020-01-26 14:29:33 +01:00
Andreas Kling
537a1d31c5
LookupServer: Add missing copyright headers
2020-01-26 13:53:36 +01:00
Andreas Kling
a9ec2225a5
LookupServer: Retry with 0x20 randomization turned off on EREFUSED
...
Apparently some authoritative servers don't handle 0x20 randomization
well and may send EREFUSED. Retry with randomization turned off then.
Reference: https://github.com/dns-violations/dns-violations/blob/master/2017/DVE-2017-0006.md
More work towards #10 .
2020-01-26 13:49:46 +01:00
Andreas Kling
00be9b33b1
LookupServer: Verify that DNS response questions match the request
...
To protect against DNS spoof attacks, we now check that the questions
in incoming responses match the questions in the request we sent out.
Suggested by @zecke in #10 .
2020-01-26 13:07:43 +01:00
Andreas Kling
b4d55b16b6
LookupServer: Randomize the 0x20 bit in DNS request ASCII characters
...
This adds a bit of extra entropy to DNS requests, making it harder to
spoof a valid response.
Suggested by @zecke in #10 .
2020-01-26 13:07:21 +01:00
Andreas Kling
02be23cf81
LookupServer: Randomize DNS request ID's
...
Suggested by @zecke in #10 .
2020-01-26 12:38:49 +01:00
Andreas Kling
871b6b4e1a
LookupServer: Minor overhaul
...
- Break out request building into a DNSRequest class.
- Break out response parsing into a DNSResponse class.
A DNSRequest contains one or more DNSQuestion objects.
A DNSResponse contains all the DNSQuestions asked, and a DNSAnswer
object for each answer.
2020-01-26 12:37:08 +01:00