All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net: fix compat_sys_recvmmsg parameter type
@ 2009-12-10  6:58 Heiko Carstens
  2009-12-10 12:47 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2009-12-10  6:58 UTC (permalink / raw)
  To: David Miller; +Cc: Arnaldo Carvalho de Melo, linux-kernel, netdev

From: Heiko Carstens <heiko.carstens@de.ibm.com>

compat_sys_recvmmsg has a compat_timespec parameter and not a
timespec parameter. This way we also get rid of an odd cast.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 include/net/compat.h |    2 +-
 net/compat.c         |   12 +++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

Index: linux-2.6/include/net/compat.h
===================================================================
--- linux-2.6.orig/include/net/compat.h
+++ linux-2.6/include/net/compat.h
@@ -46,7 +46,7 @@ extern asmlinkage long compat_sys_sendms
 extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
 extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *,
 					   unsigned, unsigned,
-					   struct timespec __user *);
+					   struct compat_timespec __user *);
 extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
 extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
 
Index: linux-2.6/net/compat.c
===================================================================
--- linux-2.6.orig/net/compat.c
+++ linux-2.6/net/compat.c
@@ -754,26 +754,24 @@ asmlinkage long compat_sys_recvfrom(int 
 
 asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
 				    unsigned vlen, unsigned int flags,
-				    struct timespec __user *timeout)
+				    struct compat_timespec __user *timeout)
 {
 	int datagrams;
 	struct timespec ktspec;
-	struct compat_timespec __user *utspec;
 
 	if (timeout == NULL)
 		return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
 				      flags | MSG_CMSG_COMPAT, NULL);
 
-	utspec = (struct compat_timespec __user *)timeout;
-	if (get_user(ktspec.tv_sec, &utspec->tv_sec) ||
-	    get_user(ktspec.tv_nsec, &utspec->tv_nsec))
+	if (get_user(ktspec.tv_sec, &timeout->tv_sec) ||
+	    get_user(ktspec.tv_nsec, &timeout->tv_nsec))
 		return -EFAULT;
 
 	datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
 				   flags | MSG_CMSG_COMPAT, &ktspec);
 	if (datagrams > 0 &&
-	    (put_user(ktspec.tv_sec, &utspec->tv_sec) ||
-	     put_user(ktspec.tv_nsec, &utspec->tv_nsec)))
+	    (put_user(ktspec.tv_sec, &timeout->tv_sec) ||
+	     put_user(ktspec.tv_nsec, &timeout->tv_nsec)))
 		datagrams = -EFAULT;
 
 	return datagrams;

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

* Re: [PATCH 1/2] net: fix compat_sys_recvmmsg parameter type
  2009-12-10  6:58 [PATCH 1/2] net: fix compat_sys_recvmmsg parameter type Heiko Carstens
@ 2009-12-10 12:47 ` Arnaldo Carvalho de Melo
  2009-12-11 23:16   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-12-10 12:47 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: David Miller, linux-kernel, netdev

Em Thu, Dec 10, 2009 at 07:58:16AM +0100, Heiko Carstens escreveu:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> compat_sys_recvmmsg has a compat_timespec parameter and not a
> timespec parameter. This way we also get rid of an odd cast.
> 
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Was unaware of this helper, thanks!

Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

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

* Re: [PATCH 1/2] net: fix compat_sys_recvmmsg parameter type
  2009-12-10 12:47 ` Arnaldo Carvalho de Melo
@ 2009-12-11 23:16   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-12-11 23:16 UTC (permalink / raw)
  To: acme; +Cc: heiko.carstens, linux-kernel, netdev

From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Thu, 10 Dec 2009 10:47:06 -0200

> Em Thu, Dec 10, 2009 at 07:58:16AM +0100, Heiko Carstens escreveu:
>> From: Heiko Carstens <heiko.carstens@de.ibm.com>
>> 
>> compat_sys_recvmmsg has a compat_timespec parameter and not a
>> timespec parameter. This way we also get rid of an odd cast.
>> 
>> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
>> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> Was unaware of this helper, thanks!
> 
> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Applied.

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

end of thread, other threads:[~2009-12-11 23:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-10  6:58 [PATCH 1/2] net: fix compat_sys_recvmmsg parameter type Heiko Carstens
2009-12-10 12:47 ` Arnaldo Carvalho de Melo
2009-12-11 23:16   ` David Miller

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.