From nobody Sun Jun 16 16:20:05 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 4W2JBt0GXBz5P3mS; Sun, 16 Jun 2024 16:20:06 +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 4W2JBs6rN2z4P1c; Sun, 16 Jun 2024 16:20:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718554806; 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=r+yjclsVDdZ1STV0vGNJvLCeLz2GGxTx1xHEYS+k760=; b=RW1lqpGnEvsmq5ghSsbyVr/pM1YnCqzrXOcQ/lZ4FOIgVawbt2RYz7S30Bpa+3oPPesT/F 5YisGoKfGK3QXnqRwrB6XC5xWQ3dClyomQgQDqFx/Rr4SN/eVdQggbdf/+xPCOj9p4iSxd nvWyVw+GcmOF7ZwXFd60cMO31WvFiiZuAQo+hcvywCOrh5hQjzOsLrbhJbY8MkJvaFjSyL 3+NRYAaEhWgatTuMbtVKIN+A8T4l1+mUpK7GrrZUxhQ/h5tuHb/Hn9n8kJAhCBbSPBVGON ddOer4l+uHCrJkuWDXG/Tfq489Nk3u99AScdvQNRhvf/J3bxtrdVJmNu3irl4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718554806; a=rsa-sha256; cv=none; b=bKfYm24K7BUcuUj4UYwxduBoE9dQ+Gznong9nRdqXN87hHnecwRPa4tvQaXTP7CQGe/+zw 2XcriU01ZC0MQwLL20NT1G+6y8L87DpWcP9JrontAdxN/AhthYjXGa3nC1V2bJ7T0sboSP Eq1LLWACFZtR8xGhInrIdW+zQjwNGW28i80ealohF8/JOG0mBtPYAtmihfxrwZOAu+2x1F 1LU/3kUK5eOZ1NAYH4hEuY4A8lH8ybyjft+KeXWZOYg7jYSfXkBoooX3Q7GTHnrAIWPE// 22uzg96zaGItUzWk6axo8s2b7vcPCl1lHMerIIYz1ujrnpuMcAUppTJQ+0S/fQ== 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=1718554806; 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=r+yjclsVDdZ1STV0vGNJvLCeLz2GGxTx1xHEYS+k760=; b=Gy9oqplGP4VoAzjuODTLyugQxXsGHCRdSy7a7FbvOgRGJX8RU6hZieR+WxbRHTw38JUxUg g03EgV/e3dgJdsVjoP6kFozu4YLu4dQgsW+TJFA6Chk2CVeLTRJvNEH7SQBQSpO8XK2R7R /wB/gppOeFqgoJKJXF+Z77yTafExe2Wm0pcTwKNkRovUgW5rNHKaJwkRBQsgLOX8j07CdF efNxRJFWT4wW0IBW/UPZpQHCfSX3+8kudgIM+kJukl4geN5nLtsEA/2vqEJgszVB5Z20ri Kzg9vTHDcLZ3V7NEzOkns1d64DAQ2fMDMnCscXhdH590JCee3AIl8TZRLCTq5Q== 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 4W2JBs6Prszv6d; Sun, 16 Jun 2024 16:20:05 +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 45GGK523041410; Sun, 16 Jun 2024 16:20:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45GGK5JU041404; Sun, 16 Jun 2024 16:20:05 GMT (envelope-from git) Date: Sun, 16 Jun 2024 16:20:05 GMT Message-Id: <202406161620.45GGK5JU041404@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: 5d4545a2270e - main - arm64 pmap: 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: 5d4545a2270e9d6c37c0a580c010c579ccdfa129 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=5d4545a2270e9d6c37c0a580c010c579ccdfa129 commit 5d4545a2270e9d6c37c0a580c010c579ccdfa129 Author: Bojan Novković AuthorDate: 2024-06-13 15:59:29 +0000 Commit: Bojan Novković CommitDate: 2024-06-16 16:19:26 +0000 arm64 pmap: Release PTP reference on leaf ptpage allocation failure 808f5ac 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: 808f5ac Differential Revision: https://reviews.freebsd.org/D45578 --- sys/arm64/arm64/pmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 7b30b2a6ae37..e8991ae706f9 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -5545,12 +5545,14 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, if ((new_l2 & ATTR_SW_WIRED) != 0 && pmap != kernel_pmap) { uwptpg = vm_page_alloc_noobj(VM_ALLOC_WIRED); if (uwptpg == NULL) { + pmap_abort_ptp(pmap, va, l2pg); return (KERN_RESOURCE_SHORTAGE); } uwptpg->pindex = pmap_l2_pindex(va); if (pmap_insert_pt_page(pmap, uwptpg, true, false)) { vm_page_unwire_noq(uwptpg); vm_page_free(uwptpg); + pmap_abort_ptp(pmap, va, l2pg); return (KERN_RESOURCE_SHORTAGE); } pmap_resident_count_inc(pmap, 1);