From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 469E2C4338F for ; Mon, 2 Aug 2021 16:52:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D87D61102 for ; Mon, 2 Aug 2021 16:52:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232056AbhHBQw3 (ORCPT ); Mon, 2 Aug 2021 12:52:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:51838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbhHBQw2 (ORCPT ); Mon, 2 Aug 2021 12:52:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 89CCB610FF; Mon, 2 Aug 2021 16:52:17 +0000 (UTC) Date: Mon, 2 Aug 2021 17:52:14 +0100 From: Catalin Marinas To: Marc Zyngier Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Alexandru Elisei , Quentin Perret , Will Deacon , kernel-team@android.com, stable@vger.kernel.org Subject: Re: [PATCH v2 2/2] KVM: arm64: Unregister HYP sections from kmemleak in protected mode Message-ID: <20210802165214.GK18685@arm.com> References: <20210802123830.2195174-1-maz@kernel.org> <20210802123830.2195174-3-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210802123830.2195174-3-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Aug 02, 2021 at 01:38:30PM +0100, Marc Zyngier wrote: > Booting a KVM host in protected mode with kmemleak quickly results > in a pretty bad crash, as kmemleak doesn't know that the HYP sections > have been taken away. This is specially true for the BSS section, > which is part of the kernel BSS section and registered at boot time > by kmemleak itself. > > Unregister the HYP part of the BSS before making that section > HYP-private. The rest of the HYP-specific data is obtained via > the page allocator or lives in other sections, none of which is > subjected to kmemleak. > > Fixes: 90134ac9cabb ("KVM: arm64: Protect the .hyp sections from the host") > Reviewed-by: Quentin Perret > Signed-off-by: Marc Zyngier > Cc: Catalin Marinas > Cc: stable@vger.kernel.org # 5.13 Reviewed-by: Catalin Marinas From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29264C432BE for ; Mon, 2 Aug 2021 16:52:25 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id AD799610FF for ; Mon, 2 Aug 2021 16:52:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AD799610FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 359234A3A3; Mon, 2 Aug 2021 12:52:24 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kCH545w4hvpj; Mon, 2 Aug 2021 12:52:23 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 12E3D40667; Mon, 2 Aug 2021 12:52:23 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8194340667 for ; Mon, 2 Aug 2021 12:52:21 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uUwSWOqzuQwM for ; Mon, 2 Aug 2021 12:52:20 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 6C60040623 for ; Mon, 2 Aug 2021 12:52:20 -0400 (EDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id 89CCB610FF; Mon, 2 Aug 2021 16:52:17 +0000 (UTC) Date: Mon, 2 Aug 2021 17:52:14 +0100 From: Catalin Marinas To: Marc Zyngier Subject: Re: [PATCH v2 2/2] KVM: arm64: Unregister HYP sections from kmemleak in protected mode Message-ID: <20210802165214.GK18685@arm.com> References: <20210802123830.2195174-1-maz@kernel.org> <20210802123830.2195174-3-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210802123830.2195174-3-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: kernel-team@android.com, kvm@vger.kernel.org, Will Deacon , stable@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, Aug 02, 2021 at 01:38:30PM +0100, Marc Zyngier wrote: > Booting a KVM host in protected mode with kmemleak quickly results > in a pretty bad crash, as kmemleak doesn't know that the HYP sections > have been taken away. This is specially true for the BSS section, > which is part of the kernel BSS section and registered at boot time > by kmemleak itself. > > Unregister the HYP part of the BSS before making that section > HYP-private. The rest of the HYP-specific data is obtained via > the page allocator or lives in other sections, none of which is > subjected to kmemleak. > > Fixes: 90134ac9cabb ("KVM: arm64: Protect the .hyp sections from the host") > Reviewed-by: Quentin Perret > Signed-off-by: Marc Zyngier > Cc: Catalin Marinas > Cc: stable@vger.kernel.org # 5.13 Reviewed-by: Catalin Marinas _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3BA8C4338F for ; Mon, 2 Aug 2021 16:54:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B67D661104 for ; Mon, 2 Aug 2021 16:54:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B67D661104 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MvRPH/gCCwi2LjK/WA4E5FCDapw8DfWU64LiGgMcdlc=; b=pT20qiI4aX9k1O i6qlFCveJZ195DmU4+n3+muw78XnmYFZsDAMJytpKUxGsl9+bZtPY1xVjXrFEbOWGrMjLNDAuDRiV 61ub096wtgVLoa7HxAZKtNvuMV6JLRTCDM0KvSDN8lJ44ErwkVwb5t8yU2LtXhkKDTR5/eJrUScY2 W/53/tuYfGGXieOS+7FiTo8NNcv5iA+kv06bmY54i+dAldDi/FHtwEaSHAOhWLS45PAqWrjDHslGC avAlws0k8+mnlnmK00kNASyDBFNvj+daxfQQN8Y0a+rjWwJCAs1YoykvcVKW+BlLPFA1dKyLrygVa RwgrkrZZY42/ewuCGgIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAbAt-00HEv4-Tc; Mon, 02 Aug 2021 16:52:24 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAbAp-00HEth-Kg for linux-arm-kernel@lists.infradead.org; Mon, 02 Aug 2021 16:52:20 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 89CCB610FF; Mon, 2 Aug 2021 16:52:17 +0000 (UTC) Date: Mon, 2 Aug 2021 17:52:14 +0100 From: Catalin Marinas To: Marc Zyngier Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Alexandru Elisei , Quentin Perret , Will Deacon , kernel-team@android.com, stable@vger.kernel.org Subject: Re: [PATCH v2 2/2] KVM: arm64: Unregister HYP sections from kmemleak in protected mode Message-ID: <20210802165214.GK18685@arm.com> References: <20210802123830.2195174-1-maz@kernel.org> <20210802123830.2195174-3-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210802123830.2195174-3-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_095219_719578_29F993DC X-CRM114-Status: GOOD ( 12.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Aug 02, 2021 at 01:38:30PM +0100, Marc Zyngier wrote: > Booting a KVM host in protected mode with kmemleak quickly results > in a pretty bad crash, as kmemleak doesn't know that the HYP sections > have been taken away. This is specially true for the BSS section, > which is part of the kernel BSS section and registered at boot time > by kmemleak itself. > > Unregister the HYP part of the BSS before making that section > HYP-private. The rest of the HYP-specific data is obtained via > the page allocator or lives in other sections, none of which is > subjected to kmemleak. > > Fixes: 90134ac9cabb ("KVM: arm64: Protect the .hyp sections from the host") > Reviewed-by: Quentin Perret > Signed-off-by: Marc Zyngier > Cc: Catalin Marinas > Cc: stable@vger.kernel.org # 5.13 Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel