From nobody Tue Feb 3 14:46:13 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 4f55s65pgQz6PfWV for ; Tue, 03 Feb 2026 14:46:18 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f55s62Sb8z3v0G for ; Tue, 03 Feb 2026 14:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770129978; 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=TjWmIkufXRsIOjI9L1xBK8A9HFO/iZC2fA8Xxgosnts=; b=ZPauxGvhEdylfEPbh1wDkFPOsKlfPWe6iXmbLxWr172J9L24pxq18M4XoslnT3DEym5Zqn x+TZ7kNDyqMfFZATdmmW+iwUm7hBXEMwLnucss8+YH4MHbq/2WvXZnNuUOaUdw/Y0K3eEG BWoQdk2o8rgQqPr3mXKUzGbAx7XkskEkDrlCoZ7z+VJqWwSP69E+5Wp4rOmjWW9lJQnFfH YddQrLuUIWyUXJh6G/b0YQnYGgtW/RT+pJYAXkKVVzlJzJC8ClPC/csMEoneFx86CbCxXe DoAyY1zDUKgTp9FMbNB/RuJ2jpah94NH8kc+WSV34GJ6EoF24Jx9dyKhbNIu6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770129978; a=rsa-sha256; cv=none; b=UqMTi/F06BnB7Q50oAW8vwobBC3yGBWoU4SBuJK/D1BVSKVlrzubSjXPTqWWnRMzxRkLXU 2UMseWd7taS+6VEfLwvOzbWJ0YR+kA04P6eEa7W3Qr3npvNaNQUluXPUlF7Iez1zGo+dpN VOAXiDMR95u8KHp5Ho26WfuquviyWerjI/E/3yM7s/0vZNY3bsySJPJO2tgNotKtNcDRR9 FlmWH7Mxtu/xUj9Xq3a0KcgkGtNlCyzDwSfCrkhaoT4bmwaF6x5djoGi6uP/3VnPb1H2py klWlseU83gt/V+ewSjZ/ElTsLt2/yB31U7GYNHFuv14Mcv1SDEqf0ue0wXSZqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770129978; 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=TjWmIkufXRsIOjI9L1xBK8A9HFO/iZC2fA8Xxgosnts=; b=sOWsyPgBXtlmKHI9XBn9CKahDvXUO7pK72SRxLZXwSyG6bhe8TmOjNuSqC9l49KWLflDSr enzZPSHvp7s+8eey3pr5XXBOd9ywacAmUTDyomd2tTely7MaAY9Ob0khbDRO/bU7xLwHfz UMP0sa31xFC9a5T/HooUrnwl5VNd313YZZyRq7CYQchltCuevLQSvrAZXMmnARw+zHhLk6 5+UlEB1qKx7DSpwHhNfaUhPH9/l4+S2vL2hHQPN31FY4cgEGAZfTm4TQ65Gc20yx0FLuV6 FJ8xx4HrRPfSBRAPMuauv8e5wpEOWJMMHpCfKl2nZso/G7KGzANnNK6HBShAFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f55s61jLzz2Nj for ; Tue, 03 Feb 2026 14:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3de54 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 03 Feb 2026 14:46:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: 465ba08bb537 - main - vm_phys: Check `RB_FIND()` return value in case it is NULL 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 465ba08bb53796b24dceca0d2ccde5a0e2630a2b Auto-Submitted: auto-generated Date: Tue, 03 Feb 2026 14:46:13 +0000 Message-Id: <69820a35.3de54.5385aafc@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=465ba08bb53796b24dceca0d2ccde5a0e2630a2b commit 465ba08bb53796b24dceca0d2ccde5a0e2630a2b Author: Jean-Sébastien Pédron AuthorDate: 2026-02-03 12:04:58 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-02-03 14:44:55 +0000 vm_phys: Check `RB_FIND()` return value in case it is NULL When trying to unregister a fictitious range in `vm_phys_fictitious_unreg_range()`, the function checks the properties of the looked up segment, but it does not check if a segment was found in the first place. This can happen with the amdgpu DRM driver which could call `vm_phys_fictitious_unreg_range()` without a fictitious range registered if the initialisation of the driver failed (for example because firmwares are unavailable). The code in the DRM driver was improved to avoid that, but `vm_phys_fictitious_unreg_range()` should still check the return value of `RB_FIND()` before trying to dereference the segment pointer and panic with a page fault. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55076 --- sys/vm/vm_phys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index ba16ae551093..1737020436c6 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1213,7 +1213,7 @@ vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end) rw_wlock(&vm_phys_fictitious_reg_lock); seg = RB_FIND(fict_tree, &vm_phys_fictitious_tree, &tmp); - if (seg->start != start || seg->end != end) { + if (seg == NULL || seg->start != start || seg->end != end) { rw_wunlock(&vm_phys_fictitious_reg_lock); panic( "Unregistering not registered fictitious range [%#jx:%#jx]",