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

ipfs swarm limit all: returns empty "" Service and Protocol name #9577

Closed
lidel opened this issue Jan 21, 2023 · 2 comments · Fixed by #9680
Closed

ipfs swarm limit all: returns empty "" Service and Protocol name #9577

lidel opened this issue Jan 21, 2023 · 2 comments · Fixed by #9680
Labels
kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up topic/resource-manager Issues related to Swarm.ResourceMgr (resource manager)

Comments

@lidel
Copy link
Member

lidel commented Jan 21, 2023

This is a potential source of bugs due to val != "" checks returning invalid result.

To reproduce, run node for a while, then inspect the output of ipfs swarm limit all.
At some point, you will see protocol and service named "" (empty string).

I think I've seen error about empty PeerID suring --reset at some point too, but was not able to reproduce.

Could be a bug, or could be a malicious service that uses zero-length protocol to stay hidden.
Either way, we should not use "" and have "(empty)" or something, because "" leads to bugs.

"Protocols": {
        "": {
            "Conns": 1000000000,
            "ConnsInbound": 1000000000,
            "ConnsOutbound": 1000000000,
            "FD": 1000000000,
            "Memory": 1000000000,
            "Streams": 1000000000,
            "StreamsInbound": 1000000000,
            "StreamsOutbound": 1000000000
        },
        "/ipfs/bitswap/1.2.0": {
            "Conns": 1000000000,
            "ConnsInbound": 1000000000,
            "ConnsOutbound": 1000000000,
            "FD": 1000000000,
            "Memory": 1000000000,
            "Streams": 1000000000,
            "StreamsInbound": 1000000000,
            "StreamsOutbound": 1000000000
        },
...
"Services": {
        "": {
            "Conns": 1000000000,
            "ConnsInbound": 1000000000,
            "ConnsOutbound": 1000000000,
            "FD": 1000000000,
            "Memory": 1000000000,
            "Streams": 1000000000,
            "StreamsInbound": 1000000000,
            "StreamsOutbound": 1000000000
        },
        "libp2p.autonat": {
            "Conns": 0,
            "ConnsInbound": 0,
            "ConnsOutbound": 0,
            "FD": 0,
            "Memory": 20404224,
            "Streams": 94,
            "StreamsInbound": 94,
            "StreamsOutbound": 94
        },
...

cc #9417 (but not a hard blocker, we can fix this in 0.19)

@lidel lidel added kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up topic/resource-manager Issues related to Swarm.ResourceMgr (resource manager) labels Jan 21, 2023
This was referenced Jan 22, 2023
@BigLep
Copy link
Contributor

BigLep commented Jan 31, 2023

2023-01-31 conversation: @ajnavarro needs to reproduce this so can then fix.

@BigLep
Copy link
Contributor

BigLep commented Feb 16, 2023

I have made addressing this issue be part of #9621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up topic/resource-manager Issues related to Swarm.ResourceMgr (resource manager)
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants