Skip to content

socket: fix AF_PACKET recvmsg() and sockaddr formatting#271

Merged
jow- merged 1 commit intomasterfrom
socket-fixes
Jan 25, 2025
Merged

socket: fix AF_PACKET recvmsg() and sockaddr formatting#271
jow- merged 1 commit intomasterfrom
socket-fixes

Conversation

@jow-
Copy link
Copy Markdown
Owner

@jow- jow- commented Jan 25, 2025

  • Do not unconditionally pass the MSG_CMSG_CLOEXEC flag to recvmsg() invocations as not all protocol specific recvmsg implementations in the kernel tolerate it; packet_recvmsg() for example will immediately return yield EINVAL if any non-whitelisted flag is passed.

  • Ensure that the HW address string buffer is zero-terminated when converting MAC addresses from C to ucode values.

 - Do not unconditionally pass the `MSG_CMSG_CLOEXEC` flag to `recvmsg()`
   invocations as not all protocol specific recvmsg implementations in the
   kernel tolerate it; `packet_recvmsg()` for example will immediately
   return yield `EINVAL` if any non-whitelisted flag is passed.

 - Ensure that the HW address string buffer is zero-terminated when
   converting MAC addresses from C to ucode values.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
@jow- jow- merged commit 5b74722 into master Jan 25, 2025
@jow- jow- deleted the socket-fixes branch June 10, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant