aboutsummaryrefslogtreecommitdiff
path: root/lib/libvfio-user.c
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2020-12-02 08:04:42 -0500
committerThanos <tmakatos@gmail.com>2020-12-02 13:22:32 +0000
commit4f2c14c5fc74358418e7467748804fb92d8b6013 (patch)
tree117bc2d3bae2467c12b96f6c4381c83009102f09 /lib/libvfio-user.c
parent96d4f11b562159033661ebb9dc7f260274a8ac79 (diff)
downloadlibvfio-user-4f2c14c5fc74358418e7467748804fb92d8b6013.zip
libvfio-user-4f2c14c5fc74358418e7467748804fb92d8b6013.tar.gz
libvfio-user-4f2c14c5fc74358418e7467748804fb92d8b6013.tar.bz2
don't spam logs when closing unexpected file descriptor
A malicious client might take advantage of this behavior. Also, don't differentiate between failure and extraneous FD cases. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/libvfio-user.c')
-rw-r--r--lib/libvfio-user.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index eb390e6..8cf37f1 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -1033,13 +1033,9 @@ process_request(vfu_ctx_t *vfu_ctx)
for (i = 0; i < nr_fds; i++) {
if (fds[i] != -1) {
- if (ret < 0) {
- vfu_log(vfu_ctx, LOG_WARNING,
- "closing unexpected fd %d (index %zu) from cmd %u",
- fds[i], i, hdr.cmd);
- } else {
- vfu_log(vfu_ctx, LOG_DEBUG, "closing fd %d", fds[i]);
- }
+ vfu_log(vfu_ctx, LOG_DEBUG,
+ "closing unexpected fd %d (index %zu) from cmd %u",
+ fds[i], i, hdr.cmd);
close(fds[i]);
}
}