Dear All,
We experiencing an issue with LD_PRELOAD on OKD4.
When a contianer tries to ld preload iboneagentproc.so get the following error:
toolbox@w14-alpine-user:/opt/dynatrace$ ls
ERROR: ld.so: object '/opt/dynatrace/oneagent/agent/bin/current/linux-x86-64/liboneagentproc.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
oneagent
We get this error message after every command inside the container.
OKD version: Server Version: 4.7.0-0.okd-2021-03-07-090821
OS release:
NAME=Fedora
VERSION="33.20210217.3.0 (CoreOS)"
This error message caused by permission denied when accessing the “/opt/dynatrace/oneagent” directory:
toolbox@w14-alpine-user:/opt$ ls -laZ
ERROR: ld.so: object '/opt/dynatrace/oneagent/agent/bin/current/linux-x86-64/liboneagentproc.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
total 0
drwxr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c25,c40 23 Apr 30 08:06 .
drwxr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c25,c40 62 Apr 30 08:06 ..
drwxr-xr-x. 3 root root system_u:object_r:container_file_t:s0:c25,c40 22 Apr 30 08:06 dynatrace
toolbox@w14-alpine-user:/opt$ cd dynatrace/
toolbox@w14-alpine-user:/opt/dynatrace$ ls -laZ
ERROR: ld.so: object '/opt/dynatrace/oneagent/agent/bin/current/linux-x86-64/liboneagentproc.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
total 0
drwxr-xr-x. 3 root root system_u:object_r:container_file_t:s0:c25,c40 22 Apr 30 08:06 .
drwxr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c25,c40 23 Apr 30 08:06 ..
drwxr-xr-x. 4 root root system_u:object_r:var_t:s0 79 Apr 28 14:15 oneagent
toolbox@w14-alpine-user:/opt/dynatrace$ cd oneagent/
toolbox@w14-alpine-user:/opt/dynatrace/oneagent$ ls -laZ
ERROR: ld.so: object '/opt/dynatrace/oneagent/agent/bin/current/linux-x86-64/liboneagentproc.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ls: cannot open directory '.': Permission denied
toolbox@w14-alpine-user:/opt/dynatrace/oneagent$
Additional information: We find that running the container in privileged mode solves this issue, but this is not an option for us for security reasons.
Also for security reasons we use custom user inside the containers specified in Dockerfiles (eg.: USER toolbox). Without specifying the user inside the docker file the ld preload error message is gone.
So lowering the security level is not an option for us.
Any help is appreciated!
Best Regards,
Janos Vincze