From nobody Wed Oct 26 03:26:05 2022 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 4MxvNF5Xn0z4gt6N; Wed, 26 Oct 2022 03:26:05 +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 4MxvNF52SGz3KJn; Wed, 26 Oct 2022 03:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666754765; 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=rho9BdKxjpxebztEfmCnEP3auOLJSlkTXk/Syp9907g=; b=JQX4C9KWCcBrK3I5s8/NqI8YfhiHJx0020POvlWk+t5DgosnymLwq1pSW6lVUF4p7A2Upx FW5+31oZsKqft1zAaP5Nd1olSsAkwGKq3GZJ5A3lR686qCc1sK92Uk+xLFmz3ukWFHAOdf iOoFqlK2QdrNfyzUmUOAK2OW4bEdCrMEluIGWuQsiHOEgomQn4VLZvi8l9Kpqn7PQW7Vpe fs2sk5g3FxAqyF0rhlHaI/Uv59GAwfhqBhHlyoqz4m0z4Hdp3MVoezjkLk2sNw6F4kh6Ai Cg2pSvavd+ruhIa0FIIha+rthzUmS7d7heEP0siII5oCOmfSQ4Rnc5E6XNqfyQ== 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 4MxvNF469Lz12Vx; Wed, 26 Oct 2022 03:26:05 +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 29Q3Q5LO056004; Wed, 26 Oct 2022 03:26:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29Q3Q5BR056003; Wed, 26 Oct 2022 03:26:05 GMT (envelope-from git) Date: Wed, 26 Oct 2022 03:26:05 GMT Message-Id: <202210260326.29Q3Q5BR056003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ashish SHUKLA Subject: git: c3af4c1ee879 - stable/13 - kvm_close(3): Check kd->sparse_map != NULL before munmap 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c3af4c1ee8791f4e1bddd4df648c8d5cfdc62b2e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666754765; 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=rho9BdKxjpxebztEfmCnEP3auOLJSlkTXk/Syp9907g=; b=wzcKwKQInTile8KzYSAm2JXO3Ce4jYVQk5iro2w1Kk06jG5mA2+qdMuQnxO2ocLWTfsPQG J37Im+M7zyqc/J4EJYRc0+0zEgGD17gYCdLULfpwPmb7XlDb7fvD+I/Q4RWQaoiU0U93IN suKmIlzTq5QwifFdjwWP9VDNqi4BAxSyccPBHYaahqLwR3JXsJjbnYMoX4jgO8Ibmw52ri rreZL+lywA1hVMvEyIYif1X3/CMFU/0dtvi163j1YcRF6tuCm2MZO9F5KO76QlghOs3Ys8 nF9xBs7wV+RulwTYf6MXu1pTv+Kx0Z6CNkGGVjF5Cx4PK2zLaIziIHd2ng8eEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666754765; a=rsa-sha256; cv=none; b=xD+KWSqjQoQr1ozJYJqSzl4+LsLAxwslO1jFISB+BFc8Po5WNYnuVgpE+4+oKZuS72S1mg GehFLMYyOCI5QCm0VlNynIcwZJCKUKyjLRespUFem3fQoPrd9ca+zTLFidfdMumtE1HSie Yu9fH9v/KnbDG978jkB/WA/fOR9PtPAbQ9T82VAGBXyVxJ/xww/UezIaessPWa95zONtC7 /quApkeR48AsixN2EFbPp2sqJ51vNWquGA4zbQDbwJUbQb8n9pugvHs/xMA4GR1GsIF0JM Kl4qWByqFZX84DhvbelJxpWkD58IsmgZi/BlB9qft5rpbekRtlQfp6DHcWH9Lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ashish (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c3af4c1ee8791f4e1bddd4df648c8d5cfdc62b2e commit c3af4c1ee8791f4e1bddd4df648c8d5cfdc62b2e Author: Ashish SHUKLA AuthorDate: 2022-08-30 08:18:51 +0000 Commit: Ashish SHUKLA CommitDate: 2022-10-26 03:23:24 +0000 kvm_close(3): Check kd->sparse_map != NULL before munmap PR: 266113 Reviewed by: markj (cherry picked from commit e6901a29bc4345f12e9c85426cc2be81045020a6) --- 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);