Re: [PATCH v3 1/3] pinctrl: renesas: rzg2l: Fix NULL pointer dereference in rzg2l_dt_subnode_to_map()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 17, 2023 at 2:44 PM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> On Tue, Aug 15, 2023 at 3:16 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > Fix the below random NULL pointer crash during boot by serializing
> > pinctrl group and function creation/remove calls in
> > rzg2l_dt_subnode_to_map() with mutex lock.
> >
> > Crash logs:
> >  pc : __pi_strcmp+0x20/0x140
> >  lr : pinmux_func_name_to_selector+0x68/0xa4
> >  Call trace:
> >  __pi_strcmp+0x20/0x140
> >  pinmux_generic_add_function+0x34/0xcc
> >  rzg2l_dt_subnode_to_map+0x314/0x44c
> >  rzg2l_dt_node_to_map+0x164/0x194
> >  pinctrl_dt_to_map+0x218/0x37c
> >  create_pinctrl+0x70/0x3d8
> >
> > While at it, add comments for bitmap_lock and lock.
> >
> > Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver")
> > Cc: stable@xxxxxxxxxx
> > Tested-by: Chris Paterson <Chris.Paterson2@xxxxxxxxxxx>
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> > ---
> > v2->v3:
> >  * Added comment for bitmap_lock and lock.
> >  * Moved map allocation down to reduce lock section.
> >  * Added locks for maps and pinctrl group and function creation/remove
> >    calls
> >  * Added unlock_and_done label for lock error path.
>
> Thanks for the update!
>
> Upon closer look, I noticed that I had missed that the map allocation
> is not global, but local to a specific DT node, so it does not
> need protection by a lock.  If no one objects, I will back out that
> change myself, queue this patch in renesas-pinctrl-for-v6.6, and send
> a PR tomorrow.

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Gr{oetje,eeting}s,


                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux