From nobody Sun Oct 16 16:51:01 2022 X-Original-To: dev-commits-src-main@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 4Mr5jd6ddjz4fc1f; Sun, 16 Oct 2022 16:51:01 +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 4Mr5jd6BmLz3mRT; Sun, 16 Oct 2022 16:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665939061; 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=9AC/NvvEl7PhGJmTALjXc3kMApG5Djb4ptG4m6QC0wU=; b=op5c6rsWCWK4Ap2DghlsLQMJXv+TnwgEuQzdsfg+o47YQdWrg4elGHXSdD3vfLlxi0ttvb FM9cgqfbbMN6x/VsUwuO3aPuCDYF06c6uK8ol7vwl49MCx8wyAjSHIs+Ykve81vPGBvqM9 vhF0NIMDtId6/USqgI9NX0O5A24QpANTX4sDTlc77y/JALSuL3ZfAL328ajf63F5VTP9Qf UiJ1YLH37SEQLasAFGob0GTH+Au9VP7hk1BDkdw6jRqTMmuzCNWHyPcBCeJC/pNOOxtJK0 12ZMuy+sKbmOwJFgvidGV3y0oWcVUOaFRQrB9mDInAco23G5dQk0KZYL7gARAQ== 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 4Mr5jd5FWfzX2B; Sun, 16 Oct 2022 16:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29GGp1nO000241; Sun, 16 Oct 2022 16:51:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29GGp1cl000240; Sun, 16 Oct 2022 16:51:01 GMT (envelope-from git) Date: Sun, 16 Oct 2022 16:51:01 GMT Message-Id: <202210161651.29GGp1cl000240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ashish SHUKLA Subject: git: e6901a29bc43 - main - kvm_close(3): Check kd->sparse_map != NULL before munmap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ashish X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6901a29bc4345f12e9c85426cc2be81045020a6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665939061; 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=9AC/NvvEl7PhGJmTALjXc3kMApG5Djb4ptG4m6QC0wU=; b=A1rpi9O8NztBXN0GAxKPsJPbA4ik8UFDsbrRnn1jNj9KrEbY10tebqABiuKMR9jPbGqwWK e0Cf1mkHPG19Wb/SsC98qkYDi2OSH2ImWlXEP9yPxUiTYEB7RPg7broY88iSXeKU8W2ELU WYUV0PlS/bW406mckNKC1ENDmfWoAwrOcw24krE+S2b+RuzYtjH2uhwQahLrY5z94+q0JW ctzTBYh+rpG0v9eSBH0XB/x+udYYunxPuEpSAc73DUIcISdchXnK8uLMcfa5HpWSC4sVOf hh31vTi5TNXPM946q+4jIeOd/zOOCcf+K8BZ9NBLeweA6Ob+phligLfuYQIQQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665939061; a=rsa-sha256; cv=none; b=JN928CmqtSRzP9ZvA/9hueww/qJ+1VOsTjlALbqAAiozVm1XG2B6wfd83CkyRn6izXERlC pKAf1jG/gE2ylZ75P7IqIRc/m3iUIrnERXIJctyaN3tcHVYFA47cwr6KHRQ1sqPvNqRe8C vBjf+oTIDZFozRTImU7U6sQyd2plA1k7JOWVkaM7rKcO2WoV1OG5FGsdzgkhfZRs4BXW8+ pc5B3rEQ02HvA3dBFkuDcMLxiPMFIOgWnYW4WYRzbP9T9VvdXa0QXp9QN4SKOaqNPHRwPp Vq9kRnvjBGxeu2ujo1Acjzx7kbkc9LAs63gIzdVRdfeexouNm3jexPaE5E9Y2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ashish (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e6901a29bc4345f12e9c85426cc2be81045020a6 commit e6901a29bc4345f12e9c85426cc2be81045020a6 Author: Ashish SHUKLA AuthorDate: 2022-08-30 08:18:51 +0000 Commit: Ashish SHUKLA CommitDate: 2022-10-16 16:49:16 +0000 kvm_close(3): Check kd->sparse_map != NULL before munmap PR: 266113 Reviewed by: markj --- lib/libkvm/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index b98f2f25e619..4b886171a7d6 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -303,7 +303,7 @@ kvm_close(kvm_t *kd) free(kd->pt_map); if (kd->page_map != NULL) free(kd->page_map); - if (kd->sparse_map != MAP_FAILED) + if (kd->sparse_map != MAP_FAILED && kd->sparse_map != NULL) munmap(kd->sparse_map, kd->pt_sparse_size); free((void *)kd);