Re: Validating Pointers

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Fri Jul 27 2001 - 04:47:16 EST


> 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?

user and kernel address spaces are seperate. On S/390 and M68K for example
they occupy the same values for both. Long long ago this was done via
segments on x86 (we dont use segments now) and thus the functions to do
what you want are still called set_fs/get_fs/get_ds
-
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:31 EST