Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When binding server to a UNIX socket in an abstract namespace, the address length is wrong #50889

Closed
yseymour opened this issue Nov 23, 2023 · 2 comments
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding. net Issues and PRs related to the net subsystem.

Comments

@yseymour
Copy link

yseymour commented Nov 23, 2023

Version

20.10.0

Platform

Linux debian 6.1.0-10-arm64 #1 SMP Debian 6.1.37-1 (2023-07-03) aarch64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

new http.Server().listen("\0foo")

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior? Why is that the expected behavior?

The server binds to a socket that lsof -U renders as @foo. Other processes can connect to that socket.

What do you see instead?

The server binds to a socket that lsof -U renders as @foo@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

It looks like the address length is not set correctly.

I tried binding a C++ program to an abstract socket (using ZeroMQ) and lsof rendered that one as I'd expect (not padded), so this isn't some quirk of lsof, as far as I know.

Additional information

I don't see any reference to abstract namespaces in the documentation, so I'm not sure if this is officially supported. However, I note PR #49667, which appears to be about fixing this, and which introduces a test that binds using the same address syntax (a null byte followed by a name). AFAICT that landed in 20.8.0, so I was hoping this would work.

(That test connects to the socket using http.get, and I can do the same thing locally and it works... but the fact that lsof renders the address that way seems like there is a bug somewhere...)

@lpinca lpinca added the net Issues and PRs related to the net subsystem. label Nov 25, 2023
@santigimeno
Copy link
Member

This has been fixed in libuv by libuv/libuv@1dd0ab1.

@santigimeno santigimeno added the libuv Issues and PRs related to the libuv dependency or the uv binding. label Dec 26, 2023
@santigimeno
Copy link
Member

Fixed in 36dcd39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants