[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/12] io/channel-socket: qio_channel_socket_flush(): improve msg
|
From: |
Peter Maydell |
|
Subject: |
[PULL 10/12] io/channel-socket: qio_channel_socket_flush(): improve msg validation |
|
Date: |
Mon, 6 Nov 2023 15:32:36 +0000 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
For SO_EE_ORIGIN_ZEROCOPY the 32-bit notification range is encoded
as [ee_info, ee_data] inclusively, so ee_info should be less or
equal to ee_data.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Maksim Davydov <davydov-max@yandex-team.ru>
Message-id: 20231017125941.810461-7-vsementsov@yandex-team.ru
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
io/channel-socket.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/io/channel-socket.c b/io/channel-socket.c
index 02ffb51e995..3a899b06085 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -782,6 +782,11 @@ static int qio_channel_socket_flush(QIOChannel *ioc,
"Error not from zero copy");
return -1;
}
+ if (serr->ee_data < serr->ee_info) {
+ error_setg_errno(errp, serr->ee_origin,
+ "Wrong notification bounds");
+ return -1;
+ }
/* No errors, count successfully finished sendmsg()*/
sioc->zero_copy_sent += serr->ee_data - serr->ee_info + 1;
--
2.34.1
- [PULL 00/12] target-arm queue, Peter Maydell, 2023/11/06
- [PULL 01/12] hw/arm/virt: fix PMU IRQ registration, Peter Maydell, 2023/11/06
- [PULL 03/12] hw/arm/virt: Report correct register sizes in ACPI DBG2/SPCR tables., Peter Maydell, 2023/11/06
- [PULL 11/12] hw/arm/vexpress-a9: Remove useless mapping of RAM at address 0, Peter Maydell, 2023/11/06
- [PULL 04/12] tests/qtest/bios-tables-test: Update virt SPCR and DBG2 golden references, Peter Maydell, 2023/11/06
- [PULL 07/12] mc146818rtc: rtc_set_time(): initialize tm to zeroes, Peter Maydell, 2023/11/06
- [PULL 05/12] hw/i386/intel_iommu: vtd_slpte_nonzero_rsvd(): assert no overflow, Peter Maydell, 2023/11/06
- [PULL 06/12] util/filemonitor-inotify: qemu_file_monitor_watch(): assert no overflow, Peter Maydell, 2023/11/06
- [PULL 10/12] io/channel-socket: qio_channel_socket_flush(): improve msg validation,
Peter Maydell <=
- [PULL 09/12] hw/core/loader: gunzip(): initialize z_stream, Peter Maydell, 2023/11/06
- [PULL 08/12] block/nvme: nvme_process_completion() fix bound for cid, Peter Maydell, 2023/11/06
- [PULL 02/12] tests/qtest/bios-tables-test: Allow changes to virt SPCR and DBG2, Peter Maydell, 2023/11/06
- [PULL 12/12] target/arm: Fix A64 LDRA immediate decode, Peter Maydell, 2023/11/06
- Re: [PULL 00/12] target-arm queue, Stefan Hajnoczi, 2023/11/06