sg negative size: 2.4.23-pre9
Subsystems (2)
PATCH 1/1 sg negative size: 2.4.23-pre9
Marcelo,
Thanks to work by Pat LaVarre <[email protected]> one of sg's ioctls [SG_SET_RESERVED_SIZE] was found to allow negative sizes. This causes the kernel pain. This patch fixes that (, a similar patch was recently put into lk 2.6.0-test8).
Doug Gilbert
drivers/scsi/sg.c2423pre9dpg renamed from drivers/scsi/sg.c +2 -0
@@ -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;