public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] put_user() on struct is not nice
@ 2007-09-26  0:54 Al Viro
  2007-09-26  2:05 ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2007-09-26  0:54 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, rusty


use copy_to_user() instead...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/lguest/hypercalls.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/lguest/hypercalls.c b/drivers/lguest/hypercalls.c
index db6caac..5ecd60b 100644
--- a/drivers/lguest/hypercalls.c
+++ b/drivers/lguest/hypercalls.c
@@ -295,6 +295,6 @@ void write_timestamp(struct lguest *lg)
 {
 	struct timespec now;
 	ktime_get_real_ts(&now);
-	if (put_user(now, &lg->lguest_data->time))
+	if (copy_to_user(&lg->lguest_data->time, &now, sizeof(struct timespec)))
 		kill_guest(lg, "Writing timestamp");
 }
-- 
1.5.3.GIT



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

end of thread, other threads:[~2007-09-26  3:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-26  0:54 [PATCH] put_user() on struct is not nice Al Viro
2007-09-26  2:05 ` Rusty Russell
2007-09-26  3:56   ` Al Viro

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