Re: [PATCH 1/2] hw/net/virtio-net.c: Don't assume IP length field is aligned

2024-11-11 Thread Yuri Benditovich
On Sun, Nov 10, 2024 at 1:10 PM Yan Vugenfirer wrote: > Please take a look is this is host\guest common struct > > -- Forwarded message - > From: Peter Maydell > Date: Thu, Nov 7, 2024 at 6:33 PM > Subject: [PATCH 1/2] hw/net/virtio-net.c: Don't as

Re: [PATCH 1/2] hw/net/virtio-net.c: Don't assume IP length field is aligned

2024-11-10 Thread Jason Wang
On Fri, Nov 8, 2024 at 4:48 AM Peter Maydell wrote: > > On Thu, 7 Nov 2024 at 16:32, Peter Maydell wrote: > > > > In virtio-net.c we assume that the IP length field in the packet is > > aligned, and we copy its address into a uint16_t* in the > > VirtioNetRscUnit struct which we then dereference

Re: [PATCH 1/2] hw/net/virtio-net.c: Don't assume IP length field is aligned

2024-11-07 Thread Peter Maydell
On Thu, 7 Nov 2024 at 16:32, Peter Maydell wrote: > > In virtio-net.c we assume that the IP length field in the packet is > aligned, and we copy its address into a uint16_t* in the > VirtioNetRscUnit struct which we then dereference later. This isn't > a safe assumption; it will also result in co

[PATCH 1/2] hw/net/virtio-net.c: Don't assume IP length field is aligned

2024-11-07 Thread Peter Maydell
In virtio-net.c we assume that the IP length field in the packet is aligned, and we copy its address into a uint16_t* in the VirtioNetRscUnit struct which we then dereference later. This isn't a safe assumption; it will also result in compilation failures if we mark the ip_header struct as QEMU_PA