Re: [PATCH] add likely around access_ok for uaccess

From: Manfred Spraul
Date: Sun Sep 14 2003 - 14:49:50 EST


Manfred Spraul wrote:

Andrew Morton wrote:

+#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0))


I don't know. What happens if access_ok is used outside of an if statement?
One example is

int get_compat_timespec(struct timespec *ts, struct compat_timespec *cts)
{
return (verify_area(VERIFY_READ, cts, sizeof(*cts)) ||
__get_user(ts->tv_sec, &cts->tv_sec) ||
__get_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
}

Duh. Reading is difficult.
The functions with access_ok are get_compat_itimerval and put_compat_itimerval.

--
Manfred

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/