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 <harshit.m.mogalapalli@oracle.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20240517144946.289615-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 1613e60 commit a4edf67

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)