xen-troops / zephyr-xenlib

Set of Zephyr libs and applications that provides basic Dom0 services
Apache License 2.0
0 stars 10 forks source link

vch: guard vchannel handle from uninitialized access #44

Closed sa-kib closed 1 year ago

sa-kib commented 1 year ago

Zero client/server vchannel handles on error, so that no dangling pointers are left in the structure.

This is done in case vch_read()/vch_write() is accidentally called on not opened vchannel, and some non-zero non-valid leftover pointers (like h->ring) confuse validation logic.

Also validate the ring pointer when checking for opened channel.

oleksiimoisieiev commented 1 year ago

+1 Acked-by: Oleksii Moisieiev oleksii_moisieiev@epam.com

sa-kib commented 1 year ago

rebased + tags added

oleksiimoisieiev commented 1 year ago

@sa-kib I see chechpatch errors in this MR