From 58d43607862096aeb32d72173911c9df244a30f1 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 19 Jan 2019 08:50:56 +0000 Subject: Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/fuzzer/AFLDriverTest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/fuzzer/AFLDriverTest.cpp') diff --git a/test/fuzzer/AFLDriverTest.cpp b/test/fuzzer/AFLDriverTest.cpp index b949adc7d..d2937d004 100644 --- a/test/fuzzer/AFLDriverTest.cpp +++ b/test/fuzzer/AFLDriverTest.cpp @@ -1,5 +1,6 @@ -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // Contains dummy functions used to avoid dependency on AFL. #include -- cgit v1.2.1 From 9b65419587ed0457016be511619dcb94a21fe5ff Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Thu, 18 Apr 2019 18:49:11 +0000 Subject: Summary: Add close_fd_mask functionality to AFL driver. Summary: Add support for env var AFL_DRIVER_CLOSE_FD_MASK which behaves the same as libFuzzer's -close_fd_mask=1. Also add tests. Reviewers: kcc, vitalybuka, morehouse Reviewed By: morehouse Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60334 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@358703 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/fuzzer/AFLDriverTest.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'test/fuzzer/AFLDriverTest.cpp') diff --git a/test/fuzzer/AFLDriverTest.cpp b/test/fuzzer/AFLDriverTest.cpp index d2937d004..84b5f9f6b 100644 --- a/test/fuzzer/AFLDriverTest.cpp +++ b/test/fuzzer/AFLDriverTest.cpp @@ -2,28 +2,33 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// Contains dummy functions used to avoid dependency on AFL. #include #include #include +// Dummy functions used to avoid dependency on AFL. extern "C" void __afl_manual_init() {} extern "C" int __afl_persistent_loop(unsigned int N) { static int Count = N; - fprintf(stderr, "__afl_persistent_loop calle, Count = %d\n", Count); - if (Count--) return 1; - return 0; + fprintf(stderr, "__afl_persistent_loop called, Count = %d\n", Count); + return Count--; } // This declaration exists to prevent the Darwin linker // from complaining about this being a missing weak symbol. extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { - fprintf(stderr, "LLVMFuzzerInitialize called\n"); return 0; } extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - fprintf(stderr, "LLVMFuzzerTestOneInput called; Size = %zd\n", Size); - return 0; + puts("STDOUT MESSAGE"); + fflush(stdout); + fprintf(stderr, "STDERR MESSAGE\n" + "LLVMFuzzerTestOneInput called; Size = %zd\n", + Size); + if (Size < 4) + return 0; + + return Data[Size]; } -- cgit v1.2.1