Re: Validating Pointers

From: tpepper@vato.org
Date: Thu Jul 26 2001 - 22:19:09 EST


On Thu 26 Jul at 18:12:57 +0100 alan@lxorguk.ukuu.org.uk done said:
>
> You can't pass kernel address as if they were userspace. It might happen to
> sometimes work on some architectures. Take a look at the set_fs() stuff

Am I? I though I was doing a pretty plain user<->kernel copy:

        copy_to_user(user_addr, kernel_addr, size);
                and
        copy_from_user(kernel_addr, user_addr, size);

Are you saying that static and dynamically allocated kernel variables end up
in different segments (kernel_ds and user_ds) and the copy is only expected to
succeed if the to and from addresses are in the same segment?

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



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:30 EST