From 883e3ab7fb2b360c9cb37f9ee63d5e010fb21c8f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 28 May 2026 10:04:22 +0200 Subject: [PATCH] virtio-devices: vsock: Use desc_chain.memory() for header commit process_rx writes the packet header back into the descriptor chain it is currently processing, so the write must go through that chain's memory snapshot. Rederefing self.mem.memory() resolves to the same snapshot today, but couples the write on the chain to the device's atomic handle and obscures intent. Match the pattern used by the rest of the device by writing through desc_chain.memory(). Suggested-by: Rob Bradford Signed-off-by: Anatol Belski --- virtio-devices/src/vsock/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtio-devices/src/vsock/device.rs b/virtio-devices/src/vsock/device.rs index ef79e7d78..338dd6c4c 100644 --- a/virtio-devices/src/vsock/device.rs +++ b/virtio-devices/src/vsock/device.rs @@ -137,7 +137,7 @@ where ) { Ok(mut pkt) => { if self.backend.write().unwrap().recv_pkt(&mut pkt).is_ok() { - match pkt.commit_hdr(&*self.mem.memory()) { + match pkt.commit_hdr(desc_chain.memory()) { Ok(()) => pkt.hdr().len() as u32 + pkt.len(), Err(err) => { warn!(