Skip to content

Commit 0dc6b24

Browse files
Rename librasan, make crates publishable (#3307)
1 parent 3141cba commit 0dc6b24

File tree

282 files changed

+1023
-836
lines changed

Some content is hidden

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

282 files changed

+1023
-836
lines changed

.github/workflows/librasan-prepare/action.yml renamed to .github/workflows/asan-prepare/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Setup QEMU librasan environment
2-
description: Sets up the QEMU librasan environment
1+
name: Setup Asan environment
2+
description: Sets up the Asan environment
33
runs:
44
using: composite
55
steps:

.github/workflows/build_and_test.yml

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ jobs:
164164
strategy:
165165
matrix:
166166
instance_idx: [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17" ]
167+
fail-fast: false
167168
steps:
168169
- uses: actions/checkout@v4
169170
- uses: ./.github/workflows/ubuntu-prepare
@@ -368,10 +369,10 @@ jobs:
368369
# We want to include the commit hash to ensure the cache is replaced
369370
# on each new commit.
370371
key: ${{ github.sha }}
371-
# We will only save the cache for one of the builds. Though we could
372+
# We will only save the cache for one of the builds. Though we could
372373
# just omit this filter and the jobs race to push to the cache, since
373-
# they would all share the same key (combining the `shared-key` and
374-
# `key`) our build would generate a load of warnings. Why this
374+
# they would all share the same key (combining the `shared-key` and
375+
# `key`) our build would generate a load of warnings. Why this
375376
# particular fuzzer? No real reason, but we had to choose one.
376377
save-if: ${{ matrix.fuzzer == 'binary_only/frida_libpng' }}
377378
cache-all-crates: true
@@ -392,7 +393,7 @@ jobs:
392393
fuzzers/${{ matrix.fuzzer }}
393394
394395
# This job checks whether any changes have been made to the QEMU code to avoid
395-
# rebuilding and testing the QEMU related fuzzers unnecessarily as they are
396+
# rebuilding and testing the QEMU related fuzzers unnecessarily as they are
396397
# more expensive to build
397398
qemu-changes:
398399
runs-on: ubuntu-24.04
@@ -620,22 +621,8 @@ jobs:
620621
shell: bash
621622
run: just -d utils/${{ matrix.util }} --justfile utils/${{ matrix.util }}/Justfile test
622623

623-
# Build and test librasan. The setup is common, so we use a matrix build and
624-
# use the task name at the end to select which target to build
625-
librasan:
626-
name: 🔧 librasan - ${{ matrix.task }}
627-
strategy:
628-
matrix:
629-
task:
630-
- build
631-
- test
632-
# If one task fails, then don't abandon the other
633-
fail-fast: false
634-
# Only build this if the QEMU code changes for now. Though agnostic, nobody
635-
# else has integrated librasan with other fuzzers for now.
636-
needs:
637-
- qemu-changes
638-
if: ${{ needs.qemu-changes.outputs.qemu == 'true' }}
624+
libafl_asan:
625+
name: 🔧 libafl_asan
639626
runs-on: ubuntu-24.04
640627
steps:
641628
- name: Checkout
@@ -644,44 +631,69 @@ jobs:
644631
submodules: true
645632
fetch-depth: 0
646633
- name: Prepare
647-
uses: ./.github/workflows/librasan-prepare
634+
uses: ./.github/workflows/asan-prepare
648635
- name: Configure Cache
649636
uses: Swatinem/rust-cache@v2
650637
with:
651-
# Use the task name to build the cache key. We will have a separate
638+
# Use the task name to build the cache key. We will have a separate
652639
# cache for each since they are both expensive to build and one builds
653640
# for many different architectures.
654-
shared-key: librasan-${{ matrix.task }}
641+
shared-key: libafl_asan
655642
# We want to include the commit hash to ensure the cache is replaced
656643
# on each new commit.
657644
key: ${{ github.sha }}
658645
cache-all-crates: true
659646
# Again the artefacts aren't built in the target root directory.
660647
workspaces: |
661-
libafl_qemu/librasan
662-
# Run only for the build task
663-
- name: Build
664-
if: ${{ matrix.task == 'build' }}
648+
libafl_asan
649+
- name: Test
665650
shell: bash
666651
run: |
667652
RUN_ON_CI=1 \
668653
RUSTC_BOOTSTRAP=1 \
669654
LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} \
670655
just \
671-
-f ./libafl_qemu/librasan/Justfile \
672-
build_everything_dev \
673-
build_x86_64_release
674-
# Run only for the test task
675-
- name: Test
676-
if: ${{ matrix.task == 'test' }}
656+
-f ./libafl_asan/Justfile \
657+
test_everything
658+
659+
libafl_qemu_asan:
660+
name: 🔧 libafl_qemu_asan
661+
needs:
662+
- qemu-changes
663+
if: ${{ needs.qemu-changes.outputs.qemu == 'true' }}
664+
runs-on: ubuntu-24.04
665+
steps:
666+
- name: Checkout
667+
uses: actions/checkout@v4
668+
with:
669+
submodules: true
670+
fetch-depth: 0
671+
- name: Prepare
672+
uses: ./.github/workflows/asan-prepare
673+
- name: Configure Cache
674+
uses: Swatinem/rust-cache@v2
675+
with:
676+
# Use the task name to build the cache key. We will have a separate
677+
# cache for each since they are both expensive to build and one builds
678+
# for many different architectures.
679+
shared-key: libafl_qemu_asan
680+
# We want to include the commit hash to ensure the cache is replaced
681+
# on each new commit.
682+
key: ${{ github.sha }}
683+
cache-all-crates: true
684+
# Again the artefacts aren't built in the target root directory.
685+
workspaces: |
686+
libafl_qemu/libafl_qemu_asan
687+
- name: Build
677688
shell: bash
678689
run: |
679690
RUN_ON_CI=1 \
680691
RUSTC_BOOTSTRAP=1 \
681692
LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} \
682693
just \
683-
-f ./libafl_qemu/librasan/Justfile \
684-
test_everything
694+
-f ./libafl_qemu/libafl_qemu_asan/Justfile \
695+
build_everything_dev \
696+
build_x86_64_release
685697
686698
nostd-build:
687699
runs-on: ubuntu-24.04
@@ -785,7 +797,7 @@ jobs:
785797
file: ./Dockerfile
786798
push: ${{ github.ref == 'refs/heads/main' }}
787799
load: ${{ github.ref != 'refs/heads/main' }}
788-
tags:
800+
tags:
789801
ghcr.io/aflplusplus/libafl:latest
790802
cache-from: |
791803
type=registry,ref=ghcr.io/aflplusplus/libafl:cache
@@ -840,7 +852,7 @@ jobs:
840852
- name: Configure Cache
841853
uses: Swatinem/rust-cache@v2
842854
with:
843-
# There aren't too many of these fuzzers, so lets just give them a
855+
# There aren't too many of these fuzzers, so lets just give them a
844856
# separate cache each for now.
845857
shared-key: fuzzers-windows-${{ steps.fuzzer_name.outputs.fuzzer_name }}-x86_64
846858
# We want to include the commit hash to ensure the cache is replaced
@@ -919,7 +931,7 @@ jobs:
919931
run: cargo install cargo-ndk
920932
- name: cargo android targets
921933
run: |
922-
rustup target add x86_64-linux-android
934+
rustup target add x86_64-linux-android
923935
- name: Build Android
924936
env:
925937
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
resolver = "2"
33
members = [
44
"libafl",
5+
"libafl_asan",
6+
"libafl_asan/libafl_asan_fuzz",
7+
"libafl_asan/libafl_asan_libc",
58
"libafl_bolts",
69
"libafl_cc",
710
"libafl_concolic/symcc_runtime",
@@ -16,6 +19,7 @@ members = [
1619
"libafl_tinyinst",
1720
"libafl_qemu",
1821
"libafl_qemu/libafl_qemu_build",
22+
"libafl_qemu/libafl_qemu_runner",
1923
"libafl_qemu/libafl_qemu_sys",
2024
"libafl_sugar",
2125
"libafl_concolic/test/dump_constraints",
@@ -55,6 +59,8 @@ exclude = [
5559
[workspace.package]
5660
version = "0.15.3"
5761
license = "MIT OR Apache-2.0"
62+
repository = "https://github.com/AFLplusplus/LibAFL/"
63+
readme = "./README.md"
5864

5965
[workspace.dependencies]
6066
# Internal deps

fuzzers/binary_only/qemu_launcher/Cargo.lock

Lines changed: 40 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fuzzers/binary_only/qemu_launcher/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ libafl_bolts = { path = "../../../libafl_bolts", features = [
4949
] }
5050
libafl_qemu = { path = "../../../libafl_qemu", features = [
5151
"usermode",
52-
"rasan",
52+
"asan_rust",
5353
] }
5454
libafl_targets = { path = "../../../libafl_targets" }
5555
log = { version = "0.4.22", features = ["release_max_level_info"] }

0 commit comments

Comments
 (0)