Re: input_to_handler: unable to handle kernel NULL pointer dereference

2012-09-13 Thread Henrik Rydberg
On Thu, Sep 13, 2012 at 08:57:38AM -0700, Dmitry Torokhov wrote:
> On Thu, Sep 13, 2012 at 05:05:44PM +0200, Jiri Slaby wrote:
> > Hi,
> > 
> > -next commit "Input: Send events one packet at a time" seems like broke
> > the input layer:
> 
> Right, Henrik has a patch for this.

Yep, it just missed the cut for today, but will appear in tomorrow's
-next.

Thanks,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: input_to_handler: unable to handle kernel NULL pointer dereference

2012-09-13 Thread Dmitry Torokhov
On Thu, Sep 13, 2012 at 05:05:44PM +0200, Jiri Slaby wrote:
> Hi,
> 
> -next commit "Input: Send events one packet at a time" seems like broke
> the input layer:

Right, Henrik has a patch for this.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


input_to_handler: unable to handle kernel NULL pointer dereference

2012-09-13 Thread Jiri Slaby
Hi,

-next commit "Input: Send events one packet at a time" seems like broke
the input layer:
BUG: unable to handle kernel NULL pointer dereference at  (null)
IP: [<  (null)>]   (null)
PGD 0
Oops: 0010 [#1] SMP
Modules linked in:
CPU 0
Pid: 0, comm: swapper/0 Not tainted 3.6.0-rc5-next-20120912_64+ #44
Bochs Bochs
RIP: 0010:[<>]  [<  (null)>]   (null)
RSP: 0018:880049603c70  EFLAGS: 00010086
RAX:  RBX: 0002 RCX: 0045
RDX: 0004 RSI: 0004 RDI: 880047bff918
RBP: 880049603cb8 R08: 00c5 R09: 88004740
R10: 001d R11: 00c5 R12: 81a36c00
R13: 8800465c6d50 R14: 8800465c6d50 R15: 8800465c6d48
FS:  () GS:88004960() knlGS:
CS:  0010 DS:  ES:  CR0: 8005003b
CR2:  CR3: 01a0b000 CR4: 06f0
DR0:  DR1:  DR2: 
DR3:  DR6: 0ff0 DR7: 0400
Process swapper/0 (pid: 0, threadinfo 81a0, task
81a13420)
Stack:
 81473df2 8109c4de 880047bff918 880049611200
 8800465c6d40 880047bff918 880046a2ae68 0002
 880046a2b328 880049603d08 81475ea9 810965c5
Call Trace:
 
 [] ? input_to_handler+0xc2/0xe0
 [] ? enqueue_task_fair+0xfe/0x180
 [] input_pass_values.part.14+0x159/0x160
 [] ? check_preempt_curr+0x75/0xa0
 [] input_handle_event+0x113/0x520
 [] input_event+0x52/0x70
 [] ? default_wake_function+0xd/0x10
 [] atkbd_interrupt+0x297/0x6b0
 [] ? __wake_up_common+0x55/0x90
 [] serio_interrupt+0x4d/0xa0
 [] i8042_interrupt+0x1ba/0x3a0
 [] ? rcu_process_callbacks+0x3c2/0x4e0
 [] ? run_rebalance_domains+0x47/0x160
 [] handle_irq_event_percpu+0x43/0x160
 [] ? sched_clock_tick+0x57/0xa0
 [] handle_irq_event+0x3c/0x60
 [] handle_edge_irq+0x6f/0x110
 [] handle_irq+0x1d/0x30




If I do this, everything works:
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -112,9 +112,12 @@ static unsigned int input_to_handler(struct
input_handle *handle,
if (!count)
return 0;

+   WARN_ONCE(!handler->events && !handler->event, "%s: %s",
+   handle->name, handler->name);
+
if (handler->events)
handler->events(handle, vals, count);
-   else
+   else if (handler->event)
for (v = vals; v != end; v++)
handler->event(handle, v->type, v->code, v->value);


PS sysrq is the driver causing this.

regards,
-- 
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


input_to_handler: unable to handle kernel NULL pointer dereference

2012-09-13 Thread Jiri Slaby
Hi,

-next commit Input: Send events one packet at a time seems like broke
the input layer:
BUG: unable to handle kernel NULL pointer dereference at  (null)
IP: [  (null)]   (null)
PGD 0
Oops: 0010 [#1] SMP
Modules linked in:
CPU 0
Pid: 0, comm: swapper/0 Not tainted 3.6.0-rc5-next-20120912_64+ #44
Bochs Bochs
RIP: 0010:[]  [  (null)]   (null)
RSP: 0018:880049603c70  EFLAGS: 00010086
RAX:  RBX: 0002 RCX: 0045
RDX: 0004 RSI: 0004 RDI: 880047bff918
RBP: 880049603cb8 R08: 00c5 R09: 88004740
R10: 001d R11: 00c5 R12: 81a36c00
R13: 8800465c6d50 R14: 8800465c6d50 R15: 8800465c6d48
FS:  () GS:88004960() knlGS:
CS:  0010 DS:  ES:  CR0: 8005003b
CR2:  CR3: 01a0b000 CR4: 06f0
DR0:  DR1:  DR2: 
DR3:  DR6: 0ff0 DR7: 0400
Process swapper/0 (pid: 0, threadinfo 81a0, task
81a13420)
Stack:
 81473df2 8109c4de 880047bff918 880049611200
 8800465c6d40 880047bff918 880046a2ae68 0002
 880046a2b328 880049603d08 81475ea9 810965c5
Call Trace:
 IRQ
 [81473df2] ? input_to_handler+0xc2/0xe0
 [8109c4de] ? enqueue_task_fair+0xfe/0x180
 [81475ea9] input_pass_values.part.14+0x159/0x160
 [810965c5] ? check_preempt_curr+0x75/0xa0
 [81476f03] input_handle_event+0x113/0x520
 [81477402] input_event+0x52/0x70
 [810989ed] ? default_wake_function+0xd/0x10
 [8147d657] atkbd_interrupt+0x297/0x6b0
 [81094bb5] ? __wake_up_common+0x55/0x90
 [81470e6d] serio_interrupt+0x4d/0xa0
 [814721ba] i8042_interrupt+0x1ba/0x3a0
 [810d4902] ? rcu_process_callbacks+0x3c2/0x4e0
 [8109df97] ? run_rebalance_domains+0x47/0x160
 [810ce243] handle_irq_event_percpu+0x43/0x160
 [8109a647] ? sched_clock_tick+0x57/0xa0
 [810ce39c] handle_irq_event+0x3c/0x60
 [810d0aaf] handle_edge_irq+0x6f/0x110
 [8103a52d] handle_irq+0x1d/0x30




If I do this, everything works:
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -112,9 +112,12 @@ static unsigned int input_to_handler(struct
input_handle *handle,
if (!count)
return 0;

+   WARN_ONCE(!handler-events  !handler-event, %s: %s,
+   handle-name, handler-name);
+
if (handler-events)
handler-events(handle, vals, count);
-   else
+   else if (handler-event)
for (v = vals; v != end; v++)
handler-event(handle, v-type, v-code, v-value);


PS sysrq is the driver causing this.

regards,
-- 
js
suse labs
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: input_to_handler: unable to handle kernel NULL pointer dereference

2012-09-13 Thread Dmitry Torokhov
On Thu, Sep 13, 2012 at 05:05:44PM +0200, Jiri Slaby wrote:
 Hi,
 
 -next commit Input: Send events one packet at a time seems like broke
 the input layer:

Right, Henrik has a patch for this.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: input_to_handler: unable to handle kernel NULL pointer dereference

2012-09-13 Thread Henrik Rydberg
On Thu, Sep 13, 2012 at 08:57:38AM -0700, Dmitry Torokhov wrote:
 On Thu, Sep 13, 2012 at 05:05:44PM +0200, Jiri Slaby wrote:
  Hi,
  
  -next commit Input: Send events one packet at a time seems like broke
  the input layer:
 
 Right, Henrik has a patch for this.

Yep, it just missed the cut for today, but will appear in tomorrow's
-next.

Thanks,
Henrik
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/