bitVakt

Kernel Kit / Infix / v26.10.0latest

CVE-2026-99281

7.8high

linux6.18.60 · 6.18.54 · 6.18.8 · 6.12.21in 4 of 4 releases

Not yet analysed by NVD. Matched on the vendor's record; this may change when NVD has analysed it.

Reach linux · 8 builds in 4 of 4 releases

full reviewcross-check✓ a member decided

Description · NVD

tun: Require CAP_NET_ADMIN to attach to an ownerless device

Twenty years ago I made creating a tuntap device require CAP_NET_ADMIN in commit ca6bb5d7ab22 ("[NET]: Require CAP_NET_ADMIN to create tuntap devices.")

The idea was to allow the permissions on /dev/net/tun to be relaxed to 0666 and thus allow owners of tun devices assigned with TUNSETOWNER to actually open it and get at their devices.

What we missed at the time was that persistent devices with *no* owner were already essentially world-consumable, and anyone who could open the device node could also attach to those.

Even then, using persistent devices with no explicitly set owner — on the (false) presumption that CAP_NET_ADMIN would be required to open them — wasn't an egregious userspace bug. There are cases where it does make sense to separate the creation/configuration of the netdevice, from the process which shovels packets into it.

Since then, TUNSETGROUP was added a year later in commit 8c644623fe7e ("[NET]: Allow group ownership of TUN/TAP devices."). Its commit message noted that if both uid and gid are set, both have to match (in itself a bizarre choice) — but still not that with *neither* set, no permission at all was required.

Then in 2012 commit c8d68e6be1c3 ("tuntap: multiqueue support") allowed new queues to be attached to a device from the moment of its creation, with no way for userspace to close the race between creation and a subsequent TUNSET{OWNER,GROUP}.

In 2024, commit 3ca459eaba1bf ("tun: fix group permission check") tried to fix things to be saner: only require the user *or* the group to match, in line with standard POSIX permissions, and require CAP_NET_ADMIN if neither the user nor group authorised the access (although it put the CAP_NET_ADMIN check first, and would wrongly have reported the capability as having been used even when it was not).

That fix was reverted in commit a70c7b3cbc06 ("tun: revert fix group permission check") due to allegedly causing a regression in an selinux test suite which *expected* the attachment to succeed when authorised by none of user, group, nor CAP_NET_ADMIN: https://lore.kernel.org/netdev/CAFqZXNtkCBT4f+PwyVRmQGoT3p1eVa01fCG_aNtpt6dakXncUg@mail.gmail.com/

We should not break UAPI. But we don't have to consider an selinux test case which deliberately exercises a security flaw to be UAPI worth preserving either. To which end, I have fixed it in selinux-testsuite commit b2f894f0016b ("tests/tun_tap: set an owner on the device for the relabel tests").

So: fix the lack of CAP_NET_ADMIN check on devices which *haven't* been assigned an owner or group, while leaving the weird tun ownership model as it was (user *and* group have to match, if both are set). If someone still wants to fix the latter (which wasn't actually the reason the previous attempt was reverted), they can do it under separate cover.

Permit attaching to an existing device only if an owner and/or group was set and the caller matches all that were set, or if the caller has CAP_NET_ADMIN. The only behavioural change is that a device with no owner or group now requires CAP_NET_ADMIN to attach — precisely the loophole we want to close.

And put the CAP_NET_ADMIN check in the right place this time.

Published 2026-11-07NVD

CVSS 3.1Local · low privileges · no user interaction

How it is reached

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None

What it costs

Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References 4
Review Bv26.10.0x86_64Not exposedFable 5.2 · medium confidence · 2026-11-19

The unfixed permission check is present in this build: tun_not_capable() in drivers/net/tun.c only demands CAP_NET_ADMIN when an owner or group is set and does not match, so an ownerless persistent tun/tap device can be attached to by any process that can open /dev/net/tun. The driver is built as a module (CONFIG_TUN=m) and the device node is world-accessible (eudev sets mode 0666).

However, nothing in the product creates a tun/tap device. There is no tun/tap interface type in the YANG model, no tun/tap user was found in src/ or the rootfs overlay, and OpenVPN, slirp4netns, QEMU, tinc and similar packages are not selected. Podman uses the CNI bridge backend, which uses veth pairs rather than tun.

Reaching the flaw therefore needs two things outside the management interfaces: someone with root or CAP_NET_ADMIN creating a persistent tun/tap device without an owner (for example ip tuntap add from a root shell, or a privileged container), and a separate unprivileged local account with a real shell to attach to it. It is not reachable from the network.

Evidence 12
  1. Old check: returns true only if a valid owner or group mismatches AND the caller lacks `CAP_NET_ADMIN`. With neither set, no capability is required. This is the pre-fix logic the CVE describes.

    output/build/linux-6.18.60/drivers/net/tun.c:513-521 (tun_not_capable)

  2. Attaching to an existing device is gated only by `tun_not_capable()` and the LSM hook. Only the create path (line 2772) requires `CAP_NET_ADMIN` unconditionally.

    output/build/linux-6.18.60/drivers/net/tun.c:2726-2749 (tun_set_iff)

  3. The kernel source is 6.18.60, matching the CPE. The match itself is correct.

    output/build/linux-6.18.60/Makefile:2-4

  4. No patch in this directory touches `drivers/net/tun.c` (grep for the path returned nothing), so no local backport of the fix.

    patches/linux/6.18.60/

  5. `CONFIG_TUN=m` and `CONFIG_TAP=m`: the driver is built as a loadable module (also `board/x86_64/linux_defconfig:287`).

    output/build/linux-6.18.60/.config:2139-2140

  6. `drivers/net/tun.o` (and `tun.mod.o` at line 22630) were produced by the build.

    output/objects.txt:22207

  7. Misc device with nodename `net/tun`, so the node exists as a static node and opening it can autoload the module.

    output/build/linux-6.18.60/drivers/net/tun.c:3495-3500 (tun_miscdev)

  8. `KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"`: any local user can open `/dev/net/tun`.

    output/build/eudev-*/rules/50-udev-default.rules:88

  9. Configurable interface types are bridge, dummy, ethernet, gre, gretap, vxlan, wireguard, lag, loopback, other, veth, vlan, pppoe, modem and wifi. There is no tun/tap type, so the management interfaces cannot create a tun/tap device.

    src/confd/yang/confd/infix-if-type.yang:76-158

  10. `BR2_PACKAGE_SLIRP`, `BR2_PACKAGE_SLIRP4NETNS`, `BR2_PACKAGE_QEMU`, `BR2_PACKAGE_OPENVPN` and `BR2_PACKAGE_TINC` are not set. No userspace tun/tap consumer is in the image.

    output/.config:2778-2779,3113,3435,3499

  11. `network_backend = "cni"` (bridge conflist installed by `package/podman/podman.mk:86`): container networking does not use tun/tap.

    package/podman/unconfined.conf:2

  12. The user `shell` leaf defaults to `false` (login disabled) and warns against `bash`/`sh` for non-admin users. An unprivileged local shell account exists only if an operator configures one.

    src/confd/yang/confd/infix-system@2026-10-01.yang:596-603

Version and patches

The tree is linux 6.18.60 and still carries the pre-fix tun_not_capable(). None of the patches under patches/linux/6.18.60/ touches drivers/net/tun.c. The fix commits referenced by the CVE are not available in this tree, so I could not confirm the first fixed 6.18.y release; it must be later than 6.18.60.

Recommendation

Document as not exposed in the default product; no urgent backport is needed.

Pick up the fix with the next routine 6.18.y stable bump that contains the tun: Require CAP_NET_ADMIN to attach to an ownerless device commit. The fix is a small, self-contained change to tun_not_capable() in drivers/net/tun.c, so it is cheap to backport if a customer deployment is known to use tun/tap inside containers together with unprivileged shell users.

Open questions

Which 6.18.y release first contains the fix could not be determined from the tree.

I did not check whether an operator-deployed container can be granted CAP_NET_ADMIN and host networking through the container YANG model. If it can, such a container could create an ownerless persistent tun/tap device in the host network namespace. An unprivileged local shell user would still be needed to exploit it.

The search for tun/tap users covered src/, board/common/rootfs, package/ and the selected Buildroot packages by keyword. It did not cover the full contents of the generated target rootfs.

Review Av26.10.0aarch64_minimalNot exposedThe build is affected at source level: drivers/net/tun.c still has the vulnerable tun_not_capable() and is compiled as a module (CONFIG_TUN=m).Open the review →

Members of Kernel Kit decide. Sign in if you are one.