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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1C8CCC43334 for ; Fri, 17 Jun 2022 08:56:16 +0000 (UTC) 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=ihHggyRSrhB8T1bfbPIAdSOz8JNLevXjGWDRBesZ6hw=; b=ajShUOi5WdYNqU pph0i/Zay1AzNyBacnErM6LLMZ/SSB37FgZnsE3N6x8DFlfv5U9+JqLlYa56d10exvrkfcj5/sXzX N9niymeJqUyrnqsehXQUw9hGITdfZctNqD1xnmaQl6CCYul/qKR32+bjfUHUN4ErQsckl5apJub79 fcWIfAbwa93NNPGLbaqBCG4vMBGUaZmMz18zvsF9W0V0poXAJxZ3oB/mM+qnuIapG4EfbbO8GVVh9 voDIuADU3/FOtdum4FkpuZ2BgBoUCllzlp9A2I8iSXDdpj1u+ZpIcy7XK79ok3iCc3CMl7/vnmu5z SecXSK0TvTgXYD7t7GQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o27ko-006VFg-6s; Fri, 17 Jun 2022 08:54:59 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o27c6-006R4t-U2 for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2022 08:46:00 +0000 Received: by mail-ed1-x536.google.com with SMTP id z7so5244595edm.13 for ; Fri, 17 Jun 2022 01:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KL12GUSIFsOr7y2Ew6vSfP//iAGJZNB8vXdWl9WySdg=; b=VKQcrgU1e/BuoJL3/E/5xdtZZtAX+n2mc7kyaVWi3ECp3tVOj0Vfu9FYpaut/duuSz 6quk8RAdcinthu3Op0BiyogjCOBrkHsN7yA4pBImVsGaob+usMkV4F2bfriOC70/7j4p wXf1+6FMMtVbDDJOqQtwFZdclvB6hK494nGqIqbmuAQ5NmsngkmxOYw5sSdo6GZ0PaCv WTdiqDsZoDvqzeHRbs+97VwWR+VjfoYaPbM1zixz13z1OTd/D0m87M1VQe3D5PLkADjA OX3MaZP/ie9tSfd5/r6LCVfr/CnVpU71Du8UqovEDC/LUMpUaoI0m2UpLe+5b8tieE9V WJ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KL12GUSIFsOr7y2Ew6vSfP//iAGJZNB8vXdWl9WySdg=; b=OLtvCTWXHBROE1YE9DvU0xv8pHPB2pd9WcKgdcWtM2WxRzSzYFzHn+konjZgKQDubK JrPCeVYsUqaNcj75D4yWcGB5EQPqSpZe79QS1pP1RzhlEFaRR8dXpcXgn1DBMbqhVFZX /y9WHcq16pCisZYWBvepPn42MmERaBEuOWCtc0Eh9PfW4CNSPZKHRfiEE/1H69j9mkfW LkyOCwwt7TBrhnIO2+obyxAcpIw+UuoR3tsl4tNfDPuqYX32mnhkqvaUHGqlQ1vMuRa8 95+7ho6nARvBVFw+6xstJUjfLqXB+qgrGedGuaVu3B/sL7M5I9QZH6gPs0t2YsGMh5b8 J84g== X-Gm-Message-State: AJIora9wFdqDnlKglLgPt4H+mmBmwzBlFhN00sVaKvlcWpZWmwBo64rr 6/FQW+ehcS5lBHhGe8tKQb72Cw== X-Google-Smtp-Source: AGRyM1v74Y86WCSwTs0mbpz8Uzc1XzusOKJp8Iwa3L1KmKQVX66F7ytavdX7JhAvnMDW75wpmw8weA== X-Received: by 2002:a05:6402:2687:b0:430:328f:e46b with SMTP id w7-20020a056402268700b00430328fe46bmr10949958edd.33.1655455551764; Fri, 17 Jun 2022 01:45:51 -0700 (PDT) Received: from google.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id g8-20020a170906538800b006ff05d4726esm1888657ejo.50.2022.06.17.01.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 01:45:51 -0700 (PDT) Date: Fri, 17 Jun 2022 08:45:48 +0000 From: Quentin Perret To: Mike Rapoport Cc: Marc Zyngier , Suzuki K Poulose , Alexandru Elisei , linux-arm-kernel@lists.infradead.org, Catalin Marinas , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, James Morse , Will Deacon , kernel-team@android.com Subject: Re: [PATCH] KVM: arm64: Prevent kmemleak from accessing pKVM memory Message-ID: References: <20220616161135.3997786-1-qperret@google.com> <165545408679.771055.5076080259874437048.b4-ty@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_014559_050341_E2838102 X-CRM114-Status: GOOD ( 18.71 ) 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 Friday 17 Jun 2022 at 11:38:14 (+0300), Mike Rapoport wrote: > On Fri, Jun 17, 2022 at 09:21:31AM +0100, Marc Zyngier wrote: > > On Thu, 16 Jun 2022 16:11:34 +0000, Quentin Perret wrote: > > > Commit a7259df76702 ("memblock: make memblock_find_in_range method > > > private") changed the API using which memory is reserved for the pKVM > > > hypervisor. However, it seems that memblock_phys_alloc() differs > > > from the original API in terms of kmemleak semantics -- the old one > > > excluded the reserved regions from kmemleak scans when the new one > > > doesn't seem to. Unfortunately, when protected KVM is enabled, all > > > kernel accesses to pKVM-private memory result in a fatal exception, > > > which can now happen because of kmemleak scans: > > > > > > [...] > > > > Applied to fixes, thanks! > > > > [1/1] KVM: arm64: Prevent kmemleak from accessing pKVM memory > > commit: 9e5afa8a537f742bccc2cd91bc0bef4b6483ee98 > > I'd really like to update the changelog to this: > > Commit a7259df76702 ("memblock: make memblock_find_in_range method > private") changed the API using which memory is reserved for the pKVM > hypervisor. However, memblock_phys_alloc() differs from the original API in > terms of kmemleak semantics -- the old one didn't report the reserved > regions to kmemleak while the new one does. Unfortunately, when protected > KVM is enabled, all kernel accesses to pKVM-private memory result in a > fatal exception, which can now happen because of kmemleak scans: > > $ echo scan > /sys/kernel/debug/kmemleak > [ 34.991354] kvm [304]: nVHE hyp BUG at: [] __kvm_nvhe_handle_host_mem_abort+0x270/0x290! > ... > > Fix this by explicitly excluding the hypervisor's memory pool from > kmemleak like we already do for the hyp BSS. Looks good to me, thanks. Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel