From nobody Tue May 7 22:37:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579530779; cv=none; d=zohomail.com; s=zohoarc; b=AtBNOS9gBaqHoxJfq2f19YMZrd9gEIvKrjeb+RHSq/2I8ROdJBieneL1cKFwNU2DCp/0888yp1qV1C0/EPW5Az4h5rv+R2in3Q3ERV5lc6SKzN0eCQRhA4ADt1nA4dWiVtb3WKbyvBUnTK+PyyqBgVX0DErh2YHT2UoKWreDWRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579530779; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=V7ygdpd3CdlmbdPh/jv0i42ulmwwz8TE3RyZ6KbLftA=; b=hpLoBGToCGss/ogCnfQwO53j0ZrYF9KtCVPqfIMEbgSo9hReINLkxieX1I+b6Vmsnx5Z4EKD6lc0TmBV3Vzboq6mJjcdZVKuRGLFt2YLGONUmLT/dDot5Xhz+Eh2K5SFsp2C8bhsP7/RztuR8bJAiyFM5G9wE7Wr0k/YV7xShCk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579530779535932.2071956023186; Mon, 20 Jan 2020 06:32:59 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1itY5r-00048R-MZ; Mon, 20 Jan 2020 14:31:55 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1itY5q-00048M-Is for xen-devel@lists.xenproject.org; Mon, 20 Jan 2020 14:31:54 +0000 Received: from mail-wr1-f68.google.com (unknown [209.85.221.68]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 979e67fe-3b91-11ea-b986-12813bfff9fa; Mon, 20 Jan 2020 14:31:49 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id t2so29808123wrr.1 for ; Mon, 20 Jan 2020 06:31:49 -0800 (PST) Received: from ufe34d9ed68d054.ant.amazon.com (54-240-197-235.amazon.com. [54.240.197.235]) by smtp.gmail.com with ESMTPSA id 5sm48379761wrh.5.2020.01.20.06.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 06:31:47 -0800 (PST) X-Inumbo-ID: 979e67fe-3b91-11ea-b986-12813bfff9fa X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hHJhwr5erh/UYPxy3FYpYx/861mLb40RvwczGsEqYcY=; b=HQex0IFHlgf2ToVD+DQju9ZS0SGSH9ggTmT61pwQldg67Q9x7wfmEQIiDdM6Lxyt97 SO4e2ANEHW+HTO8gvEXiw46V9+3cB4+QEiS4M7I+C0FzKSBFj8/CWwVPFbSnWfDRtq1X xnXLwosBgNDI1atX+fkjsgaXTs+9C8Qa+JzYbpV92HVGWWP9+GUwMV3Z5TBW0NElhF2f WvaiBUQG79AJ9cfdWi8t1CDIYXzsKPFQcMeemjjb2LfcFZlBCWJ0HVbxxZGoupVK9dRf AReqqI5OT0P56D1S8U+Gz/PaxSb+BobH5A83v/bmUTRcwbqz+bAbqDbxMslQE5Hrb/+Y ATTg== X-Gm-Message-State: APjAAAXQcThQ8vZCcrl5L8pzeouDqkBd/MioDXFRqqWLzWw/+jp14PFr qChIfpueO9rwXoXB8SKpX13fcwoYBi+loA== X-Google-Smtp-Source: APXvYqxNgdIEDHTSvzN/KuaqXluHeRiXQtxkObha89LagoV8dEZO5tJaZAbFKvErh0kHQ7ZkOZysDQ== X-Received: by 2002:a5d:620b:: with SMTP id y11mr18358497wru.230.1579530708234; Mon, 20 Jan 2020 06:31:48 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 20 Jan 2020 14:31:42 +0000 Message-Id: <20200120143142.19820-1-julien@xen.org> X-Mailer: git-send-email 2.17.1 Subject: [Xen-devel] [PATCH] xen/x86: domain: Free all the pages associated to struct domain X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , David Woodhouse , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Julien Grall The structure domain may be bigger than a page size when lock profiling is enabled. However, the function free_domheap_struct will only free the first page. This is not a security issue because struct domain can only be bigger than a page size for lock profiling. The feature can only be selected in DEBUG and EXPERT mode. Fixes: 8916fcf4577 ("x86/domain: compile with lock_profile=3Dy enabled") Reported-by: David Woodhouse Signed-off-by: Julien Grall Reviewed-by: Jan Beulich Reviewed-by: Roger Pau Monn=C3=A9 --- xen/arch/x86/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 28fefa1f81..a5380b9bab 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -344,7 +344,7 @@ struct domain *alloc_domain_struct(void) =20 void free_domain_struct(struct domain *d) { - free_xenheap_page(d); + free_xenheap_pages(d, get_order_from_bytes(sizeof(*d))); } =20 struct vcpu *alloc_vcpu_struct(const struct domain *d) --=20 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel