public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Paul Jackson <pj@sgi.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	akpm@osdl.org, aebr@win.tue.nl, torvalds@osdl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix NR_KEYS off-by-one error
Date: Fri, 30 Jul 2004 10:07:57 +0200	[thread overview]
Message-ID: <20040730080757.GA1068@ucw.cz> (raw)
In-Reply-To: <20040730002706.2330974d.pj@sgi.com>

Hi!

Let me summarize.

In the past, the kernel had various different values of NR_KEYS, in this
order: 128, 512, 256, 255.

128 was not enough, 512 didn't fit in a byte (while allowed to address
all keycodes the input layer uses), 256 broke some apps that relied on
unsigned char counters, and thus we ended up with the maximum value that
kept all software happy.

Now somewhere in the process (I assume in the 512 stage, but could be
the 256 stage as well), the kernel produced warnings about impossible
comparisons.

Thus the comparison(s) were dropped, by Andrew.

Then we finalized on 255, and the comparison is needed again to prevent
overflowing the keymap arrays.

BUT some binaries are still compiled with 256 and try to set up a
mapping for keycode 255 (although there is _no_ such keycode), and
break. IMO it's a bug in the app.

Now I believe that simply adding the check back by reverting the old
Andrew's patch and recompiling/fixing what breaks is the right way to
go.

Any comments?

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

  reply	other threads:[~2004-07-30  8:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-16 16:35 [PATCH] Fix NR_KEYS off-by-one error OGAWA Hirofumi
2004-07-16 16:44 ` Vojtech Pavlik
2004-07-16 17:18   ` OGAWA Hirofumi
2004-07-16 20:15   ` Andries Brouwer
2004-07-17  6:23     ` OGAWA Hirofumi
2004-07-26 22:43       ` Andrew Morton
2004-07-27 13:46         ` Vojtech Pavlik
2004-07-27 16:37           ` OGAWA Hirofumi
2004-07-27 17:54             ` Vojtech Pavlik
2004-07-27 18:35               ` OGAWA Hirofumi
2004-07-28 11:51       ` Andries Brouwer
2004-07-28 16:46         ` OGAWA Hirofumi
2004-07-28 20:42           ` Paul Jackson
2004-07-29  4:10             ` OGAWA Hirofumi
2004-07-29  6:15               ` Paul Jackson
2004-07-29  9:24                 ` OGAWA Hirofumi
2004-07-29  9:49                   ` Paul Jackson
2004-07-29 23:24                     ` Andrew Morton
2004-07-29 23:51                       ` Paul Jackson
2004-07-30  1:25                         ` OGAWA Hirofumi
2004-07-30  7:27                           ` Paul Jackson
2004-07-30  8:07                             ` Vojtech Pavlik [this message]
2004-07-30  8:41                               ` Andries Brouwer
2004-07-30  8:51                                 ` Vojtech Pavlik
2004-07-30  9:03                                 ` Vojtech Pavlik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040730080757.GA1068@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=aebr@win.tue.nl \
    --cc=akpm@osdl.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox