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

Re: [PATCH] xen/arm: its: unlink the guest device when mapping fails


  • To: Mykola Kvach <Mykola_Kvach@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Mon, 23 Nov 2026 09:07:26 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NFndhDOeQRUSnBpwSg7V7/qqPZ4+DrkIAGatwYtzl60=; b=F7iA7PxtIox74z9xBH8GGepEu8RT5mQLXq6WY6J4r9Mxddv8yPpQe7STeToLCB7hJ/dWoMRNlB7lWQYRmSkAD9dQJb4rFyqtc1THe6y6Z/UYXbmM7n/M7avYCJPCJm4fY7phMCksq90ndg+5GyUunn6M1ArDFZ/vyaZztn62cbtaDkZRWLx6KTM0X9henTjEXele1mcBMIjzpHQSJ34CuVhrXgkVz+Tz66xD2OoLMiE065mTh3jqLgQNwRbBd8Xhg/eO6U4EIHmX4CyactX+t7Jxu3W/dmiQ5C5lagwUBSSq+gmeMoVzSZox4Sr954Sxq3BUgolXATFTyLw7tliWRA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E8szs+D9Ef0rCCquwepiPDmoKgJMnX8PbNtGRkVx1pndSbhgciSP2Dl6+bzkyRWXimLL3/QaLo1VGhp/2WdUDm3ZA/qDNano5x3d2iDXC7Vma30l413UiUqAjZkNp3Cyv/wESDXFaCNHz6eI0GEV3gjZo31f4oeP2pnhDF7e34CzvzfOF/KP2nYteV/x0ZM75Nk0mH1U0/mei5zLTgnV4zSmQN9mMUNMhclRwMshYdsGWrMZ2xdvV8bu1Kd426sX6fwhJR8xBQLJK24FADozgIioil17VQzR2cwGwzrG8C3lzrBp0UYvB7yhxoPIVJqLW/KNF+J6/B7v4dvNbkocvA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 23 Nov 2026 08:07:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 20-Nov-26 21:52, Mykola Kvach wrote:
> gicv3_its_map_guest_device() adds the device to the domain's RB tree
> before it allocates the host LPIs for the device. If an allocation
> fails, the error path frees the device but leaves it in the tree.
> 
> A later lookup then walks into freed memory. The stale node corrupts
> the device tree, and remove_mapped_guest_device() frees the ITT pages
NIT: device tree reads as DT, not RB tree. Worth changing to: device RB tree.
Can be fixed on commit.

> a second time. The double free hits BUG() in free_heap_pages() and
> panics Xen.
> 
> The hardware domain (Dom0) can trigger this. The host LPI pool is
> limited, so Dom0 can fill it with large MAPD commands and make the next
> MAPD fail.
> 
> Erase the node under its_devices_lock before the error path releases
> the device.
> 
> Fixes: 69082e1c210d ("ARM: GICv3 ITS: introduce device mapping")
> Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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