You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think it is needed to use the flag now. The upstream kernel commit says connect(2) when it should say socket(2). As I
explained in the comment you linked here, if you use the "newfd" field when issuing the addfd ioctl, this race won't be a problem. It will be a problem if you handle socket, not connect.
The thing is, if the container received EINTR between the agent did the addfd and before it answered the syscall, it will be retried. If the agent does the addfd again without setting the newfd, then a new fd will be allocated. This can happen several times and the container end up with N fds, instead of just 1. But if you always use the "newfd" number, then even if you inject the fd several times, you close the old one (it has the same fd number, that is what addfd does if newfd is currently in use) and therefore there is no leak :)
Originally posted by @rata in #1 (comment)
The text was updated successfully, but these errors were encountered: