--- linux/drivers/scsi/sg.c 2003-06-14 13:49:51.000000000 +1000 +++ linux/drivers/scsi/sg.c2423pre9dpg 2003-11-08 19:11:00.000000000 +1000 @@ -871,6 +871,8 @@ case SG_SET_RESERVED_SIZE: result = get_user(val, (int *)arg); if (result) return result; + if (val < 0) + return -EINVAL; if (val != sfp->reserve.bufflen) { if (sg_res_in_use(sfp) || sfp->mmap_called) return -EBUSY;