Questions about copying data into/from Linux Kernel

view full story

http://stackoverflow.com – I am finishing up project for OS class and can't figure several things that have to do with SAFELY copying data from user-space into kernel and back from kernel into user space, and how to properly discard this information. Say I have several system calls: //copies data into kernel space long sys_into(void __user *data, long length); // copies data into user space long sys_from(void __user *data, long length); In both cases long length is the number of bytes to be copied. Things I was able to figure out so far: 1. Validate that pointers *data are not null. 2. Validate that length &l (HowTos)