I am trying to define a system call that modifies the character buffer passed to it. In particular, something like this:
...
asmlinkage int sys_mycall( char __user *buff, int len )
{
char tmp[1000];
copy_from_user(tmp, buff, len);
copy_to_user( buff, &tmp, len );
}
Here copy_to_user returns -1, and the buffer from the calling program does not change. What's happening?
source
share