Skip to content

GHSA-h6f3-hx58-xhj6 fix breaks ERL_EPMD_ADDRESS=127.0.0.1 on IPV4-only systems #11402

Description

@lruppert-sib

Describe the bug
On a machine with no ::1 loopback address, the changes to fix GHSA-h6f3-hx58-xhj6 are intolerant of systems that do not have an ipv6 stack fully enabled.

To Reproduce
Disable ipv6 stack with net.ipv6.conf.all.disable_ipv6 sysctl and then attempt to start with ERL_EPMD_ADDRESS=127.0.0.1 defined environment variable. It will crash and there will be much sorrow. I initially observed it with the official rabbitmq container in passing from 4.3.3 to 4.3.4. Run side by side the epmd of this container produces different responses:

podman run --rm --network host -e ERL_EPMD_ADDRESS=127.0.0.1 \
  --entrypoint epmd docker.io/rabbitmq:4.3.3 -port 4370 -d -d

podman run --rm --network host -e ERL_EPMD_ADDRESS=127.0.0.1 \
  --entrypoint epmd docker.io/rabbitmq:4.3.4 -port 4370 -d -d

(These two images differ only in RabbitMQ version and the erts version above.)

erts 15.2.7.10 — works every time

epmd: epmd running - daemon = 0
epmd: try to initiate listening port 4370
epmd: failed to bind on ipaddr ::1: Cannot assign requested address
epmd: entering the main select() loop

erts 15.2.7.11 — exits when its head explodes from seeing that not 100% of the internet has migrated to ipv6

epmd: epmd running - daemon = 0
epmd: try to initiate listening port 4370
epmd: failed to bind on ipaddr ::1: Cannot assign requested address

Expected behavior

I expected epmd to be the usual bulletproof workhorse that it is. Instead, when the new version tried to load it unleashed a reign of unholy terror that swallowed my whole day. 127.0.0.1 should be good enough for localhost. ::1 shouldn't be mandatory.

Affected versions

  • Confirmed broken: erts 15.2.7.11 (OTP 27)
  • Confirmed working: erts 15.2.7.10 (OTP 27)

Additional context

In the changes to epmd.c in this commit:
lucioleKi@1875619

The part that handles the loopback has changed, so that is why I suspect the moving part that failed is specifically in this section.

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions