Skip to contentSkip to conversation

Patch for RTDM recvmsg bug

Xenomai-core Applied Sebastian Smolorz 2 participants 2 messages Nov 10, 2005 – Nov 12, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

here's a patch for a bug in skins/rtdm/syscall.c. The msghdr was not copied to user space upon completion of a recvmsg() call if the return value was not equal to zero. But recvmsg shall return the length of the message in bytes (according to IEEE Std 1003.1).

I have the permission from Jan to patch his code. ;-)

Sebastian

syscall.c renamed from skins/rtdm/syscall.c +1 -1
@@ -99,7 +99,7 @@ static int sys_rtdm_recvmsg(struct task_
 
     ret = _rtdm_recvmsg(curr, __xn_reg_arg1(regs), &krnl_msg,
                         __xn_reg_arg3(regs));
-    if (!ret)
+    if (ret >= 0)
         __xn_copy_to_user(curr, (void __user *)__xn_reg_arg2(regs), &krnl_msg,
                           sizeof(krnl_msg));
 
#1 lore raw
Quoted 7 lines · Sebastian Smolorz

Hi,

here's a patch for a bug in skins/rtdm/syscall.c. The msghdr was not copied to user space upon completion of a recvmsg() call if the return value was not equal to zero. But recvmsg shall return the length of the message in bytes (according to IEEE Std 1003.1).

Applied, thanks.

Quoted 27 lines

I have the permission from Jan to patch his code. ;-)

Sebastian

------------------------------------------------------------------------

syscall.c renamed from skins/rtdm/syscall.c +1 -2
@@ -99,7 +99,7 @@ static int sys_rtdm_recvmsg(struct task_
 
     ret = _rtdm_recvmsg(curr, __xn_reg_arg1(regs), &krnl_msg,
                         __xn_reg_arg3(regs));
-    if (!ret)
+    if (ret >= 0)
         __xn_copy_to_user(curr, (void __user *)__xn_reg_arg2(regs), &krnl_msg,
                           sizeof(krnl_msg));
 
 
 
------------------------------------------------------------------------

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

Signature · 1 line
Philippe.