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

[Backport v3.7-branch] net: fix handle unaligned memory access in net_context_bind() #79237

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

zephyrbot
Copy link
Collaborator

@zephyrbot zephyrbot commented Oct 1, 2024

Backport b24c520 from #77376.

Fixes #77188

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>
(cherry picked from commit b24c520)
@zephyrbot zephyrbot added Backport Backport PR and backport failure issues area: Networking size: XS A PR changing only a single line of code labels Oct 1, 2024
@henrikbrixandersen henrikbrixandersen added this to the v3.7.1 milestone Oct 1, 2024
@nashif nashif merged commit bc18a9a into v3.7-branch Oct 5, 2024
30 of 31 checks passed
@nashif nashif deleted the backport-77376-to-v3.7-branch branch October 5, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking Backport Backport PR and backport failure issues size: XS A PR changing only a single line of code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants