allocating user-memory from kernel: do i use GFP_USER

Luke Kenneth Casson Leighton
2004-10-04T11:48:23Z

hi, it occurred to me that instead of cut/paste all the sys_* functions
in fs/*.c for this proxyfs kernel module i am doing that i could
instead, if i could get hold of some user memory, call the sys_*
functions directly.

can i just do this:

char __user *filename = kmalloc(strlen(kfilename)+1, GFP_USER);

and then this:

sys_rename(filename, ...);

and expect it to work?

ta,

l.

--
--
Truth, honesty and respect are rare commodities that all spring from
the same well: Love. If you love yourself and everyone and everything
around you, funnily and coincidentally enough, life gets a lot better.
--
lkcl.net
lkcl@lkcl.net