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

drivers: serial: emul: Make fifo_read() respect size #68632

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

antevir
Copy link
Contributor

@antevir antevir commented Feb 6, 2024

uart_emul_fifo_read() didn't regard the size arg, hence if the RX ring buffer contained more data than the size of the input rx_data buffer size, this could result in buffer overflow. This becomes more obvious when configuring device tree property latch-buffer-size > 1.

@zephyrbot zephyrbot added Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. area: UART Universal Asynchronous Receiver-Transmitter labels Feb 6, 2024
@zephyrbot zephyrbot requested a review from dcpleung February 6, 2024 13:16
Copy link

github-actions bot commented Feb 6, 2024

Hello @antevir, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

uart_emul_fifo_read() didn't regard the size arg, hence if the RX ring
buffer contained more data than the size of the input rx_data buffer
size, this could result in buffer overflow. This becomes more obvious
when configuring device tree property latch-buffer-size > 1.

Signed-off-by: Andreas Anderberg <andreas.anderberg@u-blox.com>
@antevir antevir force-pushed the uart_emul_read_fix branch from 18f69f1 to 1e6f102 Compare February 7, 2024 08:00
@dcpleung dcpleung added this to the v3.6.0 milestone Feb 7, 2024
@MaureenHelm MaureenHelm merged commit 2b43c3b into zephyrproject-rtos:main Feb 7, 2024
16 checks passed
Copy link

github-actions bot commented Feb 7, 2024

Hi @antevir!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

@antevir antevir deleted the uart_emul_read_fix branch February 7, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UART Universal Asynchronous Receiver-Transmitter Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants