Files
OpenCL-CTS/test_conformance
paulfradgley c2aca7d8e6 Fix local memory out of bounds issue in atomic_fence (replaces PR #1285) (#1437)
* Fix local memory out of bounds in atomic_fence

In the error condition, the atomic_fence kernel can illegally access local memory addresses.

In this snippet, localValues is in the local address space and provided as a kernel argument. Its size is effectively get_local_size(0) * sizeof(int). The stores to localValues lead to OoB accesses.

  size_t myId = get_local_id(0);

  ...

  if(hisAtomicValue != hisValue)
  { // fail
    atomic_store(&destMemory[myId], myValue-1);
    hisId = (hisId+get_local_size(0)-1)%get_local_size(0);
    if(myValue+1 < 1)
      localValues[myId*1+myValue+1] = hisId;
    if(myValue+2 < 1)
      localValues[myId*1+myValue+2] = hisAtomicValue;
    if(myValue+3 < 1)
      localValues[myId*1+myValue+3] = hisValue;
  }

* Fix formatting

* Fix formatting again

* Formatting
2022-06-14 08:47:06 -07:00
..
2021-05-18 18:12:55 +01:00
2022-01-11 16:52:11 +00:00
2020-07-23 17:21:07 +01:00
2021-09-28 10:19:17 -07:00
2021-09-13 13:25:32 +01:00
2021-09-13 13:25:32 +01:00
2022-01-11 16:52:11 +00:00
2021-05-13 09:13:03 +01:00
2019-07-31 16:00:45 +01:00