syzkaller
syzkaller copied to clipboard
tools/syz-env: Support linux/arm64.
Is your feature request related to a problem? Please describe.
When building syzkaller, syz-env make is recommended.
$ make
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
However, on aarch64 host, syz-env make fails with the following error.
$ ./tools/syz-env make
gcr.io/syzkaller/env:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /usr/bin/bash: exec format error
Even after specifying the platform
diff --git a/tools/syz-env b/tools/syz-env
index 27ec01a9d6b3..24cd571e3d3a 100755
--- a/tools/syz-env
+++ b/tools/syz-env
@@ -62,7 +62,7 @@ if [ ! "$(docker info -f "{{println .SecurityOptions}}" | grep rootless)" ]; the
fi
# Update docker image
-docker pull -q gcr.io/syzkaller/${IMAGE}
+docker pull -q --platform linux/arm64 gcr.io/syzkaller/${IMAGE}
# Run everything as the host user, this is important for created/modified files.
docker run \
syz-env make still fails because there is no image for arm64 platform.
$ ./tools/syz-env make
image with reference gcr.io/syzkaller/env:latest was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /usr/bin/bash: exec format error
Describe the solution you'd like
It would be nice to create and upload arm64 image to gcr.io for consistent build environment.
This may be a good opportunity to merge syz-env and syzbot (which already has arm 64 arch) containers.
Hard to say. I don't want the dev tools to pollute our prod environment, but taking into account our limited resources... who knows, it may be a good idea. I'd like syz-enz to be multiarch and extend syzbot environment. It will improve current situation and give us flexibility to add as much dev-only things as we need. Today we use quite outdated sdk and I don't feel guilty because it is not a part of prod environment. Next days we may add the gcp services emulators to the dev environment...
Yes, precisely because of limited resources. The benefits are very abstract, but the downsides are measured in very real time spent on updating both and keeping them in sync. My original motivation for splitting them was that large size will be a problem (lots of traffic, etc), so I tried to create more smaller containers. This turned out to be false in practice, the size is not a problem. They are large anyway, and all usages use caching. We already merged 2 containers and that was a relief for updates.
It is quite convenient to experiment with updates in syz-env and move changes later so syzbot.
I'm thinking about 2 labels for one container. Something like "stable" + "dev" versions of the same Dockerfile. It will help to manage updates.
We can also make tools/docker focused CI rule and build containers in case of changes. Assuming syz-env will extend syzbot, the changes propagation shouldn't be that hard.
Hi,
Is it possible to reproduce the bug on arm64 machine when the VM used by syzkaller is x86_64 ?
Just find it really hard to compile the syzkaller on my fedora(asahi remix) arm64 machine
It would be great if there is an arm64 docker image.
Thanks!
Hi Alan!
Is it possible to reproduce the bug on arm64 machine when the VM used by syzkaller is x86_64 ?
Do you mean running the x86 bug reproducer on an arm64 machine or setting up an x86 VM on an arm64 host?
Just find it really hard to compile the syzkaller on my fedora(asahi remix) arm64 machine
What errors do you see?
(Just in case: such questions may better belong to our mailing list)
On Feb 21, 2025, at 18:21, Aleksandr Nogikh @.***> wrote:
Hi Alan! Is it possible to reproduce the bug on arm64 machine when the VM used by syzkaller is x86_64 ? Do you mean running the x86 bug reproducer on an arm64 machine or setting up an x86 VM on an arm64 host? Just find it really hard to compile the syzkaller on my fedora(asahi remix) arm64 machine What errors do you see? (Just in case: such questions may better belong to our mailing list) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***> a-nogikh left a comment (google/syzkaller#5041) Hi Alan! Is it possible to reproduce the bug on arm64 machine when the VM used by syzkaller is x86_64 ? Do you mean running the x86 bug reproducer on an arm64 machine or setting up an x86 VM on an arm64 host?
The former.
Just find it really hard to compile the syzkaller on my fedora(asahi remix) arm64 machine What errors do you see?
Something like that cgo can not find header file, the last one I saw is missing instructions. Sorry, just forget the details.
Here is my commands tried:
make TARGETARCH=amd64 HOSTARCH=amd64 CC=x86_64-linux-gnu-gcc CGO_CFLAGS="-I/usr/include/"
make TARGETARCH=amd64 TARGETVMARCH=amd64 CC=x86_64-linux-gnu-gcc CGO_CFLAGS="-I/usr/include/" GOARCH=amd64
make TARGETARCH=amd64 TARGETVMARCH=amd64 CC=x86_64-linux-gnu-gcc CGO_CFLAGS="-I/usr/include/"
TARGETARCH=amd64 CC=x86_64-linux-gnu-gcc CGO_CFLAGS="-I/usr/include/" make
TARGETARCH=amd64 CC=x86_64-linux-gnu-gcc LD=x86_64-linux-gnu-ld CGO_CFLAGS="-I/usr/include/" make
TARGETVMARCH=amd64 CC=x86_64-linux-gnu-gcc LD=x86_64-linux-gnu-ld CGO_CFLAGS="-I/usr/include/" make
GOARCH=amd64 TARGETARCH=amd64 CC=x86_64-linux-gnu-gcc CGO_CFLAGS="-I/usr/include/" make
(Just in case: such questions may better belong to our mailing list) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>