-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
net: socket: recvmsg() doesn't update msg_controllen accordingly #77303
Comments
cc @jukkar |
Cc: @awojasinski please take a look, seems to be related to the ptp pr |
I've been able to get more info on the root cause. So the problem comes from the I came up with the following patch, the idea is to not clear msg_controllen only when adding pkt info was a success.
|
@axelnxp looks good, please send a PR for it. |
If adding any control data like timestamping or pkt_info fails, the msg_controllen wasn't properly cleared. This commit aims to fix this by clearing the msg_controllen only when adding control data is successful. Fixes zephyrproject-rtos#77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is not cleared correctly. Fixes zephyrproject-rtos#77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is not cleared correctly. Fixes zephyrproject-rtos#77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is not cleared correctly. Fixes zephyrproject-rtos#77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is cleared incorrectly. Fixes zephyrproject-rtos#77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is cleared incorrectly. Fixes zephyrproject-rtos#77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is cleared incorrectly. Fixes zephyrproject-rtos#77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is cleared incorrectly. Fixes #77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com> (cherry picked from commit 5d643f4)
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is cleared incorrectly. Fixes #77303 Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com> (cherry picked from commit 5d643f4)
According to recvmsg man page, msg_controllen should be set to the sum of the length of all control messages in the buffer. This is missing from the current recvmsg implementation. This commit aims to fix this by updating msg_controllen each time control data are added to the buffer. This commit also fixes cases where the msg_controllen is cleared incorrectly. Fixes zephyrproject-rtos#77303 (cherry picked from commit 5d643f4) Original-Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com> GitOrigin-RevId: 5d643f4 Cr-Build-Id: 8738638626547930177 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8738638626547930177 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: I22809d442ac56b4f293e52efa6a4a24f090ab02a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5810440 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Describe the bug
The bug is exactly the same than it was with #68352.
This was fixed at the time, but I think the changes from #73713 introduced the regression.
msg_controllen
is still set to the initial length, whilecsmg_len
is set to 0.If I bypass this added code, I don't reproduce the issue.
Maybe the problem comes from
add_timestamping
? Does it update thecsmg_len
accordingly (if applicable) ?To Reproduce
One can reuse the matter function where the issue is observed:
https://github.com/project-chip/connectedhomeip/blob/master/src/inet/UDPEndPointImplSockets.cpp#L611
And make sure no control data is received.
Expected behavior
msg_controllen
field shall be updated byrecvmsg
according to the control data received.Impact
Impact is high, in the current state, any Matter application over Zephyr would be impacted, likely unable to even perform a commissioning.
The text was updated successfully, but these errors were encountered: