From nobody Tue Sep 29 16:00:04 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 4hvNDN598kz6tlHV for ; Tue, 29 Sep 2026 16:00:04 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hvNDN2SgPz4gmK for ; Tue, 29 Sep 2026 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790697604; 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=416Ci1W+2S4vUUMJpMo+1yh//F9zUfs1Gnw4UBx9Pvg=; b=xe/kyP2V4f58UM1BVPmCywHoZFxcQvIbb29BvBf72B4NnuwZqLqrbHzhm9Kqt4iEu13SvF GBL13c90jf1LXUxJu4ZTO21ffZOs8/SiOy4aGxBtb+XMoGEa1LnWJhtYGfAw2B2vb4F2G9 dHd6Hf5qAmFiBxmsYsvyqYMs0399fLzweQgyRJ1SWiS65mX2yWoE+k2246qusmd331YVM/ 9iTJBW1Bvxvr2RS05C1Dqj4HEJm1kesAdj+Rp0fgI+abw781nzZkPb6hUUp54auJgo25Nf ynm9me2JkysrR3axO6SOv0jRl2Pz8Tuehutt6HGc9qVCBpA7WMSD5pUmsn4eMA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790697604; b=Je9Yi1+u95vFQtlN3gxITLe3wDJ8kbj/FLo66ATy2KZOARseBYrf9xVtNd4ir4z9Si8RdD N66lvjT6+fTFgKcNMERYf6aOfKxBbv/SzQT8P9LDccTKQfDMA6jwmFCxGTPt/bDDA2wG2G KFa8Y5pfeuRqOTmyhna6oFKJ6qlgwuY2Gp2+Ecr32gnfn3YgynLcNgaZW08yGtFuffAEkh rnGTswQiB/IfbZeqSQsSv+GtwNBNzf0JnyjojCX6xujXOcmfZPmv4SxoJI4tbSMSR0eR0D 3CPTf1ul645SmDWj7MiWESzNB0j/F3LwwhPRZTvGA+CJv1+kKGUY/TEm4y/BLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790697604; 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=416Ci1W+2S4vUUMJpMo+1yh//F9zUfs1Gnw4UBx9Pvg=; b=lN37mn/0vZnOhDUgk7fA1Oojh+IieAVXineqKBHRRNvFHEuvZ3Fad/TUbkRcKyPafBAHoY D+Z+tKis/hqpT6IotNfWOaUY1l/Pk6vYGgjjieDMLOnApFWKNIziMhB2hcvPvRzY0llnBy KMSZW37bwaf0ixAoaAPCkwA2NGSpFSiUkKHT8fMNnomOaeFk0oEu7tC/OnzXYSTq+c+TgY LWl2IHZTX7fZSjGBdO+9vQghgrp/9fwN40OWLnq8fBhzDMDNGM+8YBT36VYTUMsChWjWJw O4zarsYJXaWCulFBo7N7b078PL3PvLCNYzopPzL4nrPsE5w3A0Gtip3d1LyRiQ== 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 4hvNDN1Phgz1KXb for ; Tue, 29 Sep 2026 16:00:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30515 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 29 Sep 2026 16:00:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2b66c28a0383 - releng/15.1 - kqueue: Fix a potential OOB access in kqueue_fork_copy_knote() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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: 2b66c28a03832c2e2e4f098f8e5f38dd1c46e933 Auto-Submitted: auto-generated Date: Tue, 29 Sep 2026 16:00:04 +0000 Message-Id: <6abbe084.30515.7eb37622@gitrepo.freebsd.org> The branch releng/15.1 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2b66c28a03832c2e2e4f098f8e5f38dd1c46e933 commit 2b66c28a03832c2e2e4f098f8e5f38dd1c46e933 Author: Mark Johnston AuthorDate: 2026-09-28 13:42:54 +0000 Commit: Mark Johnston CommitDate: 2026-09-29 01:01:48 +0000 kqueue: Fix a potential OOB access in kqueue_fork_copy_knote() Here, fdp points to the new fdtable, copied from that of the parent process. There is a window after the fdtable is copied, and before kqueue_fork_copy_knote() runs, where a different thread in the parent could have grown the parent's fdtable and registered a knote with ident larger than the size of the child's fdtable. This race can lead to an out-of-bounds read. Add a bounds check for this case; skip the knote if it is referencing a non-existent file. Approved by: so Security: FreeBSD-SA-26:65.kqueue Security: CVE-2026-58100 Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59916 --- sys/kern/kern_event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index ec9036bd30de..11348a443737 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -3097,7 +3097,8 @@ kqueue_fork_copy_knote(struct kqueue *kq, struct kqueue *kq1, struct knote *kn, } fop = kn->kn_fop; if (fop->f_copy == NULL || (fop->f_isfd && - fdp->fd_files->fdt_ofiles[kn->kn_kevent.ident].fde_file == NULL)) + ((unsigned int)fdp->fd_files->fdt_nfiles <= kn->kn_kevent.ident || + fdp->fd_files->fdt_ofiles[kn->kn_kevent.ident].fde_file == NULL))) return; error = kqueue_expand(kq1, fop, kn->kn_kevent.ident, M_WAITOK); if (error != 0)