Repository navigation
Description
Description
pkgs.linuxPackages.gasket fails to build with Linux kernel 7.1+ due to the removal of zap_vma_ptes from the kernel's exported symbol set.
Error
gasket_core.c: In function 'gasket_mm_unmap_region':
gasket_core.c:923:9: error: implicit declaration of function 'zap_vma_ptes' [-Wimplicit-function-declaration]
923 | zap_vma_ptes(vma, vma->vm_start + virt_offset,
| ^~~~~~~~~~~~
The patch we carry for kernel >= 6.13 does not address this. Attempting to use zap_vma_range (which is declared in include/linux/mm.h in 7.1) results in a secondary failure:
ERROR: modpost: "zap_vma_range" [gasket.ko] undefined!
zap_vma_range exists in the headers but is not exported to modules (EXPORT_SYMBOL), so it cannot be used by out-of-tree modules.
Fix
The correct replacement is zap_special_vma_range, which:
- Has the same signature:
void zap_special_vma_range(struct vm_area_struct *vma, unsigned long address, unsigned long size) - Is exported via
EXPORT_SYMBOL_GPL(zap_special_vma_range)inmm/memory.c - Guards on
VM_PFNMAP | VM_MIXEDMAP— satisfied for gasket becausedo_map_region()usesio_remap_pfn_range(), which setsVM_PFNMAP
Suggested addition to patches in pkgs/os-specific/linux/gasket/default.nix:
(fetchpatch2 {
name = "linux-7.1-compat.patch";
url = "..."; # needs upstream commit or local patch
hash = "...";
})With patch content:
--- a/src/gasket_core.c
+++ b/src/gasket_core.c
@@ -920,9 +920,15 @@
*
* Next multiple of y: ceil_div(x, y) * y
*/
- zap_vma_ptes(vma, vma->vm_start + virt_offset,
- DIV_ROUND_UP(mappable_region.length_bytes, PAGE_SIZE) *
- PAGE_SIZE);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)
+ zap_special_vma_range(vma, vma->vm_start + virt_offset,
+ DIV_ROUND_UP(mappable_region.length_bytes, PAGE_SIZE) *
+ PAGE_SIZE);
+#else
+ zap_vma_ptes(vma, vma->vm_start + virt_offset,
+ DIV_ROUND_UP(mappable_region.length_bytes, PAGE_SIZE) *
+ PAGE_SIZE);
+#endif
return 0;
}
EXPORT_SYMBOL(gasket_mm_unmap_region);Upstream status
The upstream repository https://github.com/google/gasket-driver was archived on April 18, 2026 and is now read-only. No kernel 7.x compatibility fixes are expected from upstream. We will need to carry this patch indefinitely in nixpkgs.
The KyleGospo/gasket-dkms fork (which we also referenced for previous compat patches) likewise has no 7.x fix at this time.
Workaround
Until this is fixed in nixpkgs, hosts using gasket can override the derivation locally:
boot.extraModulePackages = [
(config.boot.kernelPackages.gasket.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ./linux-7.1-compat.patch ];
}))
];
Activity
scottrknight commentedon Jul 15, 2026
Thanks for documenting this. I am using the KyleGospo DKMS package on fedora and just edited locally to get it working until (if) that package get fixed.
Integrate patch for 7.x kernels (Fedora 44)
linuxPackages.gasket: fix build with kernel >= 7.1