From: Gwendal Grignou Date: Fri, 12 Dec 2014 00:02:45 +0000 (-0800) Subject: HID: i2c-hid: prevent buffer overflow in early IRQ X-Git-Tag: omap-for-v3.20/drop-legacy-3517~109^2~1^2 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1c7e29e8d276c669e8790bb8be9f505ddc48888;p=pandora-kernel.git HID: i2c-hid: prevent buffer overflow in early IRQ Before ->start() is called, bufsize size is set to HID_MIN_BUFFER_SIZE, 64 bytes. While processing the IRQ, we were asking to receive up to wMaxInputLength bytes, which can be bigger than 64 bytes. Later, when ->start is run, a proper bufsize will be calculated. Given wMaxInputLength is said to be unreliable in other part of the code, set to receive only what we can even if it results in truncated reports. Signed-off-by: Gwendal Grignou Reviewed-by: Benjamin Tissoires Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina --- Reading git-diff-tree failed