Re: [PATCH] xen/grant-table: fix resource leak in gnttab_init()
From: Haoxiang Li
Date: Fri Nov 20 2026 - 00:59:26 EST
At 2026-11-20 07:18:03, "Edgecombe, Rick P" <rick.p.edgecombe@xxxxxxxxx> wrote:
>
>If the PV guest hits this scenario can it survive? I don't know xen pv very
>well. Does this means that the PV guest has no disk or network. If so, the user
>is probably not concerned with a one time memory leak.
Thanks for raising this. I tested an x86-64 PV Dom0 under Xen 4.17.7 in QEMU,
using ata_piix for storage and e1000 for networking.
I injected -ENOMEM immediately before the initial MFN-array allocation in
gnttab_map(), after arch_gnttab_init() had succeeded. With and without the
patch, gnttab_init() returned -ENODEV, but Dom0 still booted to userspace.
In both cases, disk I/O worked, and the network interface could reach the
QEMU gateway.
However, I agree that this is a one-time leak with limited impact. I have not
demonstrated any further user-visible consequences from the leak.
Regards,
Haoxiang Li