[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/17] tests: vhost-user-test: release mutex on protocol violation
From: |
Paolo Bonzini |
Subject: |
[PULL 14/17] tests: vhost-user-test: release mutex on protocol violation |
Date: |
Sat, 29 Apr 2023 14:16:33 +0200 |
chr_read() is printing an error message and returning with s->data_mutex taken.
This can potentially cause a hang. Reported by Coverity.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/qtest/vhost-user-test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index bf9f7c4248ca..e4f95b2858f0 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -351,7 +351,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int
size)
if (size != msg.size) {
qos_printf("%s: Wrong message size received %d != %d\n",
__func__, size, msg.size);
- return;
+ goto out;
}
}
@@ -509,6 +509,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int
size)
break;
}
+out:
g_mutex_unlock(&s->data_mutex);
}
--
2.40.0
- [PULL 03/17] i386/sev: Update checks and information related to reduced-phys-bits, (continued)
- [PULL 03/17] i386/sev: Update checks and information related to reduced-phys-bits, Paolo Bonzini, 2023/04/29
- [PULL 04/17] i386/cpu: Update how the EBX register of CPUID 0x8000001F is set, Paolo Bonzini, 2023/04/29
- [PULL 05/17] target/i386: Add support for CMPCCXADD in CPUID enumeration, Paolo Bonzini, 2023/04/29
- [PULL 06/17] target/i386: Add support for AMX-FP16 in CPUID enumeration, Paolo Bonzini, 2023/04/29
- [PULL 07/17] target/i386: Add support for AVX-IFMA in CPUID enumeration, Paolo Bonzini, 2023/04/29
- [PULL 08/17] target/i386: Add support for AVX-VNNI-INT8 in CPUID enumeration, Paolo Bonzini, 2023/04/29
- [PULL 10/17] target/i386: Add support for PREFETCHIT0/1 in CPUID enumeration, Paolo Bonzini, 2023/04/29
- [PULL 09/17] target/i386: Add support for AVX-NE-CONVERT in CPUID enumeration, Paolo Bonzini, 2023/04/29
- [PULL 12/17] update-linux-headers.sh: Add missing kernel headers., Paolo Bonzini, 2023/04/29
- [PULL 13/17] Update linux headers to v6.3rc5, Paolo Bonzini, 2023/04/29
- [PULL 14/17] tests: vhost-user-test: release mutex on protocol violation,
Paolo Bonzini <=
- [PULL 16/17] async: Suppress GCC13 false positive in aio_bh_poll(), Paolo Bonzini, 2023/04/29
- [PULL 11/17] Fix libvhost-user.c compilation., Paolo Bonzini, 2023/04/29
- [PULL 15/17] target/hexagon: fix = vs. == mishap, Paolo Bonzini, 2023/04/29
- [PULL 17/17] cpus-common: stop using mb_set/mb_read, Paolo Bonzini, 2023/04/29