Skip to content

Commit 106473c

Browse files
committed
[OpenMP] Fix out-of-bounds access in __kmpc_omp_task_with_deps due to incorrect task ID
Correct use of task ID field when accessing the taskgraph’s record_map. The previous logic mistakenly used td_task_id instead of td_tdg_task_id, potentially causing out-of-bounds memory access when td_task_id exceeded the map_size. td_task_id and td_tdg_task_id was introduced in #130660
1 parent 29c73b6 commit 106473c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openmp/runtime/src/kmp_taskdeps.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,9 @@ kmp_int32 __kmpc_omp_task_with_deps(ident_t *loc_ref, kmp_int32 gtid,
698698
__kmp_tdg_is_recording(new_taskdata->tdg->tdg_status)) {
699699
kmp_tdg_info_t *tdg = new_taskdata->tdg;
700700
// extend record_map if needed
701-
if (new_taskdata->td_task_id >= tdg->map_size) {
701+
if (new_taskdata->td_tdg_task_id >= tdg->map_size) {
702702
__kmp_acquire_bootstrap_lock(&tdg->graph_lock);
703-
if (new_taskdata->td_task_id >= tdg->map_size) {
703+
if (new_taskdata->td_tdg_task_id >= tdg->map_size) {
704704
kmp_uint old_size = tdg->map_size;
705705
kmp_uint new_size = old_size * 2;
706706
kmp_node_info_t *old_record = tdg->record_map;

0 commit comments

Comments
 (0)