From nobody Sun Jun 16 16:20:07 2024 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 4W2JBw45z3z5P41r; Sun, 16 Jun 2024 16:20:08 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W2JBw0wM8z4P5J; Sun, 16 Jun 2024 16:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718554808; 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=I228+A+kSbOkphE1mEqEw9vNx6gPl8Eg4pk/sygj24A=; b=Z+JnDubiEBIkk4jg1j1rAo1Nr86xx9PQHd9Nn03hZQoKKClaUQGfy6O2YhBfxDEPNBSlrs qx0lU3G02aD6PQ+6n/MLZBqZVb4aWJhB2UD+HPyHYcEnwEta9jCIxXUcleNcR4YwSzsXQB V/3qH13LCh8bpRRcaWqBLzJctv9cNiJQNgwDgpoz0mkZvUB3UCoGwudt6bGzHJUJ+Q2Z4l 3ZWCHVgQRrmlDlYIfABGqdUUEzVMJYp1ekO1O37AqUaToDTymelMZUFSp+wmlnlGgmQbfg TLEnQdQOPLWQ4fUPo5Kp+L7Ix6qhcGiuAcucbz7mryGlRE5i+dl1qdWMsMmLsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718554808; a=rsa-sha256; cv=none; b=Z2n5Da7r4CO1IOZdjLuxDkspcBHqlWNkWxYhfqHzcCfDSZbRPurtPhI8lUVQxmbQKTlZcx K+xTn3xKWBVVa3pd6Oi6zDOoXwL/dlX3iNw4uvgVOgCTS8KMf+KfbV14xLDeHs+PxQsZiP p6Q7VvdeQ4CkLL/YW4Xl+LMQJ72KdWXj629vY2Xun9g8fGpMo6hjAbRWIB4116fzWCo4tJ vzLQ6AvSMYmD7VAOtXeEH/OfjYBaBpmBGbBGsJB63skkeJaXvSgWnEirSZYBc3HWdK/AfK ELZH8XKeTg7/RdvcV3cS7PJMlEi021vVg6PJNFoZGy+502KCJxJ4sXUpGUH2Ww== 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=1718554808; 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=I228+A+kSbOkphE1mEqEw9vNx6gPl8Eg4pk/sygj24A=; b=k4QBcGb68kFzpRZCAqPGIXkL2d0q5p0mOmP/9WO48idZnwB/pyWdLXfHqUMYYX97+Y18p+ 9la9YMfrzU3VxZnlDyv+KF1eUBQmj75ssPQ/Tk+8XuaY5GUEPFaUBYjAyPbRcDdN/9NlLY FovkoAns78F+vovp8jdw0KpAxbVbS3B9FWNiQaaIctg+aJ+DL/aKXEHf9M+DfbaG5tyVSi 0WsZyUIqZ0lZvhTLN9jVkbkzZjgb8rYwhpWwIT3BflNzWbcBqGBm55qaukLtaMy9cy4pTd lGkaBFxqhJ2yVrbdAmWS9878njZkGen+wjZ42g54SJUD4xLQ1qM8Zo9rJ/KZ+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W2JBw0WMWzvcp; Sun, 16 Jun 2024 16:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45GGK7oq041976; Sun, 16 Jun 2024 16:20:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45GGK7MB041972; Sun, 16 Jun 2024 16:20:07 GMT (envelope-from git) Date: Sun, 16 Jun 2024 16:20:07 GMT Message-Id: <202406161620.45GGK7MB041972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 858ead4bcefb - main - powerpc_mmu_radix: Release PTP reference on leaf ptpage allocation failure 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: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 858ead4bcefb4657629cba29b0e4507db509ee36 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=858ead4bcefb4657629cba29b0e4507db509ee36 commit 858ead4bcefb4657629cba29b0e4507db509ee36 Author: Bojan Novković AuthorDate: 2024-06-13 16:11:12 +0000 Commit: Bojan Novković CommitDate: 2024-06-16 16:19:27 +0000 powerpc_mmu_radix: Release PTP reference on leaf ptpage allocation failure 0013741 fixed an edge case invloving mlock() and superpage creation by creating and inserting a leaf pagetable page for mlock'd superpages. However, the code does not properly release the reference to the pagetable page in the error handling path. This commit fixes the issue by adding calls to 'pmap_abort_ptp' in the error handling path. Reported by: alc Approved by: markj (mentor) Fixes: 0013741 Differential Revision: https://reviews.freebsd.org/D45582 --- sys/powerpc/aim/mmu_radix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 746b1ef49a99..ae6e4d116e87 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -3268,12 +3268,15 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, u_int flags, uwptpg = NULL; if ((newpde & PG_W) != 0 && pmap != kernel_pmap) { uwptpg = vm_page_alloc_noobj(VM_ALLOC_WIRED); - if (uwptpg == NULL) + if (uwptpg == NULL) { + pmap_abort_ptp(pmap, va, pdpg); return (KERN_RESOURCE_SHORTAGE); + } uwptpg->pindex = pmap_l3e_pindex(va); if (pmap_insert_pt_page(pmap, uwptpg)) { vm_page_unwire_noq(uwptpg); vm_page_free(uwptpg); + pmap_abort_ptp(pmap, va, pdpg); return (KERN_RESOURCE_SHORTAGE); } pmap_resident_count_inc(pmap, 1);