Re: [PATCH] usb: usbtest: avoid integer overflow in alloc_sglist()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Apr 6, 2012, at 10:55 PM, Alan Stern wrote:

> That number seems much too small.  People run usbtest for days at a 
> time.  Admittedly, they probably run a bunch of relatively short tests 
> over and over again, but we shouldn't rule out the possibility of 
> running a long test.

You are right.  How about a conservative fix?

- limit `sglen' to not overflow `sglen * sizeof(struct scatterlist)';

- limit `sglen' to not overflow `sglen * iterations'.

Greg was worried that a large `sglen' would still lead to allocating
a large chunk of memory.  I have got no idea what a good value would
be to achieve this while not breaking userspace.

- xi

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux