Skip to content
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

rpmsg_virtio_get_tx_payload_buffer assumes a full header will be present #349

Open
tammyleino opened this issue Feb 9, 2022 · 4 comments
Labels

Comments

@tammyleino
Copy link
Collaborator

rpmsg_virtio_get_tx_payload_buffer assumes the payload will contain a full header and does not check whether the returned buffer size from rpmsg_virtio_get_tx_buffer is at least size of "rpmsg_hdr" structure before buffer size is decremented. Is it impossible for a bad packet to be received at this layer?

@arnopo
Copy link
Collaborator

arnopo commented Feb 14, 2022

At least for the host (master) a check should be added in rpmsg_init_vdev_with_config to ensure that the buffers size is valid.
Then an assert could be added for device (slave) to protect from or invalid initialization or memory corruption.

@tammyleino
Copy link
Collaborator Author

Is it necessary to use rpmsg_init_vdev_with_config though? Isn't it optional to use rpmsg_init_vdev instead?

@arnopo
Copy link
Collaborator

arnopo commented Feb 21, 2022

you can use rpmsg_init_vdev which internally calls rpmsg_init_vdev_with_config with the RPMSG_VIRTIO_DEFAULT_CONFIG config

@github-actions
Copy link

This issue has been marked as a stale issue because it has been open (more than) 45 days with no activity.

@github-actions github-actions bot added the Stale label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants