lkml.org 
[lkml]   [2001]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[CHECKER] amusing copy_from_user bug
Date
copy_from_user should probably have something like
(sizeof(agp_segment) * reserve.seg_count)
as it's size argumenbt rather than
GFP_KERNEL

/u2/engler/mc/oses/linux/2.4.3/drivers/char/agp/agpgart_fe.c:882:agpioc_reserve_
wrap: ERROR:SIZE-CHECK:882:882: segment = 'copy_from_user'(7 bytes), need 12

agp_segment *segment;

segment = kmalloc((sizeof(agp_segment) * reserve.seg_count),
GFP_KERNEL);

if (segment == NULL) {
return -ENOMEM;
}
if (copy_from_user(segment, (void *) reserve.seg_list,
GFP_KERNEL)) {
kfree(segment);
return -EFAULT;
}

As a side question: is it still true that verify_area's must be done before
any use of __put_user/__get_user/__copy_from_user/etc?
-
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 13:24    [W:1.577 / U:1.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site