Skip to content

Commit

Permalink
Use copy_to_user() not put_user for struct timespec
Browse files Browse the repository at this point in the history
Use copy_to_user() when copying a struct timespec to the guest -
put_user() cannot handle two long's in one go on a 64bit arch.

Signed-off-by: Jes Sorensen <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Cc: Jes Sorensen <[email protected]>
Cc: Al Viro <[email protected]>
  • Loading branch information
Jes Sorensen authored and rustyrussell committed Oct 23, 2007
1 parent babed5c commit 891ff65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/lguest/hypercalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

0 comments on commit 891ff65

Please sign in to comment.