From nobody Tue Nov 17 17:09:35 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 4jTWRz4XG6z71SKZ for ; Tue, 17 Nov 2026 17:09:35 +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 4jTWRz2VgHz4Q06 for ; Tue, 17 Nov 2026 17:09:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935375; 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=IawAH8YZyuHESIVKb9fnSL3QsWsAsjwYT185uHf09Uw=; b=aKqrbSZPOy0NpbSjrjZNaT9cof8kXXG6zsxJ2OrMWjehNBKZmtYa9XitD0iS4ahkWPYNfk 6HEHUFArt9ljhjr3htJvfI9hfWUSG+gFE+62+0ZuGd/6F6QxQZMdNHNcutO966D/xQdma5 XbCJHdxHDEtBIFmrJciArkf8oV/Ntw4GM2Wy4uhLbZXADJWp+ercFzezDeSUFGNJwaFYvD qPBtQWWIwxPc1qc6zQflX8ZOsb8Nm9WWeAcOld+mPTqx+bfXkYXJQd3kK/omx3KkVySY/b MS7+fsf9k3d0IdCfVziTZHH4TZi+W+QS5Js8cpnsSMJZRbmcVkFWF3noCdRIKg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794935375; b=hBuJFDgQyheA8hImGpgtwa+/M9OUt0fimRNLuKBzkYd6SUk4yxeBSS61LGPcHnQUZdlytH jmkV7GULRd4rQZsFDTrlmNpOJyiKNQSR28CpAj6Dh/WUQ3/lZ5zXJxdMjJCde1XsMoRgMs 0wHPxtort4llwgrGfLTs3sAQQv+y4rH3lW7JxU/nQhIs8zQ8HOWHESJnUQNLhQPUSq2brS OSjrsIi8KtKIzMab2VRqDsm70zbuAzdVLdxItPAxvZgX8vEsIqmcavKi5VNW7Wa08R/o8t j9M1WiupFbxkhUJAfmkSqpWeYtuwCxSK0tiD2yVvBY/5eImGDYazuOt1d17OZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935375; 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=IawAH8YZyuHESIVKb9fnSL3QsWsAsjwYT185uHf09Uw=; b=OLgD5whGJ95vfjgfVuQylFgb0pYdu16enT3P6FprGmrmaw2gyiCJOUHPe9yf4aZQzQM7Ip hbEhtf/CubSSGd+G7LZrFV33SZ92drXcepteu7cOM0mYi+xBh3aFGbwy9AAAwF9fRYk6Co HhaBfZc7QztuV2nbgoMO8SrNVXLs4bjvpHOWqdVqVuS+dfiXMklhaIzi7AkdO7VDx8LKpt jqxE/l9YTMcV0FpuEVKuo7KPbZwveKe6cddOzuomKJ4irxerVkgSefutFeipGTomdcF9rL 2iYzgkoq+4eCn6G1upC8fXsJL69m6UFUPFyysyuCH4Ny13tq4eBOdw5ZJ/VU5w== 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 4jTWRz278zzrwD for ; Tue, 17 Nov 2026 17:09:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f1cf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:09:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2a61bc857f23 - releng/15.2 - 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.2 X-Git-Reftype: branch X-Git-Commit: 2a61bc857f23440bb51dee4555c11727adc038f9 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:09:35 +0000 Message-Id: <6afc8a4f.1f1cf.24c68fc6@gitrepo.freebsd.org> The branch releng/15.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2a61bc857f23440bb51dee4555c11727adc038f9 commit 2a61bc857f23440bb51dee4555c11727adc038f9 Author: Mark Johnston AuthorDate: 2026-10-28 19:31:13 +0000 Commit: Mark Johnston CommitDate: 2026-11-17 13:34:30 +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: re (cperciva) 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);