Skip to content

Commit 6e5d340

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 6a19d87 + eaa600e commit 6e5d340

File tree

52 files changed

+455
-579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+455
-579
lines changed

.github/workflows/build_and_test.yml

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -369,58 +369,58 @@ jobs:
369369
shell: bash
370370
run: RUN_ON_CI=1 LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} ./scripts/test_fuzzer.sh ${{ matrix.fuzzer }}
371371

372-
fuzzers-qemu-user:
373-
needs:
374-
- changes
375-
if: ${{ needs.changes.outputs.qemu == 'true' }}
376-
strategy:
377-
matrix:
378-
os: [ubuntu-24.04]
379-
fuzzer:
380-
# Binary only
381-
- ./fuzzers/binary_only/qemu_cmin
382-
- ./fuzzers/binary_only/qemu_coverage
383-
- ./fuzzers/binary_only/qemu_launcher
384-
arch:
385-
# unless somebody pays us for the servers.
386-
# - aarch64
387-
# - arm
388-
# - i386
389-
# - ppc
390-
- x86_64
391-
392-
runs-on: [ self-hosted, qemu ]
393-
container: registry.gitlab.com/qemu-project/qemu/qemu/ubuntu2204:latest
394-
steps:
395-
- uses: actions/checkout@v4
396-
- uses: ./.github/workflows/qemu-fuzzer-tester-prepare
397-
- name: Build and run example QEMU fuzzers (Linux)
398-
if: runner.os == 'Linux'
399-
shell: bash
400-
run: ARCH=${{ matrix.arch }} RUN_ON_CI=1 LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} ./scripts/test_fuzzer.sh ${{ matrix.fuzzer }}
401-
402-
fuzzers-qemu-system:
403-
needs:
404-
- changes
405-
if: ${{ needs.changes.outputs.qemu == 'true' }}
406-
strategy:
407-
matrix:
408-
os: [ubuntu-24.04]
409-
fuzzer:
410-
# Full-system
411-
- ./fuzzers/full_system/qemu_baremetal
412-
- ./fuzzers/full_system/qemu_linux_kernel
413-
- ./fuzzers/full_system/qemu_linux_process
414-
415-
runs-on: [ self-hosted, qemu ]
416-
container: registry.gitlab.com/qemu-project/qemu/qemu/ubuntu2204:latest
417-
steps:
418-
- uses: actions/checkout@v4
419-
- uses: ./.github/workflows/qemu-fuzzer-tester-prepare
420-
- name: Build and run example QEMU fuzzers (Linux)
421-
if: runner.os == 'Linux'
422-
shell: bash
423-
run: RUN_ON_CI=1 LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} ./scripts/test_fuzzer.sh ${{ matrix.fuzzer }}
372+
# fuzzers-qemu-user:
373+
# needs:
374+
# - changes
375+
# if: ${{ needs.changes.outputs.qemu == 'true' }}
376+
# strategy:
377+
# matrix:
378+
# os: [ubuntu-24.04]
379+
# fuzzer:
380+
# Binary only
381+
# - ./fuzzers/binary_only/qemu_cmin
382+
# - ./fuzzers/binary_only/qemu_coverage
383+
# - ./fuzzers/binary_only/qemu_launcher
384+
# arch:
385+
# # unless somebody pays us for the servers.
386+
# # - aarch64
387+
# # - arm
388+
# # - i386
389+
# # - ppc
390+
# - x86_64
391+
#
392+
# runs-on: [ self-hosted, qemu ]
393+
# container: registry.gitlab.com/qemu-project/qemu/qemu/ubuntu2204:latest
394+
# steps:
395+
# - uses: actions/checkout@v4
396+
# - uses: ./.github/workflows/qemu-fuzzer-tester-prepare
397+
# - name: Build and run example QEMU fuzzers (Linux)
398+
# if: runner.os == 'Linux'
399+
# shell: bash
400+
# run: ARCH=${{ matrix.arch }} RUN_ON_CI=1 LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} ./scripts/test_fuzzer.sh ${{ matrix.fuzzer }}
401+
#
402+
# fuzzers-qemu-system:
403+
# needs:
404+
# - changes
405+
# if: ${{ needs.changes.outputs.qemu == 'true' }}
406+
# strategy:
407+
# matrix:
408+
# os: [ubuntu-24.04]
409+
# fuzzer:
410+
# Full-system
411+
# - ./fuzzers/full_system/qemu_baremetal
412+
# - ./fuzzers/full_system/qemu_linux_kernel
413+
# - ./fuzzers/full_system/qemu_linux_process
414+
#
415+
# runs-on: [ self-hosted, qemu ]
416+
# container: registry.gitlab.com/qemu-project/qemu/qemu/ubuntu2204:latest
417+
# steps:
418+
# - uses: actions/checkout@v4
419+
# - uses: ./.github/workflows/qemu-fuzzer-tester-prepare
420+
# - name: Build and run example QEMU fuzzers (Linux)
421+
# if: runner.os == 'Linux'
422+
# shell: bash
423+
# run: RUN_ON_CI=1 LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} ./scripts/test_fuzzer.sh ${{ matrix.fuzzer }}
424424

425425
nostd-build:
426426
runs-on: ubuntu-24.04

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,6 @@ rustc-ice-*
8585

8686
# backup files
8787
*.bak
88+
89+
# log
90+
log

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ std_instead_of_core = "deny"
156156
cargo = { level = "warn", priority = -1 }
157157

158158
# Allow
159-
negative_feature_names = "allow" # TODO: turn into 'warn' when working
160-
multiple_crate_versions = "allow" # TODO: turn into `warn` when working
159+
negative_feature_names = "allow" # TODO: turn into 'warn' when working
160+
multiple_crate_versions = "allow" # TODO: turn into `warn` when working
161161
unreadable_literal = "allow"
162162
type_repetition_in_bounds = "allow"
163163
missing_errors_doc = "allow"
@@ -169,8 +169,8 @@ module_name_repetitions = "allow"
169169
unsafe_derive_deserialize = "allow"
170170
similar_names = "allow"
171171
too_many_lines = "allow"
172-
comparison_chain = "allow" # This lint makes **ZERO** sense
173-
172+
comparison_chain = "allow" # This lint makes **ZERO** sense
173+
unnecessary_debug_formatting = "allow" # :thumbsdown: :thumbsdown: :thumbsdown: :thumbsdown: :thumbsdown: :thumbsdown:
174174

175175
[workspace.lints.rustdoc]
176176
# Deny

Dockerfile

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,33 @@ RUN set -ex &&\
6868
chmod +x llvm.sh &&\
6969
./llvm.sh ${LLVM_VERSION}
7070

71+
RUN apt-get update && \
72+
apt-get install -y \
73+
clang-format-${LLVM_VERSION}
74+
7175
RUN git config --global core.pager cat
7276

7377
# Install a modern version of QEMU
74-
7578
WORKDIR /root
7679
ENV QEMU_VER=9.2.1
77-
RUN wget https://download.qemu.org/qemu-${QEMU_VER}.tar.xz
78-
RUN tar xvJf qemu-${QEMU_VER}.tar.xz
79-
WORKDIR /root/qemu-${QEMU_VER}
80-
RUN ./configure --target-list="\
81-
arm-linux-user,\
82-
aarch64-linux-user,\
83-
i386-linux-user,\
84-
ppc-linux-user,\
85-
mips-linux-user,\
86-
arm-softmmu,\
87-
aarch64-softmmu,\
88-
i386-softmmu,\
89-
ppc-softmmu,\
90-
mips-softmmu"
91-
RUN make -j
92-
RUN make install
80+
RUN wget https://download.qemu.org/qemu-${QEMU_VER}.tar.xz && \
81+
tar xvJf qemu-${QEMU_VER}.tar.xz && \
82+
cd /root/qemu-${QEMU_VER} && \
83+
./configure --target-list="\
84+
arm-linux-user,\
85+
aarch64-linux-user,\
86+
i386-linux-user,\
87+
ppc-linux-user,\
88+
mips-linux-user,\
89+
arm-softmmu,\
90+
aarch64-softmmu,\
91+
i386-softmmu,\
92+
ppc-softmmu,\
93+
mips-softmmu" && \
94+
make -j && \
95+
make install && \
96+
cd /root && \
97+
rm -rf qemu-${QEMU_VER}
9398

9499
# Copy a dummy.rs and Cargo.toml first, so that dependencies are cached
95100
WORKDIR /libafl

fuzzers/forkserver/libafl-fuzz/src/corpus.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,10 @@ pub fn check_autoresume(fuzzer_dir: &Path, auto_resume: bool) -> Result<Flock<Fi
146146

147147
pub fn create_dir_if_not_exists(path: &Path) -> io::Result<()> {
148148
if path.is_file() {
149-
return Err(io::Error::new(
150-
// TODO: change this to ErrorKind::NotADirectory
151-
// when stabilitzed https://github.com/rust-lang/rust/issues/86442
152-
io::ErrorKind::Other,
153-
format!("{} expected a directory; got a file", path.display()),
154-
));
149+
return Err(io::Error::other(format!(
150+
"{} expected a directory; got a file",
151+
path.display()
152+
)));
155153
}
156154
match std::fs::create_dir(path) {
157155
Ok(()) => Ok(()),

fuzzers/forkserver/libafl-fuzz/src/feedback/seed.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@ where
100100
Ok(())
101101
}
102102

103-
/// Discard the stored metadata in case that the testcase is not added to the corpus
104-
#[inline]
105-
fn discard_metadata(&mut self, state: &mut S, input: &I) -> Result<(), Error> {
106-
self.inner.discard_metadata(state, input)?;
107-
Ok(())
108-
}
109103
#[cfg(feature = "track_hit_feedbacks")]
110104
fn last_result(&self) -> Result<bool, Error> {
111105
self.inner.last_result()

fuzzers/inprocess/fuzzbench_ctx/src/lib.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,6 @@ fn fuzz(
345345

346346
let mut tracing_harness = harness;
347347
let ctx_hook = CtxHook::new();
348-
// Create the executor for an in-process function with one observer for edge coverage and one for the execution time
349-
let mut executor = HookableInProcessExecutor::with_timeout_generic(
350-
tuple_list!(ctx_hook),
351-
&mut harness,
352-
tuple_list!(edges_observer, time_observer),
353-
&mut fuzzer,
354-
&mut state,
355-
&mut mgr,
356-
timeout,
357-
)?;
358348

359349
// Setup a tracing stage in which we log comparisons
360350
let tracing = TracingStage::new(
@@ -369,6 +359,17 @@ fn fuzz(
369359
// Give it more time!
370360
);
371361

362+
// Create the executor for an in-process function with one observer for edge coverage and one for the execution time
363+
let mut executor = HookableInProcessExecutor::with_timeout_generic(
364+
tuple_list!(ctx_hook),
365+
&mut harness,
366+
tuple_list!(edges_observer, time_observer),
367+
&mut fuzzer,
368+
&mut state,
369+
&mut mgr,
370+
timeout,
371+
)?;
372+
372373
// The order of the stages matter!
373374
let mut stages = tuple_list!(calibration, tracing, i2s, power);
374375

libafl/src/events/launcher.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ where
274274
// Spawn clients
275275
let mut index = 0_usize;
276276
for bind_to in core_ids {
277-
if self.cores.ids.iter().any(|&x| x == bind_to) {
277+
if self.cores.ids.contains(&bind_to) {
278278
for overcommit_id in 0..self.overcommit {
279279
index += 1;
280280
self.shmem_provider.pre_fork()?;
@@ -456,7 +456,7 @@ where
456456
//spawn clients
457457
let mut index = 0;
458458
for core_id in core_ids {
459-
if self.cores.ids.iter().any(|&x| x == core_id) {
459+
if self.cores.ids.contains(&core_id) {
460460
for overcommit_i in 0..self.overcommit {
461461
index += 1;
462462
// Forward own stdio to child processes, if requested by user
@@ -748,7 +748,7 @@ where
748748
// Spawn clients
749749
let mut index = 0_usize;
750750
for bind_to in core_ids {
751-
if self.cores.ids.iter().any(|&x| x == bind_to) {
751+
if self.cores.ids.contains(&bind_to) {
752752
for overcommit_id in 0..self.overcommit {
753753
index += 1;
754754
self.shmem_provider.pre_fork()?;

0 commit comments

Comments
 (0)