JianyuWang0623 opened a new pull request, #22105:
URL: https://github.com/apache/nuttx/pull/22105

   kasan: fix the virtio transport write address error caused by kasan tag
   
   Summary
   - drivers/misc/addrenv.c: clear the KASAN tag before the simple addrenv
     lookup in up_addrenv_va_to_pa().  A tagged VA fails the range check and
     is then returned unchanged as a physical address.
   - drivers/virtio/virtio-mmio.c: program the virtqueue desc/avail/used
     addresses with up_addrenv_va_to_pa() instead of kasan_clear_tag(),
     matching virtio-pci-legacy/modern and virtio-gpu.
   
   Impact
   - KASAN tag-based modes: the queue addresses written to the device no
     longer carry pointer tags (CONFIG_DEV_SIMPLE_ADDRENV builds) and now
     go through proper VA-to-PA translation on other builds.
   - No KASAN / identity-mapped builds: the resulting address is unchanged.
   - Behavior change: virtio-mmio v2 queue registers now receive the
     up_addrenv_va_to_pa() translation result instead of the untagged VA.
   
   Testing (qemu-system-aarch64, virt machine, virtio-net over
   virtio-mmio v2; ping -c 4 10.0.2.2)
   - MM_KASAN_SW_TAGS without CONFIG_DEV_SIMPLE_ADDRENV: 4/4 on both
     master and this branch.
   - MM_KASAN_SW_TAGS with CONFIG_DEV_SIMPLE_ADDRENV: 4/4 on both master
     and this branch; also 4/4 here with a registered addrenv table.
   - No KASAN (netnsh config): 4/4 on this branch.
   - MM_KASAN_HW_TAGS (MTE): first ICMP echo reply succeeds on both
     master and this branch; both then hit a pre-existing fatal in
     mempool_release() unrelated to this change.
   - A build with only the virtio-mmio change (second commit without the
     first) shows 100% ping loss with CONFIG_DEV_SIMPLE_ADDRENV,
     confirming the addrenv fix is required for the virtio change.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to