From nobody Tue Nov 17 17:08:10 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 4jTWQM39v4z71SLH for ; Tue, 17 Nov 2026 17:08:11 +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 4jTWQL47p8z4MpX for ; Tue, 17 Nov 2026 17:08:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935290; 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=Yq97uG24HKyB7GaE+SSlAj8IBSdJVJIvdGrua77rK0k=; b=ncm1YYubB9vkTEl9ADmkK3VfDmeWTycjoWpVD/bhxKCdqscexLKi+gLY/J0TJLD1/r8oQy DaliGBNEDMDFLW78fxuBxx2XrxsBGxaBtMIwnZ+KtkTGItaUcS5jCHWEsaJarYDLDXWZ4p MkHf2Q2JpvZWaFsdLa8iy37KUVNkoae6UmOrNhUzlkw2cn3DFUnxtjQVyaeid9U7OPiszt NIqZvJK+4BuLgLQ8CMF6SjvpPdapfIrBI44OzwkLYnFZYMge9xy1FLcQjJ4Gf16ICZWRr1 rXQL3gWhQSdt5zpWfluABBX8tCs5CSLy33qdjhBgv+K6cz07s6jwgojrK2ittA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794935290; b=yeVa44400lIMREsNjy/oWXVXQE5zIgnD8yijtJvwHKtd3F6vkt34pil5BGu4+jtEBQP6zd wsjf1eoZVUVH1KHAd6l3PDIxuJVXuVsg9CtB3bCzJwdO/9CoGkzu9yRONfw+kueQcbYUW4 Uw2xY0O2K9wUqCEEpYSfLZcjs2dO14eMpAsg+gAFGSAOlINsHENQsL/YSwGzjriqe2uGHe U78rUc8EpF0eUwajUkWGmk9hLK+luWEoQSo3K6GCqNMj8P1KI9Mq07gVEtvyrYFrHY2ZIu nHsm2dsxUm49B/1qjcXQzMZIJq/kmoMhjy3nAA1EjB01sbUOMqBCqWKeEfCKfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935290; 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=Yq97uG24HKyB7GaE+SSlAj8IBSdJVJIvdGrua77rK0k=; b=F1w5a9IsDrJeLptSdzTBbtfH/8e97GO7wDs5PCWSvc2Okidstt+qsCn65SFwBbybim9B4T Jq7AejQCpWeH97S2UUhasUM67543wMsW02UQxU7SR26gquKHgI1SuqJhCAA/hmkyovfR0S xPjLTEX/rUtslRMWYqX7VqTe2iq6V1T0yMhumQwZIPZTXQ1qF5IqwwriaroOjFzBDuVkcD ZdVk+F5M33HhQQIyD6h7gUuGzV7fYPKaewUy3KzikpOu59tO+hdulLiuAds4uuTIAmJUwU Al63rl6Jdgjwni+/vKIQSOkAO7P2YiIcwxhFVSN2YbuR+LGzfMlEAfUtJJ/a/g== 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 4jTWQL3fKWzrnC for ; Tue, 17 Nov 2026 17:08:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ef by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:08:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 63606856baec - releng/15.1 - 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/releng/15.1 X-Git-Reftype: branch X-Git-Commit: 63606856baec49d05ab0fdb54e08b5cddbb3d192 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:08:10 +0000 Message-Id: <6afc89fa.1ef.31bec648@gitrepo.freebsd.org> The branch releng/15.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=63606856baec49d05ab0fdb54e08b5cddbb3d192 commit 63606856baec49d05ab0fdb54e08b5cddbb3d192 Author: Mark Johnston AuthorDate: 2026-10-28 19:31:13 +0000 Commit: Mark Johnston CommitDate: 2026-11-16 21:21:09 +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 94e65973a36b..10dd42ff1118 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -649,7 +649,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);