Alpha osf_sys.c problems

Bruce Elliott (belliott@accessone.com)
Sun, 28 Dec 1997 02:55:30 -0800 (PST)


The following is against 2.1.74, but I haven't seen any changes for this
file since then.

A bug in put_it32 causes getitimer() and setitimer() to fail with EFAULT.
This causes getty_ps to fail. The patch below appears to fix it.

--- linux/arch/alpha/kernel/osf_sys.c.orig Mon Dec 8 23:58:03 1997
+++ linux/arch/alpha/kernel/osf_sys.c Sat Dec 27 23:47:19 1997
@@ -966,7 +966,7 @@

static inline long put_it32(struct itimerval32 *o, struct itimerval *i)
{
- return (!access_ok(VERIFY_WRITE, i, sizeof(*i)) ||
+ return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
(__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) |
__put_user(i->it_interval.tv_usec, &o->it_interval.tv_usec) |
__put_user(i->it_value.tv_sec, &o->it_value.tv_sec) |

There appear to be problems in osf_usleep_thread:

[ line 1239 ]
/*
* I don't know what the parameters are: the first one
* seems to be a timeval pointer, and I suspect the second
* one is the time remaining.. Ho humm.. No documentation.
*/
asmlinkage int osf_usleep_thread(struct timeval *sleep, struct timeval *remain)
{
struct timeval tmp;
unsigned long ticks;

if (get_tv32(&tmp, sleep))
goto fault;

[...]

if (put_tv32(remain, &tmp))
goto fault;
}

return 0;
fault:
return -EFAULT;
}

The compiler warns about type mismatches for "sleep" in the get_tv32() call,
and for "remain" in the put_tv32() call.

I would _guess_ that these should both be declared as "timeval32".

B. D. Elliott bde@accessone.com (Seattle)