Skip to content

Safety: Sanity-cap the init-channel counts received from the opposing peer at session open. #36

Open

Description

@ygoldfeld

Sanity-cap the init-channel counts received from the opposing peer at session open, internally via the SMC (session master channel) (server side: LogInReq.numInitChannelsByCliReq; client side: LogInRsp.numInitChannelsBySrvReq plus the local count). Today a nonsensical value from a buggy (or foreign... but again, we assume trust of the peer) peer can throw inside the worker thread's reserve() and terminate the process, or can wrap the size_t sum. Choose a cap and an error code, and document the limit on the advanced sync_connect() and async_accept() overloads.

P.S. This is a safety thing; really there's quite a bit of protocol over the SMC -- and some other data-channels/layers -- and weird/bad/huge values in various places could probably had bad effects. We assume trust, so such things are best-effort in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions