mirror-llvm-project/offload/libomptarget
Abhinav Gaba a1d93f19be
[OpenMP][Offload] Fix use-after-free of the packed firstprivate transfer buffer (#212905)
`packAndTransfer()` called `submitData()`, which captured the address of
the data of
the `SmallVector` member of `PrivateArgumentManagerTy`, as the host
source of an
async transfer. The manager was later moved into an `AsyncInfo`
post-processing
lambda, changing the underlying address of the data:
`addPostProcessingFunction()`
copies the closure rather than moving it, but even if it "moved", the
address of the data owned by `SmallVector`'s inline capacity would have
changed.

The AMDGPU plugin read from the stale host source address when doing the
actual transfer.

Fix: allocate the packed buffer via
`getOrCreateSourceBufferForSubmitData()`, so
that `AsyncInfo` owns it. The non-packed
corresponding-pointer-initialization
path in this same class already built its source buffer that way.
2026-07-30 16:17:20 -07:00
..
KernelLanguage [offload][OpenMP] Add strict flag for blocks and threads in kernel arguments (#199483) 2026-05-30 02:28:35 -07:00
OpenMP [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00
CMakeLists.txt [Offload] Fix missing SONAME version on offload libraries (#199975) 2026-05-27 09:10:56 -05:00
device.cpp [offload] Improve report printing for kernel recording (#204505) 2026-06-18 21:57:23 -07:00
DeviceImage.cpp [offload] Fix DeviceImage to handle OffloadBinary::create returning vector (#180003) 2026-02-05 12:41:03 -06:00
exports [OpenMP][Offload] Add offload runtime support for dyn_groupprivate clause (#152831) 2026-03-12 01:13:06 -07:00
interface.cpp [Offload][OpenMP] Skip RPC callback registration when plugin has no devices (#211447) 2026-07-23 02:30:22 +00:00
LegacyAPI.cpp [Offload] Debug message update part 1 (#171672) 2025-12-17 09:04:36 -06:00
OffloadRTL.cpp [offload] Remove LIBOMPTARGET_SHARED_MEMORY_SIZE envar (#186231) 2026-03-12 21:21:29 -07:00
omptarget.cpp [OpenMP][Offload] Fix use-after-free of the packed firstprivate transfer buffer (#212905) 2026-07-30 16:17:20 -07:00
PluginManager.cpp [Offload] Remove unnecessary maybe_unused attribute (#175855) 2026-01-15 14:31:58 -06:00
private.h [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00