#1119014 libamdhip64-6: possible out-of-bounds write in rocclr printf

Package:
libamdhip64-6
Source:
libamdhip64-6
Description:
HIP runtime for AMD GPUs - library
Submitter:
Cordell Bloor
Date:
2025-10-26 06:23:02 UTC
Severity:
normal
#1119014#5
Date:
2025-10-26 06:17:05 UTC
From:
To:
Dear Maintainer,

When building src:rocm-hipamd 6.4.3-2 with hardening and lto enabled,
I encountered a number of out-of-bounds memcpy calls that caused the
package to FTBFS. There was one error that didn't seem to have a patch
upstream that I could backport:

```
[100%] Linking CXX shared library ../lib/libamdhip64.so
cd /root/rocm-hipamd/rocm-hipamd/obj-x86_64-linux-gnu/hipamd/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/amdhip64.dir/link.txt --verbose=1
In function ‘memcpy’,
    inlined from ‘output’ at /usr/src/rocm-hipamd-6.4.3-3/rocclr/device/rocm/rocprintf.cpp:489:17:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: error: ‘__builtin_memcpy’ specified bound between 18446744073709551604 and 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |                                 ^
lto1: all warnings being treated as errors
```

Sincerely,
Cory Bloor