CHERIoT-Platform / CHERIoT-Platform/network-stack

Connection capabilities allow compartments to open an unlimited number of TCP connections

Open
#45 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
9
Forks
14
Avg merge
6d 17h
Merged PRs (30d)
1

Description

Let us assume that two compartments, A and B, use the network stack to create TCP connections.

Compartment A can prevent compartment B from establishing new network connections by using up all the TCP connection slots in the network stack.

This number (the maximum number of concurrent TCP connections) is quite limited in practice, typically <10, for memory usage reasons, see https://github.com/CHERIoT-Platform/network-stack/commit/86655f6c3a9133344fc05a03a1ce216630c9d6f2#diff-2ac1b26f6aca4a80627e284a1d72685579cf5f4deafad7a45ae565abd0cbcde4.

The problem stems from the fact that connection capabilities do not come with a limit on how many times they can be used: compartment A can call `network_socket_connect_tcp` as many times as it wants to exhaust the maximum number of concurrent TCP connections.

A potential solution would be to have users declare a maximum number of concurrent TCP connections in the connection capability, and use that as a counter - decrement on each connection, and when it reaches zero, further calls to `network_socket_connect_tcp` fail. One difficulty is that the counter would need to be incremented on `network_socket_close`, at which point we do not have access to the connection capability anymore.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.