summaryrefslogtreecommitdiff
path: root/Userland/DevTools/UserspaceEmulator
AgeCommit message (Collapse)Author
2021-02-26Everywhere: Remove a bunch of redundant 'AK::' namespace prefixesLinus Groh
This is basically just for consistency, it's quite strange to see multiple AK container types next to each other, some with and some without the namespace prefix - we're 'using AK::Foo;' a lot and should leverage that. :^)
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-23UserspaceEmulator: Fix an outln() format bugAnotherTest
2021-02-14Kernel+Userland: Give sys$recvfd() an options argument for O_CLOEXECAndreas Kling
@bugaevc pointed out that we shouldn't be setting this flag in userspace, and he's right of course.
2021-02-08UserspaceEmulator: Use vdbgln() instead of dbgln() when reportingAnotherTest
This will avoid conflict with the upcoming compiletime checks.
2021-02-06UserspaceEmulator: Implement a proper VM allocatorAndreas Kling
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-06UserspaceEmulator: Stub out virt$msyscall()Andreas Kling
This is a no-op inside UE for now.
2021-02-05Userland: Add LibSystem and funnel all syscalls through itAndreas Kling
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-01-25Everywhere: Hook up remaining debug macros to Debug.h.asynts
2021-01-25Everywhere: Name debug macros more consistently.asynts
Personally, I prefer the naming convention DEBUG_FOO over FOO_DEBUG, but the majority of the debug macros are already named in the latter naming convention, so I just enforce consistency here. This was done with the following script: find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/DEBUG_PATH/PATH_DEBUG/' {} \;
2021-01-25Everywhere: Remove unnecessary debug comments.asynts
It would be tempting to uncomment these statements, but that won't work with the new changes. This was done with the following commands: find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/#define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/#define/ { toggle = 1 }' {} \; find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/ #define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/ #define/ { toggle = 1 }' {} \;
2021-01-25Everywhere: Use CMake to generate AK/Debug.h.asynts
This was done with the help of several scripts, I dump them here to easily find them later: awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in) do find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \; done # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list. awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
2021-01-23UserspaceEmulator: Improve error message for typosBen Wiederhake
2021-01-23UserspaceEmulator: Implement chownBen Wiederhake
Now we can run 'ue chown anon ReadMe.md' :^)
2021-01-17Kernel+Userland: Remove shared buffers (shbufs)Andreas Kling
All users of this mechanism have been switched to anonymous files and passing file descriptors with sendfd()/recvfd(). Shbufs got us where we are today, but it's time we say good-bye to them and welcome a much more idiomatic replacement. :^)
2021-01-17Kernel: Remove sys$shbuf_seal() and userland wrappersAndreas Kling
There are no remaining users of this syscall so let it go. :^)
2021-01-16Kernel+Userland: Remove sys$shbuf_allow_all() and userland wrappersAndreas Kling
Nobody is using globally shared shbufs anymore, so let's remove them.
2021-01-16UserlandEmulator: Fix data loss in realpath/readlinkBen Wiederhake
This 'data loss' was introduced in 809a8ee6936c6e1f688b0854fa4214619d75f906, because I hoped we could eventually outlaw overlong paths entirely. This sparked some discussion: https://github.com/SerenityOS/serenity/discussions/4357 Among other things, we agree that yeah, the Kernel can and should be able to return paths of arbitrary length. This means that the 'arbitrary' maximum of PATH_MAX in UserspaceEmulator should be considered to be unnecessary data loss, and as such, needs to be fixed.
2021-01-16Kernel: Remove sys$shbuf_set_volatile() and userland wrappersAndreas Kling
There are no remaining users of this syscall so let's remove it! :^)
2021-01-16Everywhere: Convert a handful of String::format() => formatted()Andreas Kling
2021-01-15UserspaceEmulator: Support the anon_create, sendfd and recvfd syscallsAndreas Kling
2021-01-12LibC+Everywhere: Remove open_with_path_length() in favor of open()Andreas Kling
This API was a mostly gratuitous deviation from POSIX that gave up some portability in exchange for avoiding the occasional strlen(). I don't think that was actually achieving anything valuable, so let's just chill out and have the same open() API as everyone else. :^)
2021-01-12DevTools: Move to Userland/DevTools/Andreas Kling