Sfoglia il codice sorgente

thunderbolt: tb: fix use after free in tb_activate_pcie_devices

Add a ̣̣continue statement in order to avoid using a previously
free'd pointer tunnel in list_add.

Addresses-Coverity-ID: 1415336
Fixes: 9d3cce0b6136 ("thunderbolt: Introduce thunderbolt bus and connection manager")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gustavo A. R. Silva 7 anni fa
parent
commit
a2e373438f
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      drivers/thunderbolt/tb.c

+ 1 - 0
drivers/thunderbolt/tb.c

@@ -224,6 +224,7 @@ static void tb_activate_pcie_devices(struct tb *tb)
 			tb_port_info(up_port,
 				     "PCIe tunnel activation failed, aborting\n");
 			tb_pci_free(tunnel);
+			continue;
 		}
 
 		list_add(&tunnel->list, &tcm->tunnel_list);