In the Linux kernel, the following vulnerability has been resolved:
net/smc: fix connection leak
There's a potential leak issue under following execution sequence :
smcrelease smcconnectwork if (sk->skstate == SMCINIT) sendclcconfirim tcpabort(); ... sk.skstate = SMCACTIVE smccloseactive switch(sk->skstate) { ... case SMCACTIVE: smcclosefinal() // then wait peer closed
Unfortunately, tcp_abort() may discard CLC CONFIRM messages that are still in the tcp send buffer, in which case our connection token cannot be delivered to the server side, which means that we cannot get a passive close message at all. Therefore, it is impossible for the to be disconnected at all.
This patch tries a very simple way to avoid this issue, once the state has changed to SMCACTIVE after tcpabort(), we can actively abort the smc connection, considering that the state is SMCINIT before tcpabort(), abandoning the complete disconnection process should not cause too much problem.
In fact, this problem may exist as long as the CLC CONFIRM message is not received by the server. Whether a timer should be added after smcclosefinal() needs to be discussed in the future. But even so, this patch provides a faster release for connection in above case, it should also be valuable.