mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 08:23:17 +00:00
When less than 3 bytes are written to the device, memcpy is called with negative array size which leads to buffer overflow and kernel panic. This patch adds a condition and returns -EOPNOTSUPP instead. Fixes bugzilla issue 64871 [[email protected]: fix a merge conflict and changed the condition to match the patch's comment, e. g. len == 3 could also be valid] Signed-off-by: Jozef Balga <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>