The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [CHECKER] amusing copy_from_user bug
@ 2001-04-10 10:11 Dawson Engler
  2001-04-10 10:41 ` Jakub Jelinek
  2001-04-10 12:20 ` Andi Kleen
  0 siblings, 2 replies; 5+ messages in thread
From: Dawson Engler @ 2001-04-10 10:11 UTC (permalink / raw)
  To: linux-kernel

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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-04-10 18:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-10 10:11 [CHECKER] amusing copy_from_user bug Dawson Engler
2001-04-10 10:41 ` Jakub Jelinek
2001-04-10 10:59   ` Petru Paler
2001-04-10 18:07     ` David S. Miller
2001-04-10 12:20 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox