* [PATCH] Input: evdev - get rid of old workaround for EVIOCGBIT
@ 2014-04-24 5:27 Dmitry Torokhov
2014-04-24 5:37 ` Peter Hutterer
2014-04-29 8:06 ` David Herrmann
0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2014-04-24 5:27 UTC (permalink / raw)
To: linux-input; +Cc: David Herrmann, Peter Hutterer, linux-kernel
We put this workaround in 2008 and the offending userspace has been fixed
up long time ago; the link in the message is no longer valid either, so it
is time to retire it.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/evdev.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index ce953d8..fd325ec 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -629,12 +629,10 @@ static int str_to_user(const char *str, unsigned int maxlen, void __user *p)
return copy_to_user(p, str, len) ? -EFAULT : len;
}
-#define OLD_KEY_MAX 0x1ff
static int handle_eviocgbit(struct input_dev *dev,
unsigned int type, unsigned int size,
void __user *p, int compat_mode)
{
- static unsigned long keymax_warn_time;
unsigned long *bits;
int len;
@@ -652,24 +650,8 @@ static int handle_eviocgbit(struct input_dev *dev,
default: return -EINVAL;
}
- /*
- * Work around bugs in userspace programs that like to do
- * EVIOCGBIT(EV_KEY, KEY_MAX) and not realize that 'len'
- * should be in bytes, not in bits.
- */
- if (type == EV_KEY && size == OLD_KEY_MAX) {
- len = OLD_KEY_MAX;
- if (printk_timed_ratelimit(&keymax_warn_time, 10 * 1000))
- pr_warning("(EVIOCGBIT): Suspicious buffer size %u, "
- "limiting output to %zu bytes. See "
- "http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n",
- OLD_KEY_MAX,
- BITS_TO_LONGS(OLD_KEY_MAX) * sizeof(long));
- }
-
return bits_to_user(bits, len, size, p, compat_mode);
}
-#undef OLD_KEY_MAX
static int evdev_handle_get_keycode(struct input_dev *dev, void __user *p)
{
--
1.9.0
--
Dmitry
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: evdev - get rid of old workaround for EVIOCGBIT
2014-04-24 5:27 [PATCH] Input: evdev - get rid of old workaround for EVIOCGBIT Dmitry Torokhov
@ 2014-04-24 5:37 ` Peter Hutterer
2014-04-29 8:06 ` David Herrmann
1 sibling, 0 replies; 3+ messages in thread
From: Peter Hutterer @ 2014-04-24 5:37 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, David Herrmann, linux-kernel
On Wed, Apr 23, 2014 at 10:27:20PM -0700, Dmitry Torokhov wrote:
> We put this workaround in 2008 and the offending userspace has been fixed
> up long time ago; the link in the message is no longer valid either, so it
> is time to retire it.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
works for me, Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Cheers,
Peter
> ---
> drivers/input/evdev.c | 18 ------------------
> 1 file changed, 18 deletions(-)
>
> diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
> index ce953d8..fd325ec 100644
> --- a/drivers/input/evdev.c
> +++ b/drivers/input/evdev.c
> @@ -629,12 +629,10 @@ static int str_to_user(const char *str, unsigned int maxlen, void __user *p)
> return copy_to_user(p, str, len) ? -EFAULT : len;
> }
>
> -#define OLD_KEY_MAX 0x1ff
> static int handle_eviocgbit(struct input_dev *dev,
> unsigned int type, unsigned int size,
> void __user *p, int compat_mode)
> {
> - static unsigned long keymax_warn_time;
> unsigned long *bits;
> int len;
>
> @@ -652,24 +650,8 @@ static int handle_eviocgbit(struct input_dev *dev,
> default: return -EINVAL;
> }
>
> - /*
> - * Work around bugs in userspace programs that like to do
> - * EVIOCGBIT(EV_KEY, KEY_MAX) and not realize that 'len'
> - * should be in bytes, not in bits.
> - */
> - if (type == EV_KEY && size == OLD_KEY_MAX) {
> - len = OLD_KEY_MAX;
> - if (printk_timed_ratelimit(&keymax_warn_time, 10 * 1000))
> - pr_warning("(EVIOCGBIT): Suspicious buffer size %u, "
> - "limiting output to %zu bytes. See "
> - "http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n",
> - OLD_KEY_MAX,
> - BITS_TO_LONGS(OLD_KEY_MAX) * sizeof(long));
> - }
> -
> return bits_to_user(bits, len, size, p, compat_mode);
> }
> -#undef OLD_KEY_MAX
>
> static int evdev_handle_get_keycode(struct input_dev *dev, void __user *p)
> {
> --
> 1.9.0
>
>
> --
> Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Input: evdev - get rid of old workaround for EVIOCGBIT
2014-04-24 5:27 [PATCH] Input: evdev - get rid of old workaround for EVIOCGBIT Dmitry Torokhov
2014-04-24 5:37 ` Peter Hutterer
@ 2014-04-29 8:06 ` David Herrmann
1 sibling, 0 replies; 3+ messages in thread
From: David Herrmann @ 2014-04-29 8:06 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: open list:HID CORE LAYER, Peter Hutterer, linux-kernel
Hi
On Thu, Apr 24, 2014 at 7:27 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> We put this workaround in 2008 and the offending userspace has been fixed
> up long time ago; the link in the message is no longer valid either, so it
> is time to retire it.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Yes, pleeeease!
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Thanks
David
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-29 8:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-24 5:27 [PATCH] Input: evdev - get rid of old workaround for EVIOCGBIT Dmitry Torokhov
2014-04-24 5:37 ` Peter Hutterer
2014-04-29 8:06 ` David Herrmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).