lkml.org 
[lkml]   [1999]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[q] fundamental thing I am still missing about put_user().
Hi,

I have a question about writing to userspace buffers. Can I do this in
read_kmem() (read method of /dev/kmem):

if (verify_area(VERIFY_WRITE, buf, count))
return -EFAULT;
lock_kernel();
write to user buf without any worries, even taking spinlocks if needed.
unlock_kernel();

If I can do this then it is very useful because we could then hold a
spinlock in mm/vmalloc.c:vread() which means vmlist can be protected by a
simple spinlock which means vmalloc()/vfree()/ioremap() (i.e. really
vfree() and get_vm_area()) can be made SMP safe, i.e. without forcing
callers to have lock/unlock_kernel().

Thank you for your patient explanation :)
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran

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

\
 
 \ /
  Last update: 2005-03-22 13:55    [from the cache]
©2003-2011 Jasper Spaans