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 Av26.10.0aarch64_minimalNot exposedFable 5.2 · medium confidence · 2026-11-19

The 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).

The flaw only matters when a persistent tun/tap device with no owner or group already exists and an unprivileged local user attaches to it. Nothing in this image creates such a device: no finit service, no confd interface type, and no tun-using package is selected in aarch64_minimal_defconfig. No YANG node or CLI command creates a tun/tap device, so USED_WHEN_ENABLED does not apply.

Reaching the bug would require an administrator to create an ownerless persistent device by hand from a root shell (for example ip tuntap add without user/group), plus a second, unprivileged local shell account. It is not reachable from a network interface; the attack vector is local only.

Evidence 10
  1. `tun_not_capable()` is still the pre-fix form: `CAP_NET_ADMIN` is only required when an owner or group is set and mismatches, so an ownerless device needs no privilege

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

  2. `tun_set_iff()` uses that check as the only gate before `tun_attach()` on an existing device

    output/build/linux-6.18.60/drivers/net/tun.c:2741

  3. Tree is 6.18.60

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

  4. The only applied patch matching "tun" is an unrelated MMC SDR tuning patch; none touches `drivers/net/tun.c`

    output/build/linux-6.18.60/.applied_patches_list:98

  5. `CONFIG_TUN=m` (also `board/aarch64/linux_defconfig:329`)

    output/build/linux-6.18.60/.config:2393

  6. `drivers/net/tun.o` and `tun.mod.o` (line 19670) were built

    output/objects.txt:19508

  7. `/dev/net/tun` is a static node with mode 0666, so any local user can open it and autoload the module

    output/target/usr/lib/udev/rules.d/50-udev-default.rules:88

  8. `BR2_PACKAGE_OPENVPN` is not set; likewise `BR2_PACKAGE_QEMU` (3067), `BR2_PACKAGE_SLIRP4NETNS` (2737) and `BR2_PACKAGE_PODMAN` (5180)

    output/.config:3372

  9. Interface back-ends are `if-bridge.c`, `if-gre.c`, `if-lag.c`, `if-modem.c`, `if-ppp.c`, `if-veth.c`, `if-vlan.c`, `if-vxlan.c`, `if-wifi.c`, `if-wireguard.c`; there is no tun/tap type

    src/confd/src/

  10. The only tun/tap mention in the rootfs overlay is a comment about skipping virtual interfaces

    board/common/rootfs/usr/libexec/infix/init.d/00-probe:571

Version and patches

The source is unfixed 6.18.60 (output/build/linux-6.18.60/Makefile:2-4) and no applied patch adds the fix. I could not read the upstream fix commits or the CNA affected range from this tree, so the fixed 6.18.y release is not confirmed.

Recommendation

Low priority; pick up the fix with the next 6.18.y stable bump that contains it, or backport the one-function change to tun_not_capable() in drivers/net/tun.c.

Re-triage as higher priority for any defconfig that enables containers, OpenVPN or QEMU.

Open questions

The upstream fix commits and the exact fixed stable version were not available in the tree. The affected verdict rests on the code matching the vulnerable logic the CVE describes.

I did not check whether other Infix defconfigs (those with containers enabled) ship software that creates ownerless tap devices; this review covers aarch64_minimal_defconfig only.

I did not verify whether non-admin shell users exist on a default device. Without one, even a hand-created ownerless device has no attacker to use it.

Confidence is medium because the "nothing creates a tun/tap device" conclusion rests on keyword searches of src/confd, src/statd, src/bin, board/ and package/, not a full read of every package in the image.

Review Bv26.10.0x86_64Not exposedThe 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.Open the review →

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