Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bf61f8d357e5d71d74a3ca3be3cce52bf1a2c01a Commit: bf61f8d357e5d71d74a3ca3be3cce52bf1a2c01a Parent: 435b71be20f2ad3688acd94c05e968e029464d60 Author: Kenichi Nagai <[EMAIL PROTECTED]> AuthorDate: Fri May 11 01:12:15 2007 -0400 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Fri May 11 09:08:04 2007 -0700
Input: evdev - fix overflow in compat_ioctl When exporting input device bitmaps via compat_ioctl on BIG_ENDIAN platforms evdev calculates data size incorrectly. This causes buffer overflow if user specifies buffer smaller than maxlen. Signed-off-by: Kenichi Nagai <[EMAIL PROTECTED]> Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- drivers/input/evdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 55a7259..b234729 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -336,7 +336,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, if (compat) { len = NBITS_COMPAT(maxbit) * sizeof(compat_long_t); - if (len < maxlen) + if (len > maxlen) len = maxlen; for (i = 0; i < len / sizeof(compat_long_t); i++) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html