allocating user-memory from kernel: do i use GFP_USER

From: Luke Kenneth Casson Leighton
Date: Mon Oct 04 2004 - 06:50:00 EST


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.
--
<a href="http://lkcl.net";> lkcl.net </a> <br />
<a href="mailto:lkcl@xxxxxxxx";> lkcl@xxxxxxxx </a> <br />

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