From nobody Tue Nov 17 17:05:09 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 4jTWLt2Sctz71Rdl for ; Tue, 17 Nov 2026 17:05:10 +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 4jTWLs6wyMz4Gtb for ; Tue, 17 Nov 2026 17:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935110; 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=g1TEHRpqy+5m1cXtmNBYrUvjJJJuENyAxQBxJQRZTz4=; b=yIYI/k9O1QojqFh3co3tH7gIxFO2VuMo2ASLknqT/aOXrNGVEpNJI6rJWRzY+mDLUW4HQb T5Il4laRSmzaLitpQ56nsydbTEQEWiLJaqcLVRd7sxTkNFtVIXSbwiB0U6RTW13PIi8L1A c8roU7Mlw9XASn6qw9nDRMdzoqcLwtFxr7P7NBVLpCitfiODMoqW9vy+30J/C3D/Sm3Z6D rr8W4wk8AWFSj01fbUT+m2Z/iR+VI+4gTY8/gCcELV0KHTU1VRJ/r4xUNDUx7sXG5FCZE8 oPJUeuKsVBhmPSVGVn9pyhYJzB/ULs9GH4YjBOXSipxnpAJrX/eouz+6IENSCw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794935110; b=oVMVpzXApMjk2egE8hC8tFt0C1OjlQW1s26WMUEDKYi72mh92D+wXYpnvmeb11IsZkft3p DNbY3wz+rKEXlK1hxuwTT199OStpL4h91T/Ehem0oMxzAB6lk5auWLzvTFG+I+ddGNUBwm 9KdeFXGZqg8B/8ZWfvBuDhpWzoicTsOstJzj5Ac297p9uOr6cC9Ly14rglNsaLSg4GPkMn pWkQ1LIjAjrdbLEb8KKiE87bMDkCf4U7XWFOqXRu65UgNXBkQ9ZfJ7UN7yDMPzMS05It2z DptMhnYP6w9NNRaOPegMFiKGGyQs0m7/YXIs/PJ2AOPbMo7A1FkR7e6tTFZRIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935110; 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=g1TEHRpqy+5m1cXtmNBYrUvjJJJuENyAxQBxJQRZTz4=; b=VC1e3aKmIb0g4kiyNQzV63NavEgJBv9nbBhhH5+PkSWo+gwkSqMAB85IIm7y/4iRJ/vZId ZdbMscHa1RfoKBYwXwR2VTelRmUWUjkPO/j929UIovybE8WT4UUUDt8qHTxtIet6MKTLYV NJzpIjxQYX4C3tBKCcz1Xd7WxK9G++iBoQwcsR9TGqayVzhi+eJxOVTZmH07Nztpq4O7/g 76sXwmWxoAV7kfla5amRzI/KR0nVJJsIl6T73IZY0lC5TpMJ5MIHPLZcrzAydsFFn/OlHd KtUG9qbcl0H4w16CjHgRY66WsUb94vh6sRihg3s7KVjEp7X3yyUOLAvWdXda5Q== 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 4jTWLs66ygzrVY for ; Tue, 17 Nov 2026 17:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f590 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:05:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0a039d79a3ba - releng/14.5 - 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/14.5 X-Git-Reftype: branch X-Git-Commit: 0a039d79a3ba7acd2adf3bdb96daceae26ea12fd Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:05:09 +0000 Message-Id: <6afc8945.1f590.389288b2@gitrepo.freebsd.org> The branch releng/14.5 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0a039d79a3ba7acd2adf3bdb96daceae26ea12fd commit 0a039d79a3ba7acd2adf3bdb96daceae26ea12fd Author: Mark Johnston AuthorDate: 2026-10-28 19:31:13 +0000 Commit: Mark Johnston CommitDate: 2026-11-16 21:17:12 +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 2360b59b57f0..e0321102039b 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -656,7 +656,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);