Skip to content

Commit 0574644

Browse files
committed
Merge: tracing: Ensure visibility when inserting an element into tracing_map
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4659 JIRA: https://issues.redhat.com/browse/RHEL-30459 CVE: CVE-2024-26645 Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Approved-by: Waiman Long <longman@redhat.com> Approved-by: John B. Wyatt IV <jwyatt@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Lucas Zampieri <lzampier@redhat.com>
2 parents a586a55 + 2463e2b commit 0574644

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kernel/trace/tracing_map.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,12 @@ __tracing_map_insert(struct tracing_map *map, void *key, bool lookup_only)
574574
}
575575

576576
memcpy(elt->key, key, map->key_size);
577-
entry->val = elt;
577+
/*
578+
* Ensure the initialization is visible and
579+
* publish the elt.
580+
*/
581+
smp_wmb();
582+
WRITE_ONCE(entry->val, elt);
578583
atomic64_inc(&map->hits);
579584

580585
return entry->val;

0 commit comments

Comments
 (0)