From nobody Tue Nov 17 17:05:54 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jTWMk54l1z71Rqm for ; Tue, 17 Nov 2026 17:05:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTWMk2G53z4JJN for ; Tue, 17 Nov 2026 17:05:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVmGfAnQCKql/q890xaBggl/PHHvfj0EJLgtWim22F8=; b=EadcWj5w7SFTXFcOGUK2s2AtJPmWqmIvwpp3MKE6Xx0AonV7HtJqrRo9bkurhnkLUGzdpd RsssxHAI/381lRqChWIEeDZLFmec/tPzUtNzHTBDLdI0zSwXaNKQiI+jdvw/3USbVK79aP VIbo1zLKkXh/w02I2T+sFtVO6BFCg6sby2n9j5CoboQgZ0HPyBXZwu6ADeS02PuFiS1iLf KHAOg411H5hUjxb4kfKf00x9dBysCp46AA3a+tG4NeX0Wd3ndd+pgnZbLRs/5KDlMbp5Yx +VLTYKofCbPdXFbQitEtrlUOHMZ2YlhsKUmbdTfjXC3oBb5ARg6VbXRdwBBJ/Q== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794935154; b=dJGlZN0fHqlN/bWgBSMw75IIz/fIb9SN7I6wIHQqPiV+LoQifF1VKizrlVC678BkJV9XLm Yvwddc0bAHK1AUG50HMIzP3Htax71KjSlra52bWfD48+/hyomFeCLjkL+uEXPz7hKEI5k6 ez9aD4VeIekiK+t2K0Mud4Xj/ZdAyt+cZqUJ1EioTo8pC5J1ZPX1FbGNq3z6OHcb4NXvZW vKe0vDk8ynehGgJfTyHt+IldPY+w4ENGMUP88NFmc84ccLBCk/VIoXOMJO7sDwNoFqMDvS K9xhblzUylBT3awRXN2XLG0JB8eWwrOwwz01yyONFbBLVbHBK+Kvo9YU2khEvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVmGfAnQCKql/q890xaBggl/PHHvfj0EJLgtWim22F8=; b=YlcKlZRDyBiD6XEZyxsG0IPemaa4kW8g9FDfP4Si4eB72sD4KRpj6dcS51C2zGoGweyKMl 97JOdRDOgoEuh6OjjYwzR2dzaY2b3w+XzaQ6CmOxsh7kQqcCGTf8alibhwppFHtZzG6K+A zSq18Vce4S9DKmd9iyeJ0mNlaJ+mQcdqWd6NjldI+uPpJkzZqHkX85HNmbDIsVa9ti96uX NJ9GdZw2Dk0/Aj4M7hXmXGybm8Z4bjk8eWNCC/pIvzkpdWqWruDbyoqNMClmHVBjUdyJOI 0jE751lIQFjz4o1Eo6l5PYF8GGSH8dR6me5yGJONijrd5OsQ4+RR3apDE16tPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTWMk1q32zrjj for ; Tue, 17 Nov 2026 17:05:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1dfb3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:05:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 70a1a5a088ab - stable/15 - inotify: Make the oneshot watch lookup stricter List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 70a1a5a088ab3620706a5b88c681814d61593f5b Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:05:54 +0000 Message-Id: <6afc8972.1dfb3.59956282@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=70a1a5a088ab3620706a5b88c681814d61593f5b commit 70a1a5a088ab3620706a5b88c681814d61593f5b Author: Mark Johnston AuthorDate: 2026-10-28 19:31:13 +0000 Commit: Mark Johnston CommitDate: 2026-11-17 16:57:22 +0000 inotify: Make the oneshot watch lookup stricter inotify_log_one() needs to handle one-shot watches, which are removed from the inotify descriptor after the first event. To handle races with a close of the inotify descriptor, which frees all watches, it re-looks up the watch in the descriptor's watch tree, which is keyed by the watch descriptor number. inotify_log_one() assumed that presence of the watch descriptor in the tree meant that the watch on which it is operating is also present in the tree. However, watch descriptors are 32 bits wide and malicious userspace can trigger descriptor reuse such that this assumption is false, and inotify_log_one() ends up freeing the wrong watch, resulting in an exploitable use-after-free. Approved by: so Security: FreeBSD-SA-26:80.vfs Security: CVE-2026-101316 Fixes: f1f230439fa4 ("vfs: Initial revision of inotify") Reported by: OpenAI Security Research Team Sponsored by: The FreeBSD Foundation --- sys/kern/vfs_inotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index fe9dedfaa942..fceadce25515 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -660,7 +660,7 @@ inotify_log_one(struct inotify_watch *watch, const char *name, size_t namelen, * responsible for freeing it. */ key.wd = watch->wd; - if (RB_FIND(inotify_watch_tree, &sc->watches, &key) != NULL) { + if (RB_FIND(inotify_watch_tree, &sc->watches, &key) == watch) { RB_REMOVE(inotify_watch_tree, &sc->watches, watch); inotify_unlink_watch_locked(sc, watch);