Re: [PATCH] pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map

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

 



On Thu, Nov 10, 2022 at 1:05 PM Zeng Heng <zengheng4@xxxxxxxxxx> wrote:
> On 2022/11/10 19:27, Linus Walleij wrote:
> > On Thu, Nov 10, 2022 at 9:22 AM Zeng Heng <zengheng4@xxxxxxxxxx> wrote:
> >
> >> Here is the BUG report by KASAN about null pointer dereference:
> >>
> >> BUG: KASAN: null-ptr-deref in strcmp+0x2e/0x50
> >> Read of size 1 at addr 0000000000000000 by task python3/2640
> >> Call Trace:
> >>   strcmp
> >>   __of_find_property
> >>   of_find_property
> >>   pinctrl_dt_to_map
> >>
> >> kasprintf() would return NULL pointer when kmalloc() fail to allocate.
> >> So directly return ENOMEM, if kasprintf() return NULL pointer.
> >>
> >> Fixes: 57291ce295c0 ("pinctrl: core device tree mapping table parsing support")
> >> Signed-off-by: Zeng Heng <zengheng4@xxxxxxxxxx>
> > Patch applied for fixes.
> >
> > Interesting that you managed to locate this using *kasan* of all
> > things, it kind of requires that you manage to run out of memory
> > exactly at this time...
> >
> > Yours,
> > Linus Walleij
>
> yes, actually it runs with *kasan* & companied with fault-inject into
> every single time.

Aha! That's a neat trick. Thanks for doing this!

Yours,
Linus Walleij



[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