summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorXavi Hernandez <xhernandez@redhat.com>2019-12-11 18:21:14 +0100
committerXavi Hernandez <xhernandez@redhat.com>2019-12-13 12:48:19 +0100
commit78b63e0feed1937cae66156ea455a3977847a2fd (patch)
tree671842ca350ced326361af477d0a40b4579633ee /cli
parentc95bfb0fddc609d39c2e2a44fe7dce1d95ccf506 (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#1749625 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'cli')
0 files changed, 0 insertions, 0 deletions