[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/6] VT-d: don't leak domid mapping on error path


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 12 Nov 2021 14:45:14 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ATCPuTxKIiHV0KnzFB9N83LvujMW/X0Oiqf3zEn/IZI=; b=juaxStk0gaR2YaZgv8AgZB0tNvfJGu6luWBuJgLLxw/kKDnEQupyHJMHHsAJ8nEGWZsuO7eJc78P62mI/I4jfXwxY0jB9MrWNNjdO5pgAHSMbvgO5320Zbj5TH84RXj9xWooImqWH8lVwtOqqPLX5vBCwjWtWDUB4AOQu59Pl2y/sZJ3MZDi76cpg4sesckZg2Sfku6NekxBeilQWK90XEA18MNHGiZ9/RQjaIXUVZQr/g0fSFvW6TDvD2SmgF942zEi0Hr1sxozE/UJE29sTtrGS3c4TuOU+KVSjEweeS1kQpYAbDFEs5qk7UX19NI179jzlc6HpP157lkgk3dpPg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YfXSxgn1QX67I1lKtzgFl4+/b2yvDu/Id7BGrs9VzUJvb16BRXm2PrlU4WmrtytIiDbfkSKW/ZDWKl05Lk/pa7srAeswoiSO9f8OdJIWuf3amB0PP3dZ2T4K8RTMM01gMCcA3F8TlyNT8kvOIH2R+Tg+XU0FJOvnsPMW3bu80QqWk203r9ysWB8kQMHvlUPsh/rv745yXM+YihcKfP59MvJao94l/HRPhOI403wKx4wxZtNk0PjTvTvz14Obp/H+BsLNMh99CqAGmvRCNFuxPGPi5ty/ZLB2MUjFPNmQuIRUzZdV9RKb5QpNPg7Af76r/QTQvJQg+mombfC4R9kYtg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Fri, 12 Nov 2021 13:45:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.11.2021 14:42, Roger Pau Monné wrote:
> On Fri, Nov 12, 2021 at 10:48:43AM +0100, Jan Beulich wrote:
>> While domain_context_mapping() invokes domain_context_unmap() in a sub-
>> case of handling DEV_TYPE_PCI when encountering an error, thus avoiding
>> a leak, individual calls to domain_context_mapping_one() aren't
>> similarly covered. Such a leak might persist until domain destruction.
>> Leverage that these cases can be recognized by pdev being non-NULL.
> 
> Would it help to place the domid cleanup in domain_context_unmap_one,
> as that would then cover calls from domain_context_unmap and the
> failure path in domain_context_mapping_one.

I don't think that would work (without further convolution), because of
the up to 3 successive calls in DEV_TYPE_PCI handling. Cleanup may happen
only on the first map's error path or after the last unmap.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.