-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Descriptor count in virtio_vring_info and fw_rsc_vdev_vring are differing data types, leading to possible truncation on assignment #399
Comments
Right!
could you send a PR to propose it? |
@arnopo Yes, will do. I have a couple PRs I'm going to push out together maybe next week - week after at the latest. |
@arnopo Changing num_descs to uint32_t will also require vq_nentries in the virtqueue struct to change to uint32_t (otherwise we're just pushing the truncation further up), which causes additional fallout throughout the code with data type changes. Is it even feasible that an application would want more buffers than 65,535? If no, I suggest we not make this change. We cannot change num in fw_rsc_vdev_vring to be uint16_t or the resource tables won't be compatible going forward, but can we document that num can only be 16-bits in length? |
Having more than 65,535 does not seem like a realistic use case to me. |
num is a uint32_t in fw_rsc_vdev_vring, but this value gets cast to uint16_t by rproc_virtio_init_vring when assigning num_descs to vring_info->info.num_descs.
It is improbable that someone would configure uint32_t number of descriptors, but it would be more correct for these two data members to match in type.
The text was updated successfully, but these errors were encountered: