Skip to content

syz-manager: add a smoke test #4022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
a-nogikh opened this issue Jul 11, 2023 · 9 comments
Open

syz-manager: add a smoke test #4022

a-nogikh opened this issue Jul 11, 2023 · 9 comments

Comments

@a-nogikh
Copy link
Collaborator

One possible way:

  • Add UML fuzzing support.
  • Build a minimalistic UML kernel image and include it to the Docker image
    • defconfig with KCOV and DEBUG_DWARF4 gives a ~88MB vmlinux and linux files.
  • Run fuzzing for 1(?) minute: then verify that coverage/signal/execution speed stats are reasonable.
@a-nogikh a-nogikh changed the title syz-manager: set up basic sanity testing syz-manager: add a smoke test Jul 11, 2023
@dvyukov
Copy link
Collaborator

dvyukov commented Jul 11, 2023

Dup of #604?

@a-nogikh
Copy link
Collaborator Author

I'd say a sub-issue :)

@a-nogikh
Copy link
Collaborator Author

UML currently just crashes when compiled with defconfig + KCOV:

$ ./linux  --help
Segmentation fault

Theoretically we could also use qemu, though. But not sure how well we could integrate that into pre-submit CI tests.

@dvyukov
Copy link
Collaborator

dvyukov commented Jul 11, 2023

We don't have UML support in syzkaller.

We run CI on our machines with our docker image, so theoretically we could use qemu there.

@a-nogikh
Copy link
Collaborator Author

We don't have UML support in syzkaller.

I know. But, if it's not too difficult to support it, it will be a lightweighter solution.

@tarasmadan
Copy link
Collaborator

UML support sounds like +1 dependency. Is it?
Do you mind to go infra as a code way? We can define some deployment/update scripts for syzbot project and use this smoke testing project as a pilot.

@a-nogikh
Copy link
Collaborator Author

a-nogikh commented Jul 14, 2023

A small qemu image:

$ git checkout v6.4
$ make CC=clang LD=ld.lld defconfig
$ ./scripts/config -d HID -d SOUND -d DRM -d USB -d WIRELESS -d NETFILTER -d NFS -d MEDIA_SUPPORT -d SECURITY_SELINUX -e KCOV -e KCOV_ENABLE_COMPARISONS
$ make CC=clang LD=ld.lld -j64

bzImage is ~12 MB.

qemu boot time (until login prompt) is ~3.8 seconds under KVM, 23 seconds without it.

qemu-system-x86_64   -m 2G   -smp 2,sockets=2,cores=1    -drive file=/tmp/buildroot-amd64,format=raw  -net nic,model=e1000 -accel tcg -nographic  -snapshot -machine pc-q35-7.1

The amd64 buildroot image is ~175MB with qcow2: It's 97MB if we also pass the -c flag.

qemu-img convert -f raw -O qcow2 /tmp/buildroot-amd64 buildroot.qcow2

@a-nogikh
Copy link
Collaborator Author

Without KCOV_ENABLE_COMPARISONS, non-KVM qemu boots in 13 seconds.

@dvyukov
Copy link
Collaborator

dvyukov commented Apr 9, 2025

syz-manager now has smoke-test mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants