Skip to content

Commit a4edf67

Browse files
harshimogalapallijwrdegoede
authored andcommitted
platform/x86: ISST: fix use-after-free in tpmi_sst_dev_remove()
In tpmi_sst_dev_remove(), tpmi_sst is dereferenced after being freed. Fix this by reordering the kfree() post the dereference. Fixes: 9d1d362 ("platform/x86: ISST: Support partitioned systems") Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
1 parent 1613e60 commit a4edf67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,8 +1610,8 @@ void tpmi_sst_dev_remove(struct auxiliary_device *auxdev)
16101610
tpmi_sst->partition_mask_current &= ~BIT(plat_info->partition);
16111611
/* Free the package instance when the all partitions are removed */
16121612
if (!tpmi_sst->partition_mask_current) {
1613-
kfree(tpmi_sst);
16141613
isst_common.sst_inst[tpmi_sst->package_id] = NULL;
1614+
kfree(tpmi_sst);
16151615
}
16161616
mutex_unlock(&isst_tpmi_dev_lock);
16171617
}

0 commit comments

Comments
 (0)