Skip to content

Fix control messages in sys_rtdm_recvmsg

Manuel Huber xenomai 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3rtdm: Fix msghdr struct (cmsg) in sys_rtdm_recvmsgksrc/skins/rtdm/syscall.c+14 -40 replies
2/3rtcan: Adapt rtcan_raw to changes in rtdmksrc/drivers/can/rtcan_raw.c+16 -170 replies
3/3doc: Add documentation to rtdm_recvmsg_handler_tinclude/rtdm/rtdm_driver.h+8 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Xenomai] [PATCH 0/3] Fix control messages in sys_rtdm_recvmsg

This patch-set shall fix the recvmsg system-call and its handling of control messages and the msghdr structure. It is necessary to be able to apply another patch to RTnet, which depends on a correct handling of msg_controllen.
Jan pointed out, that all driver code that relies on the current interface has to be adapted to the new one. I checked the driver code and I found can drivers to be the only ones affected. Finally, the changes to the system call have been documented in rtdm_driver.h header file. Please let me know if it's unclear...

I used a recent linux kernel as reference of how to implement the handling of msghdr. The patch changes the hadnling of msg_namelen as it won't get written back to user-space if it has been modified by driver code. That's what the Kernel does. However, there are also drivers in the Kernel tree that write to msg_namelen, so I'm not really sure what's the correct behaviour. So this might break user code that relies on this write-back although I can't really imagine a use-case where you actually need to check the size. Usually you have to know the address type (structure) to be able to interepret the address correctly.

Manuel Huber (3):
rtdm: Fix msghdr struct (cmsg) in sys_rtdm_recvmsg
rtcan: Adapt rtcan_raw to changes in rtdm
doc: Add documentation to rtdm_recvmsg_handler_t

 include/rtdm/rtdm_driver.h   |  9 ++++++++-
 ksrc/drivers/can/rtcan_raw.c | 33 ++++++++++++++++-----------------
 ksrc/skins/rtdm/syscall.c    | 18 ++++++++++++++----
 3 files changed, 38 insertions(+), 22 deletions(-)
Signature · 1 line
1.8.3