All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] Patch for RTDM recvmsg bug
@ 2005-11-10 16:07 Sebastian Smolorz
  2005-11-12 22:57 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Smolorz @ 2005-11-10 16:07 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: TEXT/PLAIN, Size: 332 bytes --]

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

[-- Attachment #2: Type: TEXT/PLAIN, Size: 463 bytes --]

--- xenomai/skins/rtdm/syscall.c	2005-11-10 16:45:24.000000000 +0100
+++ syscall.c	2005-11-10 16:27:08.000000000 +0100
@@ -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));
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai-core] Patch for RTDM recvmsg bug
  2005-11-10 16:07 [Xenomai-core] Patch for RTDM recvmsg bug Sebastian Smolorz
@ 2005-11-12 22:57 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2005-11-12 22:57 UTC (permalink / raw)
  To: Sebastian Smolorz; +Cc: xenomai

Sebastian Smolorz wrote:
> 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.

> I have the permission from Jan to patch his code. ;-)
> 
> 
> Sebastian
> 
> 
> ------------------------------------------------------------------------
> 
> --- xenomai/skins/rtdm/syscall.c	2005-11-10 16:45:24.000000000 +0100
> +++ syscall.c	2005-11-10 16:27:08.000000000 +0100
> @@ -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
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core


-- 

Philippe.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-12 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-10 16:07 [Xenomai-core] Patch for RTDM recvmsg bug Sebastian Smolorz
2005-11-12 22:57 ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.