Re: [PATCH] s390: speedup strn{cpy,len}_from_user.

From: Andrew Morton
Date: Fri Jun 11 2004 - 17:18:46 EST


Martin Schwidefsky <schwidefsky@xxxxxxxxxx> wrote:
>
> [PATCH] s390: speedup strn{cpy,len}_from_user.
>
> From: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
>
> Speedup strncpy_from_user and strnlen_from_user by using
> the search string instruction in the secondary space mode.

There were a few conflicts with Arnd's sparse annotation, which I fixed up.
Please check that next the -mm has it all right.

> static inline long
> strncpy_from_user(char *dst, const char *src, long count)
> {
> long res = -EFAULT;
> might_sleep();
> - if (access_ok(VERIFY_READ, src, 1))
> - res = __strncpy_from_user_asm(dst, src, count);
> + if (access_ok(VERIFY_READ, src, 1)) {
> + res = __strncpy_from_user_asm(count, dst, src);
> + }
> return res;
> }

Shouldn't the access_ok() check be passed `count', rather than `1'?
-
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/