summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorXavi Hernandez <xhernandez@redhat.com>2019-12-11 18:21:14 +0100
committerRinku Kothiya <rkothiya@redhat.com>2019-12-18 10:28:53 +0000
commit4c28fd05c5e0792b96d38497d20eb36462ad7a9e (patch)
tree71c1c53d6392de4fec599961da98c3d2bd57ff8e /tests
parentac108947b0f25293c154707b70ea01eb3774f542 (diff)
socket: fix error handling
When __socket_proto_state_machine() detected a problem in the size of the request or it couldn't allocate an iobuf of the requested size, it returned -ENOMEM (-12). However the caller was expecting only -1 in case of error. For this reason the error passes undetected initially, adding back the socket to the epoll object. On further processing, however, the error is finally detected and the connection terminated. Meanwhile, another thread could receive a poll_in event from the same connection, which could cause races with the connection destruction. When this happened, the process crashed. To fix this, all error detection conditions have been hardened to be more strict on what is valid and what not. Also, we don't return -ENOMEM anymore. We always return -1 in case of error. An additional change has been done to prevent destruction of the transport object while it may still be needed. Backport of: > Change-Id: I6e59cd81cbf670f7adfdde942625d4e6c3fbc82d > Fixes: bz#1782495 > Signed-off-by: Xavi Hernandez <xhernandez@redhat.com> Change-Id: I6e59cd81cbf670f7adfdde942625d4e6c3fbc82d Fixes: bz#1783227 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions