Re: [PATCH] Input: ps2-gpio - flush TX work when closing port

2019-02-08 Thread Sven Van Asbroeck
On Fri, Feb 8, 2019 at 10:51 AM Danilo Krummrich wrote: > > I agree with Dmitry > So do I, you guys are absolutely right. As far as I can see, this patch fixes the user-after-free. So, after Dmitry changes flush_work() to flush_delayed_work() : Reviewed-by: Sven Van Asbroeck

Re: [PATCH] Input: ps2-gpio - flush TX work when closing port

2019-02-08 Thread Danilo Krummrich
On 2019-02-08 08:31, Dmitry Torokhov wrote: On Thu, Feb 07, 2019 at 06:03:03PM -0500, Sven Van Asbroeck wrote: On Thu, Feb 7, 2019 at 5:27 PM Dmitry Torokhov wrote: > > + flush_work(>tx_work.work); Would cancel_work_sync() be better than flush_work() ? No, because we want to have

Re: [PATCH] Input: ps2-gpio - flush TX work when closing port

2019-02-07 Thread Dmitry Torokhov
On Thu, Feb 07, 2019 at 06:03:03PM -0500, Sven Van Asbroeck wrote: > On Thu, Feb 7, 2019 at 5:27 PM Dmitry Torokhov > wrote: > > > > + flush_work(>tx_work.work); > > Would cancel_work_sync() be better than flush_work() ? No, because we want to have interrupt and gpios in a consistent

Re: [PATCH] Input: ps2-gpio - flush TX work when closing port

2019-02-07 Thread Sven Van Asbroeck
On Thu, Feb 7, 2019 at 5:27 PM Dmitry Torokhov wrote: > > + flush_work(>tx_work.work); Would cancel_work_sync() be better than flush_work() ?

Re: [PATCH] Input: ps2-gpio - flush TX work when closing port

2019-02-07 Thread Dmitry Torokhov
On Thu, Feb 07, 2019 at 02:27:40PM -0800, Dmitry Torokhov wrote: > To ensure that TX work is not running after serio port has been torn down, > let's flush it when closing the port. > > Reported-by: Sven Van Asbroeck > Signed-off-by: Dmitry Torokhov > --- > drivers/input/serio/ps2-gpio.c | 1 +

[PATCH] Input: ps2-gpio - flush TX work when closing port

2019-02-07 Thread Dmitry Torokhov
To ensure that TX work is not running after serio port has been torn down, let's flush it when closing the port. Reported-by: Sven Van Asbroeck Signed-off-by: Dmitry Torokhov --- drivers/input/serio/ps2-gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/serio/ps2-gpio.c