[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YOd/SfxC26esmVXU@qmqm.qmqm.pl>
Date: Fri, 9 Jul 2021 00:42:17 +0200
From: Michał Mirosław <mirq-linux@...e.qmqm.pl>
To: Dmitry Osipenko <digetx@...il.com>
Cc: Thierry Reding <treding@...dia.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Mark Brown <broonie@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Sebastian Reichel <sre@...nel.org>,
Peter Chen <peter.chen@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Felipe Balbi <balbi@...nel.org>,
David Heidelberg <david@...t.cz>, devicetree@...r.kernel.org,
linux-pm@...r.kernel.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH v1 05/12] usb: otg-fsm: Fix hrtimer list corruption
On Thu, Jul 01, 2021 at 05:23:58AM +0300, Dmitry Osipenko wrote:
> The HNP work can be re-scheduled while it's still in-fly. This results in
> re-initialization of the busy work, resetting the hrtimer's list node of
> the work and crashing kernel with null dereference within kernel/timer
> once work's timer is expired. It's very easy to trigger this problem by
> re-plugging USB cable quickly. Initialize HNP work only once to fix this
> trouble.
[...]
> - INIT_DELAYED_WORK(&fsm->hnp_polling_work, otg_hnp_polling_work);
> + if (!fsm->hnp_work_inited) {
> + INIT_DELAYED_WORK(&fsm->hnp_polling_work, otg_hnp_polling_work);
> + fsm->hnp_work_inited = true;
> + }
> +
Maybe you could just add an initialization function to be called by
users of otg_fsm? It seems that only chipidea driver uses this
struct currently.
Best Regards
Michał Mirosław
Powered by blists - more mailing lists