返回
快讯

新 Linux pedit COW 漏洞可借缓存二进制提权拿 root

Linux kernel 的 traffic-control 子系统出现 out-of-bounds write 漏洞 CVE-2026-46331,攻击者可在本地未提权情况下借助 act_pedit 污染 page-cache,篡改 /bin/su 等缓存二进制并取得 root。

CVE-2026-46331

Linux kernel 的 traffic-control 子系统里有个 flaw,可以让本地未提权用户在受影响系统上拿到 root。

CVE-2026-46331,外号“pedit COW”,是 packet-editing action (act_pedit) 里的 out-of-bounds write,会破坏 shared page-cache memory。一个公开、可用的 exploit 在 6 月 16 日 CVE 分配后的一天内就出现了。Red Hat 把这个 flaw 评级为 important。

这个 exploit 从头到尾都不会碰磁盘上的文件。它会在内存里污染一组 setuid root binary(/bin/su)的 cached copy,注入一个很小的 payload,然后把被改过的 image 以 root 身份运行。File-integrity checks 看起来都正常,但 root shell 其实已经打开了。

这个 exploit 需要两样东西:act_pedit 可以被 load,以及 unprivileged user namespaces 处于开启状态,这样攻击者就能拿到这个 bug 所需的 namespace-local networking capability(CAP_NET_ADMIN)。

在测试过的 RHEL 和 Debian target 上,这两个条件都存在。

How the Bug Works

Linux 的 tc traffic-control tool 可以用一个叫 pedit 的 action,在 packet 经过时改写 packet headers。做这件事的 kernel function tcf_pedit_act(),本来应该在编辑前先对 data 做一份 private copy,这是标准的 copy-on-write pattern。

它只在最终 offsets 还没确定之前检查了一次 writable range。有些 edit keys 只有在 runtime 才会 resolve 它们的 offset。发生这种情况时,写入就会落到 privately copied region 之外,所以 kernel 修改的是 shared page-cache page,而不是 private copy。如果那一页属于一个 cached file,那个 file 的 in-memory image 就会被破坏。

这种模式很熟悉。Dirty Pipe、Copy Fail、DirtyClone 和 Dirty Frag 都是同一种形状:kernel fast path 往一个它并不独占拥有的 page 里写,page cache 受害。

这里的新东西是入口点。未提权用户可以在 user namespace 里配置 tc actions,这就给了他们 exploit 所需要的 CAP_NET_ADMIN。

Affected Systems

PoC 作者报告说,在 RHEL 10 和 Debian 13(trixie)上可以从未提权提到 root,而且这两个系统默认都开放 unprivileged user namespaces。Ubuntu 24.04 需要把执行路由经过仍然允许 user namespaces 的 AppArmor profiles。Ubuntu 26.04 默认会阻断这条路径,因为它的 AppArmor profiles 限制了 unprivileged user namespaces,不过底层 kernel 仍然是 vulnerable。

修复是按厂商分开的。

Debian 已经通过 security channel 修复了 trixie。Debian 11 和 12 目前仍被列为 vulnerable。

Ubuntu 在 6 月 25 日时把 18.04 到 26.04 的受支持版本都列为 vulnerable。

Red Hat 把 RHEL 8、9 和 10 列为 affected;RHEL 7 没有列在 bulletin 里。

What to Do

安装打好补丁的 kernel 并 reboot。优先处理那些“local user”不代表 trusted user 的系统:multi-tenant hosts、CI/CD runners、Kubernetes nodes、build workers,以及共享的 research 或 lab machines。

如果你暂时还不能 patch,有两个 mitigation 可以切断 exploit chain。对于不需要 tc pedit rules 的系统,先检查 module 有没有在用(lsmod | grep act_pedit),然后阻止它被加载:

echo 'install act_pedit /bin/true' | sudo tee /etc/modprobe.d/disable-act_pedit.conf

或者,disable unprivileged user namespaces(RHEL 上用 user.max_user_namespaces=0,Debian/Ubuntu 上用 kernel.unprivileged_userns_clone=0)。这样会移除 exploit 所需的 namespace-local capability,但也会破坏 rootless containers、一些 CI sandboxes,以及 sandboxed browsers。先测试。

因为 overwrite 针对的是 cached memory,file-integrity checks 可能抓不到它。清掉 page cache(echo 3 > /proc/sys/vm/drop_caches)可以清除被污染的 in-memory copy,但对攻击者已经打开的 root shell 没有影响。要把这台 host 当成已经 compromised。

这个 fix 在 5 月底就已经进了 netdev mailing list,当时被描述成一次常规的 data-corruption patch。那个可被利用的细节在 public mailing list 上挂了好几个星期。没有 CVE,也没有 security warning。等 fix 在 6 月 16 日合并时才分配 CVE。武器化的 proof-of-concept 在一天内就跟着出来了。对于 kernel page-cache corruption bugs 来说,等 scanner rule 太慢了。