[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1IaLAA-000853-8q@ZenIV.linux.org.uk>
Date: Wed, 26 Sep 2007 01:54:02 +0100
From: Al Viro <viro@....linux.org.uk>
To: torvalds@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, rusty@...tcorp.com.au
Subject: [PATCH] put_user() on struct is not nice
use copy_to_user() instead...
Signed-off-by: Al Viro <viro@...iv.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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists