qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix pointer arithmetic in indirect read for libvhost-user and libvduse
@ 2024-01-13  1:27 Temir Zharaspayev
  2024-01-13  1:27 ` [PATCH 1/2] libvhost-user: Fix pointer arithmetic in indirect read Temir Zharaspayev
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Temir Zharaspayev @ 2024-01-13  1:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael S. Tsirkin, Xie Yongji, Temir Zharaspayev

Hello! I have found a problem with virtqueue_read_indirect_desc function, which
was advancing pointer to struct as it was a byte pointer, so every element
comming after first chunk would be copied somewhere out of buffer.

As I understand this is cold path, but nevertheless worth fixing.

Also, exacly same problem in vduse_queue_read_indirect_desc function, because
as I understand it is a copy of virtqueue_read_indirect_desc with vduse
backend.

I was not sure if element of scattered buffer may end in the middle of
vring_desc struct data, so instead of writing
desc += read_len/sizeof(struct vring_desc)
have implemented fix with proper byte pointer arithmetic.

Sincerely,
Temir.

Temir Zharaspayev (2):
  libvhost-user: Fix pointer arithmetic in indirect read
  libvduse: Fix pointer arithmetic in indirect read

 subprojects/libvduse/libvduse.c           | 11 ++++++-----
 subprojects/libvhost-user/libvhost-user.c | 11 ++++++-----
 2 files changed, 12 insertions(+), 10 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-18 23:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-13  1:27 [PATCH 0/2] Fix pointer arithmetic in indirect read for libvhost-user and libvduse Temir Zharaspayev
2024-01-13  1:27 ` [PATCH 1/2] libvhost-user: Fix pointer arithmetic in indirect read Temir Zharaspayev
2024-04-18 13:55   ` Daniel P. Berrangé
2024-04-18 23:12     ` Raphael Norwitz
2024-01-13  1:27 ` [PATCH 2/2] libvduse: " Temir Zharaspayev
2024-02-04  9:41 ` [PATCH 0/2] Fix pointer arithmetic in indirect read for libvhost-user and libvduse Тимур
2024-04-18 12:19   ` Peter Maydell
2024-04-18 13:57   ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).