Home
Relevant source files
The following files were used as context for generating this wiki page:The gokrazy-kernel-buggy-linux-7_0 repository provides a specialized Linux 7.0 amd64 kernel package for the gokrazy ecosystem. Its primary purpose is to support Tailscale natlab/vmtest environments by intentionally preserving a specific UDP Generic Segmentation Offload (GSO) regression from tailscale/tailscale#19777. This allows developers to test mitigation behaviors in software even if the underlying host kernel has been patched.
Sources: README.md:3-6, empty.go:6-8
Kernel Architecture and Features
The kernel targets the amd64 architecture and is designed to boot under QEMU q35 environments. It includes specific drivers necessary for vmtest images, such as PCI support, virtio block devices, and the Intel igb network driver. The igb interface is specifically configured to advertise tx-udp-segmentation and tx-gso-partial features, which are critical for diagnostic checks within the guest environment.
Sources: README.md:10-15, config.addendum.txt:77-83
Key Subsystem Configurations
The kernel configuration extends the standard defconfig with specific modules required for modern networking and container-like environments:
- Networking: Includes full IPv6 support, nftables, and WireGuard.
- Virtualization: Optimized for QEMU via VirtIO drivers (PCI, Block, Network, RNG).
- Filesystems: Supports Squashfs, which is standard for gokrazy root filesystems.
- Congestion Control: Sets TCP BBR as the default congestion control algorithm.
Sources: config.addendum.txt:1-3, config.addendum.txt:9-12, config.addendum.txt:59-61, config.addendum.txt:109-111
Build Process
The kernel is built using a standalone bash script that automates the acquisition of source code and the compilation process.
The diagram shows the sequential steps taken by the build script to produce a bootable kernel image.
Sources: build-buggy-linux-7_0.bash:4-22
Build Procedure
- Download: The script fetches
linux-7.0.tar.xzfrom the official kernel mirror if it is not present. - Configuration: It initializes the build with
make defconfigand appends custom settings fromconfig.addendum.txt. - Compilation: It executes
make olddefconfigto resolve new dependencies and then builds thebzImageusing all available CPU cores. - Artifact Generation: The resulting binary is saved as
vmlinuzin the repository root.
Sources: build-buggy-linux-7_0.bash:4-22, README.md:23-25
Configuration Details
Runtime Parameters
The kernel uses specific boot parameters defined in cmdline.txt to control initialization and error handling.
| Parameter | Value | Description |
|---|---|---|
root | /dev/sda2 | Specifies the root partition |
ro | N/A | Mounts the root filesystem as read-only |
init | /gokrazy/init | Sets the custom gokrazy init process |
panic | 10 | Reboots 10 seconds after a kernel panic |
oops | panic | Forces a panic on kernel oops |
Sources: cmdline.txt:1
Integrated Drivers
The following table summarizes essential drivers enabled via config.addendum.txt for the vmtest environment:
| Category | Config Symbol | Description |
|---|---|---|
| Virtualization | CONFIG_VIRTIO_NET | Virtio network support |
| Networking | CONFIG_IGB | Intel 82575/82576 (igb) support |
| Networking | CONFIG_WIREGUARD | WireGuard VPN support |
| Storage | CONFIG_SQUASHFS | Compressed read-only filesystem |
Sources: config.addendum.txt:9, config.addendum.txt:60, config.addendum.txt:71, config.addendum.txt:78
Integration with Tailscale
To use this kernel within a Tailscale project, it must be referenced as a KernelPackage in the Go module system.
github.com/tailscale/gokrazy-kernel-buggy-linux-7_0
For local development, a go.mod replace directive is used to point to the local filesystem:
replace github.com/tailscale/gokrazy-kernel-buggy-linux-7_0 => ../github.com/tailscale/gokrazy-kernel-buggy-linux-7_0
Sources: README.md:17-21, empty.go:4-8
Summary
The gokrazy-kernel-buggy-linux-7_0 package serves as a controlled environment for testing network stack regressions. By bundling a specific Linux 7.0 build with custom configurations for QEMU and Intel networking drivers, it ensures that Tailscale's mitigation logic remains functional against known UDP GSO issues.
Sources: README.md:3-6, config.addendum.txt:77-80