lkml.org 
[lkml]   [2004]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: cciss update for 2.6.7-rc1
On Wed, Jun 02, 2004 at 03:13:26PM -0500, mikem@beardog.cca.cpqcorp.net wrote:

a) use compat_alloc_user_space() and copy_in_user()

> + err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
> + err |= copy_from_user(&arg64.Request, &arg32->Request, sizeof(arg64.Request));
> + err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info));
> + err |= get_user(arg64.buf_size, &arg32->buf_size);

b) use compat_ptr() to convert pointers

> + err |= get_user(arg64.buf, &arg32->buf);


c) and do not bother with get_fs()/set_fs() at all - with
compat_alloc_user_space() variant you won't need it.

> + old_fs = get_fs();
> + set_fs(KERNEL_DS);
> + err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) &arg64);
> + set_fs(old_fs);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.169 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site