patch-2.4.5 linux/drivers/char/agp/agpgart_fe.c

Next file: linux/drivers/char/drm/ffb_drv.c
Previous file: linux/drivers/char/advantechwdt.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/drivers/char/agp/agpgart_fe.c linux/drivers/char/agp/agpgart_fe.c
@@ -852,6 +852,9 @@
 	if (copy_from_user(&reserve, (void *) arg, sizeof(agp_region))) {
 		return -EFAULT;
 	}
+	if ((unsigned) reserve.seg_count >= ~0U/sizeof(agp_segment))
+		return -EFAULT;
+
 	client = agp_find_client_by_pid(reserve.pid);
 
 	if (reserve.seg_count == 0) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)