Re: [PATCH] iommu/dmar: fix buffer overflow during PCI bus notification

From: Joerg Roedel
Date: Tue Feb 26 2019 - 05:25:32 EST


On Wed, Feb 20, 2019 at 07:17:45PM +0000, Julia Cartwright wrote:
> On Wed, Feb 20, 2019 at 10:46:31AM -0600, Julia Cartwright wrote:
> > - size = sizeof(*info) + level * sizeof(struct acpi_dmar_pci_path);
> > + size = sizeof(*info) + level * sizeof(info->path[0]);
>
> This is probably a candidate for struct_size() instead, if that's what
> is preferred.

No, patch is fine as-is. Thanks a lot, applied to iommu/fixes branch.


Joerg