diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-05-31 12:05:29 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-05-31 19:29:07 +0200 |
commit | 2dd7a72d5a58e9a99b1f79b0a2c966e5b3ee1b1d (patch) | |
tree | 6036ab6245255bb391a08dfbd0bbe74ebafb3992 /src/journal-remote | |
parent | 23b8aa648d1d8cb1209ddd521989aa47f9344f68 (diff) | |
download | systemd-2dd7a72d5a58e9a99b1f79b0a2c966e5b3ee1b1d.tar.gz |
fuzz-journal-remote: print some kinds of errors
In https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34803, we fail with:
Assertion 'IN_SET(r, -ENOMEM, -EMFILE, -ENFILE)' failed at src/journal-remote/fuzz-journal-remote.c:69,
function int LLVMFuzzerTestOneInput(const uint8_t *, size_t)(). Aborting.
AddressSanitizer:DEADLYSIGNAL
Let's try to print the error, so maybe we can see what is going on.
With the previous commit we shouldn't print out anything.
Diffstat (limited to 'src/journal-remote')
-rw-r--r-- | src/journal-remote/fuzz-journal-remote.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/journal-remote/fuzz-journal-remote.c b/src/journal-remote/fuzz-journal-remote.c index 37eff2f748..32c4e1819c 100644 --- a/src/journal-remote/fuzz-journal-remote.c +++ b/src/journal-remote/fuzz-journal-remote.c @@ -28,7 +28,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { return 0; if (!getenv("SYSTEMD_LOG_LEVEL")) - log_set_max_level(LOG_CRIT); + log_set_max_level(LOG_ERR); fdin = memfd_new_and_map("fuzz-journal-remote", size, &mem); if (fdin < 0) @@ -66,6 +66,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { r = sd_journal_open_files(&j, (const char**) STRV_MAKE(name), 0); if (r < 0) { + log_error_errno(r, "sd_journal_open_files([\"%s\"]) failed: %m", name); assert_se(IN_SET(r, -ENOMEM, -EMFILE, -ENFILE)); return r; } |