Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4458600pxv; Tue, 27 Jul 2021 07:53:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoKbsS/h7hCF/hLt5ASJJDbGwoDtUNlAxbkhFeOuLJvNpNEEklaQPi2IBxyQjz0T4xxLuP X-Received: by 2002:a05:6402:1d0d:: with SMTP id dg13mr8530428edb.312.1627397619269; Tue, 27 Jul 2021 07:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397619; cv=none; d=google.com; s=arc-20160816; b=BshmuQ0ORbDlNWuoaDlHq70M6Ntu9debDtO3PDx0cm/wa1bPHE03XVlC/4OD9SSBg3 ijKBsBZU1vr0Uc7kIE6hih+ZFmfTYSAeT7JeVQPnYZdzcf9NOptOjaKFL+z07HOkZDFG FgXw0yDQ3xvSQ+WlhOcVeCrGltzpRkv0gQ1tcNI0eR5CSHp0RVSo8pJLs9yyJevwOTdn dbFuNHxHbgznnSSnrJBn5PMci/ZiwNL4dGmxsucbG1yt+BncVmKvwyw32gQsZDbPE2vE EZcCaYzFYelStmUTKQeL0rQS7HerT9wQMMbXl7Mj47QCMrp43TvBSMEiPevEpkkm5XPp +X5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h5IYINyM6DaK3vjQj5K0oF7spb1sjRraqQUiH0QqzRc=; b=p3mlD9IYccNeBkK8unydvW4huftYDiDEiRJaDx8yfxjaNUZ49gpOahOKkQ8YMOokhd Ogi8bC530RUPgr1IepJ1+Qsz4xN2FPZAsy7G86AJL9kGVB46zaDEMU7HyarsefngeFcf UvOrchPeFMCTRqbw6D5OVbXN2e3kAn+uByzHDeWgYciUloJy/m3BNhAKl41GNsfe6+ko oPd3FK7UlZJc/kTAXQDI7AXigSnslCYam+Amqx5WGA1mgRxOud3UOQwIEMpJ/TFM4tX2 3/WEprHR+8WYOBRxLb77Nu5GSZJtribE2uOeL7Ii3006EwLkoOEB4o7fkRQJLuASrvHv yo8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Utt8P40S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si3117077edt.275.2021.07.27.07.53.16; Tue, 27 Jul 2021 07:53:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Utt8P40S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236833AbhG0Ost (ORCPT + 99 others); Tue, 27 Jul 2021 10:48:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:35720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232493AbhG0Osl (ORCPT ); Tue, 27 Jul 2021 10:48:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 46BFF61A61; Tue, 27 Jul 2021 14:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627397280; bh=pH8HPs5Id8eNg6CEW6PPAa2BFa+aZ4ncvKGJDSa/884=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Utt8P40S1hcPFRlXnLFarXrqL4ToLrHW9eoBa1mbYyNSr/1XAoibD8smG1pa3R+A5 lOeg16zvClG/KIrMcF7DlV99bqFicrxoofGaBCBVKKnbpDaaPq+6H0/oO8BXRSW91/ lHA21BhdJHDDaYRUimibXA2IXoxtUgnsOC/Mn0nU= Date: Tue, 27 Jul 2021 16:47:58 +0200 From: Greg Kroah-Hartman To: Fei Li Cc: linux-kernel@vger.kernel.org, Shuo Liu , Reinette Chatre , Zhi Wang , yu1.wang@intel.com Subject: Re: [PATCH] virt: acrn: Do hcall_destroy_vm() before resource release Message-ID: References: <20210722062736.15050-1-fei1.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210722062736.15050-1-fei1.li@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 22, 2021 at 02:27:36PM +0800, Fei Li wrote: > From: Shuo Liu > > The ACRN hypervisor has scenarios which could run a real-time guest VM. > The real-time guest VM occupies dedicated CPU cores, be assigned with > dedicated PCI devices. It can run without the Service VM after boot up. > hcall_destroy_vm() returns failure when a real-time guest VM refuses. > The clearing of flag ACRN_VM_FLAG_DESTROYED causes some kernel resource > double-freed in a later acrn_vm_destroy(). > > Do hcall_destroy_vm() before resource release to drop this chance to > destroy the VM if hypercall fails. > > Fixes: 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces") > Signed-off-by: Shuo Liu > Signed-off-by: Fei Li > --- Do you also want this backported to older kernels? If so, you need to put a cc: stable in here, right? I'll go add it myself, but be more careful next time please. greg k-h