forged reply bit triggers WARN_ON in fuse-over-io_uring
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · On 11/20/26 03:12, n3rd wrote:
Hello,
I am reporting a bug in the Linux kernel.
Quoted 7 lines
1. Affected kernel versions
Linux v7.3-rc7 (mainline, tested as 7.3.0-rc7) is affected and was reproduced here. The same code is present in mainline65ba8f34ec88(checked on 2026-10-28,fs/fuse/dev_uring.cunchanged in that area). The v7.2.x and 6.x stable branches were not tested or bisected, so no claim is made about them. The code has been there since the fuse-over-io_uring channel was introduced.
Feel free to send a patch that changes to pr_info_ratelimited().
Thanks,
Bernd
Quoted 83 lines
2. Problem description
fuse-over-io_uring keeps the FUSE request and reply headers in daemon memory. When a daemon commits a reply,fuse_uring_commit_fetch()usescopy_header_from_ring()to copy the 128-bytein_outarea of the ring entry into a kernel buffer; the first 16 bytes are structfuse_out_header(len, error, unique), entirely supplied by the daemon.fuse_uring_out_header_has_err()then validates that header: it only rejects unique == 0, only checks the error range, and at the unique comparison it uses (oh->unique& ~FUSE_INT_REQ_BIT) !=req->in.h.unique, which masks off exactly the bit the laterWARN_ON_ONCEtests. Kernel- generated unique values are always even (fuse_get_unique_locked()addsFUSE_REQ_ID_STEP, defined as 1ULL << 1), so bit 0 is normally always zero; a daemon that replies with unique =commit_id| 1 passes the mask comparison and then necessarily hitsWARN_ON_ONCE(oh->unique & FUSE_INT_REQ_BIT)atfs/fuse/dev_uring.c:653. On a default kernel this prints one WARNING per boot and the reply is still treated as a normal success (err = 0), so there is no memory corruption, no out-of-bounds access, no use-after-free and no privilege escalation. On a kernel built or booted with panic_on_warn=1, which is common for Android, ChromeOS and hardened/cloud kernels, the same single forged bit panics the whole machine, and the user can do it again after every reboot. The legacy / dev/fuse path (fs/fuse/dev.c, interrupt reply branch) handles the very same input as an ordinary error branch and does not warn, which is why this looks like a bug in theio_uringpath rather than intended behaviour.3. Reproducer
A self-contained C program (about 450 lines, static, no libfuse) mounts its own fuse filesystem, answersFUSE_INITwithFUSE_OVER_IO_URING, registers ring entries withIORING_OP_URING_CMDthrough a raw SQE128io_uring, then replies to theFUSE_LOOKUPgenerated by a childopen()with an out header whose unique iscommit_id|FUSE_INT_REQ_BITand commits it. A negative control replies with unique =commit_id(bit 0 clear) through the same mount and the same path. The complete reproducer and the serial logs are available on request; they are not posted here.4. Conditions
Four conditions: (1) fuse.enable_uring=1. That ismodule_param(bool, 0644), off by default and writable by root only; I found no distribution that enables it by default, so an operator has to turn it on for performance, usually via/etc/modprobe.dor the kernel command line. (2) The attacker can open/dev/fuse, which udev's 50-udev-default.rules makes mode 0666 on a normal distribution. (3) kernel.io_uring_disabled=0 and support forIORING_SETUP_SQE128andIORING_OP_URING_CMD. (4) The attacker's daemon completesFUSE_INITand registers ring entries. The attacker does not need root orCAP_SYS_ADMIN; withCONFIG_USER_NSthe whole sequence runs inside an unprivileged user namespace, which is what was tested here (uid 1000, setuid thenunshare(CLONE_NEWUSER| CLONE_NEWNS); the kernel printed CPU: 0 UID: 1000 before panicking). Triggering is deterministic and needs no race. Tested onx86_64, QEMU 6.2 TCG, 2 vCPUs, 2048 MB, initramfs, 7.3.0-rc7, with KASAN enabled as a control that stayed silent.5. Suspected location
fs/fuse/dev_uring.c:fuse_uring_out_header_has_err()(v7.3-rc7 line 653, theWARN_ON_ONCE), reached fromfuse_uring_commit_fetch()andcopy_header_from_ring(); contrastfs/fuse/dev.cline 1947 (legacy interrupt reply handling).6. Suggested fix
Do not assert on a field the daemon controls. Handle it like the legacy
path: if (oh->unique&FUSE_INT_REQ_BIT) {pr_warn_ratelimited(...); err =-ENOENT; goto err; }. A regression test that replies with unique =commit_id| 1 and expects no WARN and an-ENOENTrejection would cover it.7. Mitigation
Keep fuse.enable_uring=0 (the default) and do not enable it for performance; deployments that already enabled it should turn it off and reload fuse. On hardened kernels, setting panic_on_warn=0 only downgrades the panic to a WARNING and does not fix the bug.8. Disclosure
Public. Per the kernel security process this report is being sent to the public mailing list and the fuse maintainers with the security team copied; no embargo is requested and no CVE was assigned here. The reproducer is not posted publicly; it is available on request.9. AI-assistance note
This report was prepared with an AI coding assistant, which was used for source review, for building and driving the QEMU guest used to reproduce the issue, and for drafting this text. Per the kernel security process I am treating the issue as public and am not posting the reproducer.