iommu/amd: use after free in get_irq_table()
Subsystems (2)
PATCH 1/1 iommu/amd: use after free in get_irq_table()
We should return NULL on error instead of the freed pointer.
Signed-off-by Dan Carpenter <[email protected]>
drivers/iommu/amd_iommu.c +1 -0
@@ -3867,6 +3867,7 @@ static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic) table->table =kmem_cache_alloc (amd_iommu_irq_cache,GFP_ATOMIC );if (!table->table) {kfree (table); + table =NULL ; goto out; }
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Dan Carpenter
We should return NULL on error instead of the freed pointer.
Signed-off-by Dan Carpenter <[email protected]>drivers/iommu/amd_iommu.c +0
-0
drivers/iommu/amd_iommu.c static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic) · line 3872
Quoted 6 lines
drivers/iommu/amd_iommu.c +1
-0@@ -3867,6 +3867,7 @@ static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic) table->table =kmem_cache_alloc (amd_iommu_irq_cache,GFP_ATOMIC );if (!table->table) {kfree (table); + table =NULL ; goto out; }
Good catch. Thanks, applied.
Signature · 5 lines
AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632