flatcar / Flatcar

Flatcar project repository for issue tracking, project documentation, etc.
https://www.flatcar.org/
Apache License 2.0
774 stars 32 forks source link

iscsiadm links to many libraries on 2697.0.0 #280

Closed iaguis closed 3 years ago

iaguis commented 4 years ago

Description

On 2697.0.0, the iscsiadm binary links to many more libraries than in previous version. This causes problems because in Lokomotive we mount it in the kubelet container, which misses some of the libraries.

Impact

Kubernetes workloads depending on the iscsiadm binary fail. This would probably break any distro that runs the kubelet in a container.

Environment and steps to reproduce

  1. Set-up: Flatcar 2697.0.0 on Packet
  2. Task: Run ldd $(which iscsiadm)

Expected behavior

I expect iscsiadm to be linked to the same libraries as previous versions.

Additional information

This was probably introduced in https://github.com/kinvolk/coreos-overlay/pull/682.

I could work it around by mounting the missing libraries into the kubelet container, but I was wondering if this could be solved on Flatcar.

pothos commented 4 years ago

So you would run the binary with the libraries you have in a container? That's not what is guaranteed to work as dependencies will change on updates. It was not a static binary before. Can you copy/mount the libraries alongside (ldd $(which iscsiadm) | grep -o /lib'[^ ]*' | sort -u)?

t-lo commented 4 years ago

As raised by @pothos I'm not sure how this is a bug. We updated the version of open-iscsi to latest upstream to address security issues with the outdated version, and to ship bug fixes. The tools are not shipped as static binaries, so run-time compatibility to 3rd party containers cannot be guaranteed.

In fact, since C only supports compile-time type safety but no run-time type safety, this might ave introduced silent breakage with previous versions already when using application binaries not built against the libraries shipped. If e.g. a library function signature changes - for instance, if there's a type change in a function parameter or if a function changes the number of arguments, things would continue to run, but application and library would make different assumptions on said function calls. This kind of operation is not safe.

pothos commented 4 years ago

To add, there comes a glibc update to Stable. I think it would work in one direction; using an old binary with a newer library as long at the SONAME (library major version) is the same but maybe not in the reverse direction when new symbols are used.

pothos commented 3 years ago

@iaguis I proposed another approach here: https://github.com/kinvolk/Flatcar/issues/293#issuecomment-742673711