put_user() on struct is not nice
PATCH 1/1 put_user() on struct is not nice
use copy_to_user() instead...
Signed-off-by Al Viro <[email protected]>
--- drivers/lguest/hypercalls.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/lguest/hypercalls.c +1 -1
@@ -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" ); }
Signature · 1 line
1.5.3.GIT
Quoted 1 line · Al Viro
use
copy_to_user()instead...
Thanks Al, Jes sent me the same fix which I have queued for for 2.6.24:
From: Jes Sorensen <[email protected]>
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]>
--- drivers/lguest/hypercalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
===================================================================
drivers/lguest/hypercalls.c +1 -1
@@ -243,6 +243,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" ); }
Quoted 4 lines · Rusty Russell
Quoted 1 line · Al Viro
use
copy_to_user()instead...Thanks Al, Jes sent me the same fix which I have queued for for 2.6.24:
OK, decision on urgency is up to you - post .23 is fine by me...