Re: access_ok inside kernelspace

Vasili Goutas (vgo@ratio.de)
Mon, 18 Oct 1999 15:34:04 +0200


On Mon, 18 Oct 1999, Alan Cox wrote:
>> I patched the 2.2.12 kernel to be able to write to the file system within my
>> driver.
>> I do this by patching the copy_to/from_user functions like this
>
>You don't need to do this
>
>> If someone has written such a function, or knows which already implemented
>> function of Linux does that, please inform me.
>
>
> mm_segment_t fs;
>
> fs=get_fs();
> set_fs(get_ds());
>
> /* User space is now the kernel */
>
>
> /* Put it back again */
>
> set_fs(fs);
>
Thank you Alan.
The last week I spend for the above problem, now they are just a few function
calls which are needed and which works better then a lot of changes I made.

You must be very close to the kernel source, because the most answers I read
in the linux-kernel list are yours.
Are you still working as programmer, or do you earn your money by making Linux
more perfect?

Vasili

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

--
Vasilios Goutas
Software-Development
RATIO Entwicklungen GmbH
Phone:+49-(0)40-369007-0   Admiralitätstr. 59
Fax:+49-(0)40-369007-25    20459 Hamburg
Email: mailto:vgo@ratio.de

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