-
Notifications
You must be signed in to change notification settings - Fork 8.3k
net: fix handle unaligned memory access in net_context_bind() #77376
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
Conversation
|
Hello @hulryung, and thank you very much for your first pull request to the Zephyr project! |
|
@hulryung please fix the compliance issue, see https://github.com/zephyrproject-rtos/zephyr/actions/runs/10505684518/job/29103733784?pr=77376 |
This commit addresses an issue in net_context_bind() where unaligned memory access was not properly handled when checking for INADDR_ANY. The problem primarily affected MCUs like ARMv6 that don't support unaligned memory access. - Use UNALIGNED_GET() to safely access the sin_addr.s_addr field - Ensures correct behavior on architectures with alignment restrictions This fix improves compatibility and prevents potential crashes or unexpected behavior on affected platforms. Signed-off-by: Daekeun Kang <dkkang@huconn.com>
|
@jukkar, I have reviewed and corrected the compliance issue as you requested. |
|
Hi @hulryung! 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! 🪁 |
|
I'm wondering why this isn't labeled to be back ported to 3.7? It's a pretty serious issue on the Raspberry Pi Pico, because it causes a fatal exception in any build that includes DNS. I would assume that the same is true of /any/ board containing a RP2040. I think it's theoretically an issue 3.6 and previous releases too (I think I'd always just been lucky that the structure was already aligned). |
|
Good point, the labeling was just forgotten. I can submit a backport PR manually, I think the backport bot will not do anything if labeling the PR now. |
This commit addresses an issue in net_context_bind() where unaligned memory access was not properly handled when checking for INADDR_ANY. The problem primarily affected MCUs like ARMv6 that don't support unaligned memory access.
This fix improves compatibility and prevents potential crashes or unexpected behavior on affected platforms.
Fixes #77188