linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: evdev - fix variable initialisation
@ 2012-01-31 21:24 Heiko Stübner
  2012-01-31 21:40 ` Dima Zavin
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Stübner @ 2012-01-31 21:24 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Dima Zavin, linux-input, linux-kernel

Commit 509f87c5f564 (evdev - do not block waiting for an event if fd
is nonblock) created a code path were it was possible to use retval
uninitialized.

This could lead to the xorg evdev input driver getting corrupt data
and refusing to work with log messages like
	AUO-Pixcir touchscreen: Read error: Success
	sg060_keys: Read error: Success
	AUO-Pixcir touchscreen: Read error: Success
	sg060_keys: Read error: Success
(for drivers auo-pixcir-ts and gpio-keys).

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
This is obviously meant as a fix for 3.3

 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 76457d5..afc166f 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -386,7 +386,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
 	struct evdev_client *client = file->private_data;
 	struct evdev *evdev = client->evdev;
 	struct input_event event;
-	int retval;
+	int retval = 0;
 
 	if (count < input_event_size())
 		return -EINVAL;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: evdev - fix variable initialisation
  2012-01-31 21:24 [PATCH] Input: evdev - fix variable initialisation Heiko Stübner
@ 2012-01-31 21:40 ` Dima Zavin
  2012-02-03  8:37   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Dima Zavin @ 2012-01-31 21:40 UTC (permalink / raw)
  To: Heiko Stübner; +Cc: Dmitry Torokhov, linux-input, linux-kernel

ugh, thanks for fixing this.

On Tue, Jan 31, 2012 at 1:24 PM, Heiko Stübner <heiko@sntech.de> wrote:
> Commit 509f87c5f564 (evdev - do not block waiting for an event if fd
> is nonblock) created a code path were it was possible to use retval
> uninitialized.
>
> This could lead to the xorg evdev input driver getting corrupt data
> and refusing to work with log messages like
>        AUO-Pixcir touchscreen: Read error: Success
>        sg060_keys: Read error: Success
>        AUO-Pixcir touchscreen: Read error: Success
>        sg060_keys: Read error: Success
> (for drivers auo-pixcir-ts and gpio-keys).
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>

Acked-by: Dima Zavin <dima@android.com>

> ---
> This is obviously meant as a fix for 3.3
>
>  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 76457d5..afc166f 100644
> --- a/drivers/input/evdev.c
> +++ b/drivers/input/evdev.c
> @@ -386,7 +386,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
>        struct evdev_client *client = file->private_data;
>        struct evdev *evdev = client->evdev;
>        struct input_event event;
> -       int retval;
> +       int retval = 0;
>
>        if (count < input_event_size())
>                return -EINVAL;
> --
> 1.7.2.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: evdev - fix variable initialisation
  2012-01-31 21:40 ` Dima Zavin
@ 2012-02-03  8:37   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2012-02-03  8:37 UTC (permalink / raw)
  To: Dima Zavin; +Cc: Heiko Stübner, linux-input, linux-kernel

On Tue, Jan 31, 2012 at 01:40:42PM -0800, Dima Zavin wrote:
> ugh, thanks for fixing this.
> 
> On Tue, Jan 31, 2012 at 1:24 PM, Heiko Stübner <heiko@sntech.de> wrote:
> > Commit 509f87c5f564 (evdev - do not block waiting for an event if fd
> > is nonblock) created a code path were it was possible to use retval
> > uninitialized.
> >
> > This could lead to the xorg evdev input driver getting corrupt data
> > and refusing to work with log messages like
> >        AUO-Pixcir touchscreen: Read error: Success
> >        sg060_keys: Read error: Success
> >        AUO-Pixcir touchscreen: Read error: Success
> >        sg060_keys: Read error: Success
> > (for drivers auo-pixcir-ts and gpio-keys).
> >
> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> 
> Acked-by: Dima Zavin <dima@android.com>
> 

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-03  8:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-31 21:24 [PATCH] Input: evdev - fix variable initialisation Heiko Stübner
2012-01-31 21:40 ` Dima Zavin
2012-02-03  8:37   ` Dmitry Torokhov

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