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.6-branch] net: fix handle unaligned memory access in net_context_bind() #79238

Merged
merged 1 commit into from
Oct 2, 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 Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. area: Networking labels Oct 1, 2024
@henrikbrixandersen henrikbrixandersen merged commit 6937dab into v3.6-branch Oct 2, 2024
22 of 23 checks passed
@henrikbrixandersen henrikbrixandersen deleted the backport-77376-to-v3.6-branch branch October 2, 2024 08:06
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 Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants