public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* compat_clock_getres shouldn't return -EFAULT if res == NULL
@ 2004-07-26 19:51 Arun Sharma
  2004-07-26 19:55 ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Arun Sharma @ 2004-07-26 19:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-arch

[-- Attachment #1: Type: text/plain, Size: 41 bytes --]


Description within the patch.

	-Arun



[-- Attachment #2: compat-clock-res.patch --]
[-- Type: text/plain, Size: 765 bytes --]

For clock_getres(clockid_t clock_id, struct timespec *res), the
specification says "If res is NULL, the clock resolution is not
returned." So this kind of call should succeed. The current implementation
returns -EFAULT.

The patch fixes the bug in compat_clock_getres().

Signed-off-by: Gordon Jin <gordon.jin@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

--- linux-2.6.7/kernel/compat.c.orig	2004-07-25 09:02:01.000000000 -0700
+++ linux-2.6.7/kernel/compat.c	2004-07-25 09:04:51.000000000 -0700
@@ -531,7 +531,7 @@
 	err = sys_clock_getres(which_clock,
 			       (struct timespec __user *) &ts);
 	set_fs(oldfs);
-	if (!err && put_compat_timespec(&ts, tp))
+	if (!err && tp && put_compat_timespec(&ts, tp))
 		return -EFAULT; 
 	return err;
 } 

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

end of thread, other threads:[~2004-07-26 20:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-26 19:51 compat_clock_getres shouldn't return -EFAULT if res == NULL Arun Sharma
2004-07-26 19:55 ` David S. Miller
2004-07-26 20:36   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox