Commit 4827bd6
hid: fix I2C read buffer overflow in raw_event() for mcp2221
commit b56cc41 upstream.
As reported by syzbot, mcp2221_raw_event lacked
validation of incoming I2C read data sizes, risking buffer
overflows in mcp->rxbuf during multi-part transfers.
As highlighted in the DS20005565B spec, p44, we have:
"The number of read-back data bytes to follow in this packet:
from 0 to a maximum of 60 bytes of read-back bytes."
This patch enforces we don't exceed this limit.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=52c1a7d3e5b361ccd346
Tested-by: [email protected]
Signed-off-by: Arnaud Lecomte <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Romain Sioen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 647d6b8 commit 4827bd6
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
817 | 821 | | |
818 | 822 | | |
819 | 823 | | |
| |||
0 commit comments