Commit graph

154 commits

Author SHA1 Message Date
Nico Weber 5c2e8b6189 Lagom: Add ntpquery to lagom build 2020-11-12 21:21:33 +01:00
Nico Weber 5fcd34b810 Userland: Add an "adjtime" utility
It's a thin userland wrapper around adjtime(2). It can be used
to view current pending time adjustments, and root can use it to
smoothly adjust the system time.

As far as I can tell, other systems don't have a userland utility
for this, but it seems useful. Useful enough that I'm adding it to
the lagom build so I can use it on my linux box too :)
2020-11-10 19:03:08 +01:00
Linus Groh 46cd9157cd Lagom/Fuzzers: Add a Dockerfile for FuzzilliJs
Based on Fedora. This allows building and running FuzzilliJs and Fuzzilli
itself in a Docker/Podman container.
2020-11-08 11:01:07 +01:00
Ben Wiederhake 3cd39097f6 Meta: Add script that runs all lints 2020-11-08 09:58:55 +01:00
Linus Groh 2c9e6585f8 Documentation: Update required GCC version to >= 10
I initially thought as long as Lagom is not built >= 9 would be fine,
but LagomCore is always built for the code generators.
2020-11-07 18:22:18 +01:00
Luke 8928607455 Lagom/Fuzzers: Add Fuzzilli version of FuzzJs
Fuzzilli is a JavaScript engine fuzzer made by googleprojectzero.

https://github.com/googleprojectzero/fuzzilli/
2020-11-07 10:09:55 +01:00
Linus Groh 21912123c4 Travis: Update host GCC to version 10
This allows us to use the latest C++20 features in programs which we
compile and run as part of Lagom.
2020-11-02 13:12:35 +01:00
Brendan Coles c1bfb8cb0e Meta: lint-shell-scripts: Exit if shellcheck is not installed 2020-11-01 10:29:33 +01:00
AnotherTest 37c089fb7b LibTLS: (Almost) verify certificate chain against root CA certificates
Also adds a very primitive systemwide ca_certs.ini file.
2020-10-30 23:42:03 +01:00
asynts 607931268e CMake: Use CONFIGURE_DEPENDS in existing globs. 2020-10-29 11:52:47 +01:00
Laurent Cimon b4790010a8 Build: Modify various parts to allow the build to succeed on FreeBSD 2020-10-20 14:40:47 +02:00
Andreas Kling 75d5f436bc Toolchain: Upgrade to GCC 10.2.0 2020-10-12 19:53:25 +02:00
Linus Groh bcfc6f0c57 Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
Ben Wiederhake df4c9b729d Meta: Provide script to automatically flag bad formatting 2020-09-25 21:18:17 +02:00
Valtteri Koskivuori f0fdbb1d83 Meta: Fix build-root-filesystem.sh on macOS 2020-09-20 21:45:00 +02:00
Tom e317ee7541 Meta: Add env variable SERENITY_RUN to be able to choose qemu, bochs, etc
This allows picking for example bochs: SERENITY_RUN=b ninja run
2020-09-19 00:33:02 +02:00
AnotherTest 961661ea1d Build: Preserve hard/symbolic links when building root fs
This fixes the issue where there would not be enough space to copy
things when at least the git port and the gcc port are installed.
2020-09-16 15:56:35 +02:00
Andreas Kling 2b17d980cf Meta: Include .json files in the Qt Creator refresh script 2020-09-14 19:55:18 +02:00
Andreas Kling 2f97590409 Meta: Make the text-to-cpp-string thingy pass shellcheck 2020-09-14 16:33:53 +02:00
Andreas Kling 40892ac72e Meta: Add helper for generating a C++ string from a text file 2020-09-14 16:16:36 +02:00
Linus Groh e9562e1920 Userland: Add {md5,sha1,sha256,sha512}sum 2020-09-13 11:37:56 +02:00
Ben Wiederhake 8498a5678d Meta: Avoid deprecated qemu option
Apparently "-soundhw pcspk" is deprecated too. However, I don't know which "name"
to insert, and I can't test it, hence I didn't touch it.
2020-09-12 13:46:15 +02:00
Ben Wiederhake 25ccd40d5a Meta: Describe how to analyze an LLVM fuzzer crash 2020-09-12 00:13:29 +02:00
Ben Wiederhake 98bfcb4b57 Meta+LibGfx: Fuzz BMP parsing 2020-09-12 00:13:29 +02:00
Ben Wiederhake 5d3c437cce LibJS: Fix start position of multi-line tokens
This broke in case of unterminated regular expressions, causing goofy location
numbers, and 'source_location_hint' to eat up all memory:

Unexpected token UnterminatedRegexLiteral. Expected statement (line: 2, column: 4294967292)
2020-09-12 00:13:29 +02:00
Andreas Kling 18ff9c3fc2 Meta: Fix shellcheck whines in check-symbols.sh 2020-09-07 00:00:12 +02:00
Itamar 1c20e684f3 Travis: Run script that checks for forbidden symbols in LibC
check-symbols.sh fails the build if undefined __cx_guard_* symbols are
found in  LibC.

This will help us catch port breakage sooner.
2020-09-06 21:36:36 +02:00
Andreas Kling dcd47655d0 utmpupdate: Add a program for updating /var/run/utmp
To keep track of ongoing terminal sessions, we now have a sort-of
traditional /var/run/utmp file, like other Unix systems.
Unlike other Unix systems however, ours is of course JSON. :^)

The /bin/utmpupdate program is used to update the file, which is
not writable by regular user accounts. This helper program is
set-GID "utmp".
2020-09-06 16:10:27 +02:00
Ben Wiederhake c8668e9b7c Meta: Fix wonky copyright headers in Tests 2020-09-05 14:19:38 +02:00
Andreas Kling e834c24eea Kernel/USB: Start fleshing out a basic UHCI controller driver :^)
Let's see if we can talk to some USB devices. We will now detect
a UHCI controller if present on the PCI bus.
2020-09-04 21:21:41 +02:00
Andreas Kling e002cbb06b Build: Add some -Wno-unknown-warning-option flags to CXXFLAGS
Patch from Anonymous.
2020-09-01 12:00:53 +02:00
AnotherTest 465d46c665 Meta+Userland: Run the TLS test too
While this _does_ add a point of failure, it'll be a pretty bad day when
google goes down.
And this is unlikely to put a (positive) dent in their incoming
requests, so let's just roll with it until we have our own TLS server.
2020-08-24 09:29:39 +02:00
Andreas Kling 370624bc37 Meta: Actually exclude the Build/ directory from QtCreator refresh 2020-08-16 16:44:09 +02:00
Ben Wiederhake 8d680dd1ad Meta: Lint for duplicate endpoint IDs
We currently have 16 endpoints. The IDs are typed by a human at creation time.
This check will detect with we ever use an endpoint ID twice.

Since the large irrelevant directories are ignored, this should be quick enough.
2020-08-15 20:48:52 +02:00
Ben Wiederhake f19b88c965 Meta: Don't require setting SERENITY_ROOT for refresh script
The need for SERENITY_ROOT was basically eliminated in
73c953b674. The existing guess
'git rev-parse --show-toplevel' should be correct in all conceivable cases.
Most code just assumes the layout in git, or depends on SERENITY_ROOT as
set in the CMakeLists.txt. *Requiring* the user to set it doesn't make
sense anymore.

While I was in there anyway, I added exit code propagation. Also, 'find' should
be a tad faster now, because it doesn't enumerate files in the large ignored
directories Build/ and Toolchain/ anymore.
2020-08-15 13:38:24 +02:00
Andreas Kling a37331e236 Lagom: Add LibHTTP to Lagom (it builds fine without changes) 2020-08-15 00:05:45 +02:00
Peter Nelson a8ad0d120d Meta: allow override of QEMU -cpu argument via environment variable
Introduces a SERENITY_QEMU_CPU environment variable that allows
overriding of the qemu -cpu command line parameter. If not specified,
the argument defaults to "max".

The primary motivation behind this is to be able to enable or disable
specific features for the vCPU in order to workaround QEMU issues with
certain hardware accelerators. For example, QEMU on Windows with WPHX
sometimes fails to start unless Virtual Machine eXtensions are
disabled. This can now be done with:

  export SERENITY_QEMU_CPU="max,vmx=off"
2020-08-14 15:09:59 +02:00
Linus Groh b1e8807bc5 Meta: Check that "#include <LibM/math.h>" is not being used 2020-08-12 16:18:33 +02:00
Nico Weber 00f658b984
Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071)
If a buffer smaller than Elf32_Ehdr was passed to Image, header()
would do an out-of-bounds read.

Make parse() check for that. Make most Image methods assert that the image
is_valid(). For that to work, set m_valid early in Image::parse()
instead of only at its end.

Also reorder a few things so that the fuzzer doesn't hit (valid)
assertions, which were harmless from a security PoV but which still
allowed userspace to crash the kernel with an invalid ELF file.

Make dbgprintf()s configurable at run time so that the fuzzer doesn't
produce lots of logspam.
2020-08-10 15:55:17 +02:00
Nico Weber 700f5cfc90 Lagom: Pass -Wno-deprecated-copy to clang too
Due to Serenity's use of concepts, it now requires clang 10 or newer,
and clang 10 or newer both understands and requires
-Wno-deprecated-copy.
2020-08-09 21:13:06 +02:00
Nico Weber 9c136be08b disasm: For ELF files, disassemble .text section
Since disasm is built in lagom, this requires adding LibELF to lagom.
2020-08-09 21:12:54 +02:00
Luke 4b6036bc33 Meta: Update CLion configuration to include LibM and generated files
Also bumps the CXX Standard to C++20.
2020-08-06 09:43:03 +02:00
Nico Weber a619943001 Build: Make things build with clang without needing local changes
Useful for sanitizer fuzzer builds.

clang doesn't have a -fconcepts switch (I'm guessing it just enables
concepts automatically with -std=c++2a, but I haven't checked),
and at least the version on my system doesn't understand
-Wno-deprecated-move, so pass these two flags only to gcc.
In return, disable -Woverloaded-virtual which fires in many places.

The preceding commits fixed the handful of -Wunused-private-field
warnings that clang emitted.
2020-08-04 17:42:08 +02:00
Ben Wiederhake aaa13e5739 Meta: Provide a way to only update a file if the output changes
This is only useful for build commands that update their destination in all cases
and thus sometimes confuse cmake into rebuilding everything needlessly.
2020-08-04 11:27:14 +02:00
stelar7 98e18d7339 LibCompress: Add LibCompress
For now this only contains DEFLATE, and a very simple Zlib
Eventually GZip, etc. can go here as well.
2020-08-04 11:27:07 +02:00
Emanuele Torre f128d3baf7 Meta: make check-style.sh ignore Libraries/LibCore/puff.cpp
This file was formerly named `Libraries/LibCore/puff.c` and it was not
checked by `check-style.sh` because it only checks .h and .cpp files.

Since this file was not written by us, we shouldn't check its style.

This file was also causing our Travis builds to fail.
2020-07-29 17:36:21 +02:00
Nico Weber c7652a2166 Lagom: Clean up glob after puff.c -> puff.cpp rename 2020-07-29 15:11:04 +02:00
Ben Wiederhake eccf96b703 Meta: Find potentially missing resources 2020-07-29 01:34:22 +02:00
Ben Wiederhake 8aa6b13caa Meta: Ensure that icons and other resources remain non-executable 2020-07-29 01:34:22 +02:00
Peter Elliott fc425a218d Meta: Fix style of image building scripts
Oops. I didn't know there was a style guide for the scripts.
2020-07-28 19:09:44 +02:00