From nobody Tue Nov 17 17:02:47 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 4jTWJ82651z71QVP for ; Tue, 17 Nov 2026 17:02:48 +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 4jTWJ759Tdz4BNt for ; Tue, 17 Nov 2026 17:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794934967; 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=3WpJmJGBgAuJaRDz5/qDsnssnZOQtaGZ7xP7wugjxfw=; b=a/5vd9jO3qyX5DL7jx0OBJrbO8RL6RPM/msOc03flSr+SDtBTD87ZbHB3O1UMZsu3hal5J X4NuygxBvPTLrCGlKchCjgfcasv1u3Stq74kn5eQziVBiBT2QjkycaLSqiqs6BmRaoaKw2 baQ7LWG5TL2+RG6jmNc52KSh+ryDvXTK8o45GMHVQbJhXyRLzvkiCASyZOMg3L7Jg7LqPs jbcsS672BMkCRxlmVVcmwFmm7mpCX/MSBOMCFsDiK8+sBWE6WlYHMRE63WETokOJ/8KpNO 53dV5lbjBp4SgInKQrdY0Y/6Xh8DxMxAUHZfwFmsratdkPWNpmTuMt6wGIZg9w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794934967; b=CjDGZdWfrgEuRCwc2calXwbdUAhPTJJsSVJhxkcRk7LEr9AK1oleV4HAjKmVjoqAJ54UD0 PjWcUCjnFZcWit1fFeAWOfWbzh9E5EIENZABjYM2UFFsA67i4b1OIjJUAci4PEbcKYf1tw 1M5j9q/tdFg4dBZZ+8rBCNIsDvTQr98oMUlqwVpT/RNbk4yDIQ5xwPatQq/WHYTlO87+xN eLVgAEpqudVsA+U8CCN3bPh4U6+4Xa6WGiVIq72YHytIqN4xFFRX1sLIPcQPfeukiqnaFf bxvlZqGwpzh7Kb8Yvs7XV/nLPC4iRdc4doZ7UZByNgg3hlrhE+jCTdGmSRYxkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794934967; 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=3WpJmJGBgAuJaRDz5/qDsnssnZOQtaGZ7xP7wugjxfw=; b=ZaTbT3f+xFVTI/1gY0xYDbNnzrTaPDrqOyWomNwX0lYYenmPfg4/X5DrwKMWN6yX+xXi87 6Pn+S3pVgoruMjbkTx5Qv6gZGiYyghf5cuVW9vbd0T2SbWf9boDbH24/EiZA0Hoy8HuhDn o7/1yVslA/Waf5/1L3MbnbAoLe6UAJP7RomasGfJ7kV5B+FaI1k2gROUgBgWOOsy9EKe5j b8RfnROMdU3OvBzizNnFLxn0HoOgPWCWF0JASoiDuG1mkflU+3OK0ONmBvPtvKSAgLhmJe pGN7BdoFjkv7/CpayDF7bWTwxHSudXf7LaNsJHyVJktQXjSen9EsWU7oMAaUZQ== 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 4jTWJ73mCJzrRW for ; Tue, 17 Nov 2026 17:02:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e49a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:02:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8bca0acd376d - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 8bca0acd376d5aa9b1dfc32a5f8b8ad9ca6dea21 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:02:47 +0000 Message-Id: <6afc88b7.1e49a.e0abc92@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8bca0acd376d5aa9b1dfc32a5f8b8ad9ca6dea21 commit 8bca0acd376d5aa9b1dfc32a5f8b8ad9ca6dea21 Author: Mark Johnston AuthorDate: 2026-10-28 19:31:13 +0000 Commit: Mark Johnston CommitDate: 2026-11-17 13:24:10 +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 463fa8690476..0381c9145cbf 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);