[PR #258] compat: detect RHEL 10 backports from kernel headers #265

Open
opened 2026-10-13 21:08:07 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/258
Author: @ih-v
Created: 10/2/2026
Status: 🔄 Open

Base: master ← Head: compat-rhel10-backports


📝 Commits (1)

  • 2b08754 compat: detect RHEL 10 backports from kernel headers

📊 Changes

2 files changed (+26 additions, -5 deletions)

View changed files

📝 src/compat/Kbuild.include (+21 -0)
📝 src/compat/compat.h (+5 -5)

📄 Description

EL10 kernels report 6.12 in LINUX_VERSION_CODE but carry APIs from 6.15–6.18, so several version-gated shims in compat.h collide with the real thing. This detects each backport from the kernel's own headers in Kbuild.include, the way crypto_memneq and addr_gen_mode are already detected, and skips the shim when the kernel has it.

Fixes #173.

RHEL 10.0 RHEL 10.1 RHEL 10.2 CentOS Stream 10 (6.12.0-271)
timer_container_of – – ✓ ✓
netif_threaded_enable – – ✓ ✓
WQ_PERCPU – – ✓ ✓
struct sockaddr_inet – – – ✓
struct rtnl_newlink_params – – – ✓
build of master today ✓ ✓ ✗ netif_threaded_enable ✗ three redefinitions

One of these does not show up as a build failure: WQ_PERCPU is an enum on these kernels, so #define WQ_PERCPU 0 quietly replaces the flag that b72bb7a6 started passing.

A check on RHEL_MINOR would not work instead. The backports differ between minors, and Stream already has two that no released RHEL has yet.

Testing. Built against kernel-devel of RHEL 10.0 (6.12.0-55.9.1, 55.43.1), 10.1 (124.8.1, 124.56.5), 10.2 (211.7.1, 211.56.1) (AlmaLinux packages, first and latest of each minor) and CentOS Stream 10 6.12.0-271: no errors, no redefinition warnings. Without the patch, 10.2 and Stream fail as above, and 10.0/10.1 build either way. On Stream the patched module was also loaded and passed an end-to-end run, including a handshake with amneziawg-go v3.1.20260828 using a 3.1 profile (header protection, S1–S4, H ranges, I1). Mainline kernels take the same paths as before: the version check still decides first.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/258 **Author:** [@ih-v](https://github.com/ih-v) **Created:** 10/2/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `compat-rhel10-backports` --- ### 📝 Commits (1) - [`2b08754`](https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/commit/2b08754122dab62bde5518e572869b62d099aefb) compat: detect RHEL 10 backports from kernel headers ### 📊 Changes **2 files changed** (+26 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/compat/Kbuild.include` (+21 -0) 📝 `src/compat/compat.h` (+5 -5) </details> ### 📄 Description EL10 kernels report 6.12 in `LINUX_VERSION_CODE` but carry APIs from 6.15–6.18, so several version-gated shims in `compat.h` collide with the real thing. This detects each backport from the kernel's own headers in `Kbuild.include`, the way `crypto_memneq` and `addr_gen_mode` are already detected, and skips the shim when the kernel has it. Fixes #173. | | RHEL 10.0 | RHEL 10.1 | RHEL 10.2 | CentOS Stream 10 (6.12.0-271) | | --- | --- | --- | --- | --- | | `timer_container_of` | – | – | ✓ | ✓ | | `netif_threaded_enable` | – | – | ✓ | ✓ | | `WQ_PERCPU` | – | – | ✓ | ✓ | | `struct sockaddr_inet` | – | – | – | ✓ | | `struct rtnl_newlink_params` | – | – | – | ✓ | | build of `master` today | ✓ | ✓ | ✗ `netif_threaded_enable` | ✗ three redefinitions | One of these does not show up as a build failure: `WQ_PERCPU` is an enum on these kernels, so `#define WQ_PERCPU 0` quietly replaces the flag that b72bb7a6 started passing. A check on `RHEL_MINOR` would not work instead. The backports differ between minors, and Stream already has two that no released RHEL has yet. **Testing.** Built against kernel-devel of RHEL 10.0 (6.12.0-55.9.1, 55.43.1), 10.1 (124.8.1, 124.56.5), 10.2 (211.7.1, 211.56.1) (AlmaLinux packages, first and latest of each minor) and CentOS Stream 10 6.12.0-271: no errors, no redefinition warnings. Without the patch, 10.2 and Stream fail as above, and 10.0/10.1 build either way. On Stream the patched module was also loaded and passed an end-to-end run, including a handshake with amneziawg-go v3.1.20260828 using a 3.1 profile (header protection, S1–S4, H ranges, I1). Mainline kernels take the same paths as before: the version check still decides first. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amneziawg-linux-kernel-module#265
No description provided.