evdev: Fix a buffer overflow on BIG_ENDIAN systems

2 messages, 2 authors, 2007-05-11 · open the first message on its own page

evdev: Fix a buffer overflow on BIG_ENDIAN systems

From: <hidden>
Date: 2007-05-11 00:54:04

 I found a little mistake. 
 On TOSHIBA Cell refference system(BIG_ENDIAN systems) a buffer overflow
was occured when I specified smaller buffers than maxlen.


Best regards,

Kenichi Nagai
Semiconductor Company
TOSHIBA Corporation
Kenichi3.nagai@toshiba.co.jp


Signed-off-by: Kenichi Nagai <redacted>
---
 
--- drivers/input/evdev.c.orig  2007-04-14 05:48:14.000000000 +0900
+++ drivers/input/evdev.c       2007-04-19 09:36:19.000000000 +0900
@@ -320,7 +320,7 @@ static int bits_to_user(unsigned long *b

        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++)

Re: evdev: Fix a buffer overflow on BIG_ENDIAN systems

From: Dmitry Torokhov <hidden>
Date: 2007-05-11 05:10:24

On Thursday 10 May 2007 20:54, kenichi3.nagai@toshiba.co.jp wrote:
 I found a little mistake. 
 On TOSHIBA Cell refference system(BIG_ENDIAN systems) a buffer overflow
was occured when I specified smaller buffers than maxlen.
Thank you.
 
-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help