Add CI for utils (#3224)
This commit is contained in:
parent
e3a3dfb41b
commit
2e0d6343af
32
.github/workflows/build_and_test.yml
vendored
32
.github/workflows/build_and_test.yml
vendored
@ -412,6 +412,38 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: unset RUSTC && ARCH=${{ matrix.arch }} RUN_ON_CI=1 LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} cargo run --manifest-path ./utils/ci_runner/Cargo.toml -- ${{ matrix.fuzzer }}
|
run: unset RUSTC && ARCH=${{ matrix.arch }} RUN_ON_CI=1 LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} cargo run --manifest-path ./utils/ci_runner/Cargo.toml -- ${{ matrix.fuzzer }}
|
||||||
|
|
||||||
|
utils:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-24.04]
|
||||||
|
fuzzer:
|
||||||
|
# Binary only
|
||||||
|
- ./utils/gdb_qemu
|
||||||
|
arch:
|
||||||
|
# unless somebody pays us for the servers.
|
||||||
|
# - aarch64
|
||||||
|
# - arm
|
||||||
|
# - i386
|
||||||
|
# - ppc
|
||||||
|
- x86_64
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/workflows/ubuntu-prepare
|
||||||
|
- name: Add rustfmt nightly
|
||||||
|
shell: bash
|
||||||
|
run: rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
|
||||||
|
- name: Install deps
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y g++-powerpc-linux-gnu gcc-powerpc-linux-gnu gdb-multiarch
|
||||||
|
- name: Add rust targets
|
||||||
|
shell: bash
|
||||||
|
run: rustup target add --toolchain nightly-x86_64-unknown-linux-gnu powerpc-unknown-linux-gnu
|
||||||
|
- name: Build and run utils (Linux)
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
shell: bash
|
||||||
|
run: just -d ${{ matrix.fuzzer }} --justfile ${{ matrix.fuzzer }}/Justfile test
|
||||||
|
|
||||||
librasan-build:
|
librasan-build:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs:
|
needs:
|
||||||
|
@ -24,7 +24,22 @@ build: format
|
|||||||
run: demo
|
run: demo
|
||||||
cargo run -p gdb_qemu --profile {{PROFILE}} -- -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo
|
cargo run -p gdb_qemu --profile {{PROFILE}} -- -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo
|
||||||
|
|
||||||
gdb:
|
gdb: demo build
|
||||||
gdb-multiarch -ex "set architecture powerpc:MPC8XX" -ex "set pagination off" -ex "set confirm off" -ex "file {{DEMO_DIR}}/gdb_demo" -ex "target remote | {{HOST_DIR}}/gdb_qemu -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo"
|
gdb-multiarch \
|
||||||
|
-ex "set architecture powerpc:MPC8XX" \
|
||||||
|
-ex "set pagination off" \
|
||||||
|
-ex "set confirm off" \
|
||||||
|
-ex "file {{DEMO_DIR}}/gdb_demo" \
|
||||||
|
-ex "target remote | {{HOST_DIR}}/gdb_qemu -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo"
|
||||||
|
|
||||||
|
test: demo build
|
||||||
|
gdb-multiarch \
|
||||||
|
-ex "set architecture powerpc:MPC8XX" \
|
||||||
|
-ex "set pagination off" \
|
||||||
|
-ex "set confirm off" \
|
||||||
|
-ex "file {{DEMO_DIR}}/gdb_demo" \
|
||||||
|
-ex "target remote | {{HOST_DIR}}/gdb_qemu -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 {{DEMO_DIR}}/gdb_demo" \
|
||||||
|
-ex "c" \
|
||||||
|
-ex "q"
|
||||||
|
|
||||||
all: demo build
|
all: demo build
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
use clap::{builder::Str, Parser};
|
use clap::{Parser, builder::Str};
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Version;
|
pub struct Version;
|
||||||
|
@ -3,7 +3,7 @@ use std::{
|
|||||||
os::fd::{AsRawFd, RawFd},
|
os::fd::{AsRawFd, RawFd},
|
||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{Result, anyhow};
|
||||||
use nix::unistd::{dup2, execvp};
|
use nix::unistd::{dup2, execvp};
|
||||||
|
|
||||||
use crate::{args::ChildArgs, exit::Exit};
|
use crate::{args::ChildArgs, exit::Exit};
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
use anyhow::{anyhow, Result};
|
use anyhow::{Result, anyhow};
|
||||||
use libc::{_exit, prctl, PR_SET_PDEATHSIG};
|
use libc::{_exit, PR_SET_PDEATHSIG, prctl};
|
||||||
use nix::{
|
use nix::{
|
||||||
sys::{
|
sys::{
|
||||||
signal::{sigaction, SaFlags, SigAction, SigHandler, SigSet, SIGCHLD, SIGKILL},
|
signal::{SIGCHLD, SIGKILL, SaFlags, SigAction, SigHandler, SigSet, sigaction},
|
||||||
wait::{waitpid, WaitStatus::Exited},
|
wait::{WaitStatus::Exited, waitpid},
|
||||||
},
|
},
|
||||||
unistd::Pid,
|
unistd::Pid,
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{Result, anyhow};
|
||||||
use simplelog::{Config, LevelFilter, WriteLogger};
|
use simplelog::{Config, LevelFilter, WriteLogger};
|
||||||
|
|
||||||
use crate::args::LogArgs;
|
use crate::args::LogArgs;
|
||||||
|
@ -11,9 +11,9 @@ extern crate simplelog;
|
|||||||
|
|
||||||
use std::os::fd::AsRawFd;
|
use std::os::fd::AsRawFd;
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{Result, anyhow};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use nix::unistd::{fork, pipe, ForkResult};
|
use nix::unistd::{ForkResult, fork, pipe};
|
||||||
|
|
||||||
use crate::{args::Args, child::Child, exit::Exit, logger::Logger, parent::Parent};
|
use crate::{args::Args, child::Child, exit::Exit, logger::Logger, parent::Parent};
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ use std::{
|
|||||||
time::{Duration, SystemTime},
|
time::{Duration, SystemTime},
|
||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{Result, anyhow};
|
||||||
use nix::unistd::read;
|
use nix::unistd::read;
|
||||||
|
|
||||||
use crate::{args::ParentArgs, exit::Exit};
|
use crate::{args::ParentArgs, exit::Exit};
|
||||||
|
@ -286,7 +286,6 @@ async fn main() -> io::Result<()> {
|
|||||||
let rust_excluded_directories = RegexSet::new([
|
let rust_excluded_directories = RegexSet::new([
|
||||||
r".*target.*",
|
r".*target.*",
|
||||||
r".*utils/noaslr.*",
|
r".*utils/noaslr.*",
|
||||||
r".*utils/gdb_qemu.*",
|
|
||||||
r".*docs/listings/baby_fuzzer/listing-.*",
|
r".*docs/listings/baby_fuzzer/listing-.*",
|
||||||
r".*LibAFL/Cargo.toml.*",
|
r".*LibAFL/Cargo.toml.*",
|
||||||
r".*AFLplusplus.*",
|
r".*AFLplusplus.*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user