-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add minimal arm64 kernel build configuration #4568
base: master
Are you sure you want to change the base?
Conversation
In order to prepare adding a minimal config, make a few configs explicit in base.yml. Consequently, drop those from net.yml and subsystems.yml. CGROUPS was always implicitly in all configs, as CGROUP_PIDS and MEMCG in base.yml depend on it, and generation of the configs would have failed. PCI was always implicitly in all configs, as PCI_HOST_GENERIC in base.yml depends on it, and generation of the configs would have failed. Further configs are needed for the Debian bullseye and bookworm image to start properly. None of these additions to base.yml lead to any effective change in the current configs.
When starting up the bookworm user-space image, systemd complains: systemctl status proc-sys-fs-binfmt_misc.mount mount: /proc/sys/fs/binfmt_misc: mount point does not exist Add BINFMT_MISC to base to address this issue. After regeneration, the configs are modified as expected. Fuzzing with these configs should not be significantly impacted due to this config addition.
In order to prepare adding a minimal config, make JUMP_LABEL explicit in kfence.yml. Consequently, drop it from subsystems.yml. JUMP_LABEL is needed for KFENCE_STATIC_KEYS. The changes to upstream-arm-{full,kasan}.config are probably without any significant impact to the current fuzzing.
The new configs upstream-arm64-min-{kasan,kcsan,leak} are intended to create fuzzing campaigns, where the absolute number of uncovered lines of code is minimal. These configs might also be useful for config bisections and understanding which non-reproducible warnings appear even on kernels with very minimal kernel configurations. They are based on allnoconfig, then further configs are enabled to boot a qemu virt generic virtual platform, see https://www.qemu.org/docs/master/system/arm/virt.html. The kernels built with these configs boot with the following qemu invocation on a ARM Neoverse-N1 system: qemu-system-aarch64 -m 8G -smp 4 -cpu host,kvm-no-adjvtime=yes -machine virt,gic-version=host -enable-kvm -append 'root=/dev/vda rw net.ifnames=0' -kernel <kernel> -hda <bookworm-image> -net user,hostfwd=tcp:127.0.0.1:10088-:22 -net nic,model=virtio-net-pci --nographic --snapshot -monitor none
If I'm not mistaken (Cc @dvyukov), that's what our So I think that instead of introducing new config files it'd be much better to make the existing |
@a-nogikh Okay, I can try to reduce the '-base.config' configs and see where we get with that. From my memory of the previous review of the yml config bits and my future plans, I see the following potential changes and challenges to the current base configs to get closer what I am proposing here:
Let me explore and make a proposal to refine the -base configs. Then we can see how far the changes to base configs are acceptable and at which point we would really say that some even more reduced configs simply should be a config by their own, and if they deserve to be maintained in the upstream repository or should be maintained out of tree elsewhere---with getting as much into the mainline repository as possible to reduce the churn. @a-nogikh Let me know if my thoughts are going in the wrong directions, or if some of the changes to base configs are not acceptable from your point of view and the deployment you have. |
Does the resulting kernel still boot on versatile?
I can check it once needed, though if it does not boot, this process may become trickier. The docs list some parameters: Though AFAIK in our case it usually boiled down to
This is okay, we use buildroot for all Linux instances.
This is already out of the Will you need to use all these differently minimal configs (with ext4 and net, without ext4, without net, etc) simultaneously? Or will you will always fully switch to the most minimal?
Sounds good to me! |
The new configs upstream-arm64-min-{kasan,kcsan,leak} are intended to create fuzzing campaigns, where the absolute number of uncovered lines of code is minimal. These configs might also be useful for config bisections and understanding which non-reproducible warnings appear even on kernels with very minimal kernel configurations.
They are based on allnoconfig, then further configs are enabled to boot a qemu virt generic virtual platform, see https://www.qemu.org/docs/master/system/arm/virt.html.
The kernels built with these configs boot with the following qemu invocation on an ARM Neoverse-N1 system:
qemu-system-aarch64 -m 8G -smp 4 -cpu host,kvm-no-adjvtime=yes -machine virt,gic-version=host
-enable-kvm -append 'root=/dev/vda rw net.ifnames=0'
-kernel "kernel-image" -hda "bookworm-image"
-net user,hostfwd=tcp:127.0.0.1:10088-:22 -net nic,model=virtio-net-pci
--nographic --snapshot -monitor none
Before we add those configs, we add some configs to base.yml that have been implicitly part of many of the configs already and which some of the configs in base.yml already depend on.
Further, finally add myself as contributor, as I had time to do some own investigation and development---after being only a product owner to some contributing teams to syzkaller in the past.