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 <rbradford@meta.com>
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-05-28 10:04:22 +02:00
committed by Rob Bradford
parent 496ac197e6
commit 883e3ab7fb

View File

@@ -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!(