Commit Graph

830 Commits

Author SHA1 Message Date
49d1e4f011
Revert "mprotect(): Validate the entire range to protect is in userspace memory"
This reverts commit 4ef764e62e.
2023-01-08 15:41:53 +01:00
401a807551
Revert "Update README.md"
This reverts commit 1f4c4f1a0c.
2023-01-08 15:41:39 +01:00
4ef764e62e
mprotect(): Validate the entire range to protect is in userspace memory
Before this patch, sys_mprotect() only validated the starting address.
This was as bad as it sounds, in fact it let me write a fun exploit
using it.
Now, this exploit is no longer possible.

This patch is probably not relevant, since this branch will be gone in
the future, as soon as restart gets merged into main.
I made it anyways :^)
2023-01-02 11:51:08 +01:00
1f4c4f1a0c Update README.md 2022-12-03 17:49:42 +01:00
37fe95b128 Remove FIXME 2022-11-12 18:15:32 +01:00
000ffd1fae Scheduler: Handle weird cases when the task we're iterating on is null 2022-11-12 18:12:42 +01:00
37bb3273ce Kernel: Add a C interface to the logging system 2022-11-12 18:12:18 +01:00
511bb7a8c1 Kernel: Make readdir() available in created InitRD directories 2022-11-12 18:11:58 +01:00
bde9a97db5 sh: Add a sleep command 2022-11-12 17:44:13 +01:00
fa325072ac Kernel: Add __cxa_atexit and __cxa_finalize 2022-11-12 17:43:57 +01:00
e54f033578 libc: Add wcslen (with a test) and wcscat 2022-11-12 14:16:00 +01:00
35829a6998 libc: Remove unnecessary casts in strcat() and strncat() 2022-11-12 14:15:38 +01:00
6ab246a05e libc: Add a basic implementation of pathconf() 2022-11-12 14:15:21 +01:00
9e8a57cec7 libc: Add getdtablesize()
No system call for this, since the limit is fixed right now
2022-11-12 14:15:02 +01:00
f46831f459 libc: Define PATH_MAX
This restriction is actually not enforced by the kernel. It should be.
2022-11-12 14:13:28 +01:00
5fa8569ff9 libc: Add creat() 2022-11-12 14:12:49 +01:00
a3896c2546 libc: Define MB_CUR_MAX 2022-11-12 13:24:04 +01:00
3f867b936e libc: Implement stpcpy
This function is unsafe so it is marked as deprecated, but if programs need it they can use it.
2022-11-12 13:20:28 +01:00
16e6fba2d0 Add a bit more C++ stuff to the C++ app 2022-11-12 13:12:51 +01:00
de2451e553 Kernel: Change up the logging in the kernel's PRNG 2022-11-12 12:56:13 +01:00
11ee01f269 Kernel: Remove "checkpoint logging" in main.cpp 2022-11-12 12:55:47 +01:00
bf1d3d3f05 mkdir: Print newline after usage 2022-11-12 12:53:33 +01:00
5c51b82f6a Kernel: Remove obtain_user_ref and add copy_typed_to and from_user 2022-11-12 12:08:26 +01:00
58fb422161 Kernel: Return a Result in MemoryManager and strdup_from_user 2022-11-12 11:56:40 +01:00
662afad426 Kernel: Add a Result class 2022-11-12 11:30:28 +01:00
a3465c2f5e tools: Make buildstep exit on error 2022-11-12 11:30:17 +01:00
559d074ce4 Kernel: Make a more convenient wrapper for basename() and dirname() 2022-11-12 10:39:25 +01:00
5a1d15d2b5 Show only short names of apps when installing 2022-11-10 17:55:41 +01:00
4aa3bd3107 Next version! 2022-11-09 17:25:05 +01:00
da41784183 Fix setup-gcc.sh 2022-11-09 17:15:02 +01:00
b8014a158c ports: Add a port of the GNU binutils =D
what a coincidence!! this big achievement is the 800th commit!!
2022-11-09 16:59:27 +01:00
2ac98ed0c1 libc: Define wint_t in wchar.h 2022-11-09 16:29:33 +01:00
078f3f5862 Kernel: Add a remainder to refactor the initial ramdisk code 2022-11-09 16:07:49 +01:00
d76af10e70 Kernel: Move initrd into the fs/ folder
It makes more sense to put it in there.
2022-11-09 16:03:16 +01:00
60bd8d9418 Kernel: Add an explanatory comment to the end of _start() 2022-11-09 15:58:00 +01:00
1ea216dfd1 Kernel: Rename assert.h to ensure.h
The macro is named "ensure", the header file should reflect that.
2022-11-09 15:28:35 +01:00
da7ad8da5b Kernel: Show the file location when a check fails 2022-11-09 15:23:59 +01:00
ea94b331fb Scheduler: Use copy_to_user in a few system calls 2022-11-09 15:20:53 +01:00
46e4d37098 toolchain: build libstdc++ without exceptions, just in case 2022-11-09 12:09:56 +01:00
d1dea3f1d6 apps: Add support for C++ apps alongside C ones 2022-11-09 12:01:48 +01:00
b6f2b41f1f Toolchain: Build libstdc++ just after gcc and libgcc
This means... C++ userland programs!!
Some parts of the standard library still have weird behavior. For example, do not try to use std::cout. That page-faults.
2022-11-09 11:56:08 +01:00
61753a6f51 libc: Symlink libm.a to libc.a
Some programs (or g++) might want to link against libm, yet on Luna it's part of libc.
2022-11-09 11:39:39 +01:00
57ef8feddb libc: Add __cxa_atexit and __cxa_finalize
To support a C++ implementation :)
2022-11-09 11:38:40 +01:00
0bfe5e27ef libc: Add localeconv()
Always returns the default C locale values.
2022-11-09 11:38:14 +01:00
d3030d2111 libc: Stub out strtod() 2022-11-09 11:37:52 +01:00
da4c0d5184 libc: Stub out strtok() 2022-11-09 11:37:41 +01:00
f8f5968753 libc: Define EOVERFLOW and make every dummy errno value unique 2022-11-09 11:37:32 +01:00
1300b8f5ee libc: Add stubs for signal() and raise() 2022-11-09 11:37:08 +01:00
bbc7a7338c libc: Add fpclassify 2022-11-09 11:36:52 +01:00
59e03d0799 libc: Add DT_* macros to dirent.h 2022-11-09 11:36:41 +01:00