Re: [PATCH] pinctrl: sunxi: fix use-after-free in sunxi_pmx_free()

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

 



------------------------------------------------------------------

> On Thu, Jan 21, 2021 at 5:40 PM Maxime Ripard <maxime@xxxxxxxxxx> wrote:
> On Tue, Jan 19, 2021 at 02:29:08PM +0800, Liu Xiang wrote:
> > When CONFIG_REGULATOR is not set, sunxi_pmx_request() always return
> > success. Even a group of pins call sunxi_pmx_request(), the refcount
> > is only 1. This can cause a use-after-free warning in sunxi_pmx_free().
> > To solve this problem, go to err path if regulator_get() return NULL
> > or error.
> >
> > Signed-off-by: Liu Xiang <liu.xiang@xxxxxxxxxxxxxx>
>
> Is there any drawback to depending on CONFIG_REGULATOR?
>
> Given that we need those regulators enabled anyway, I guess we could
> just select or depends on it
>
> I agree.
>
> Liu can you make a patch to Kconfig to just select REGULATOR?
> Possibly even the specific regulator driver this SoC is using
> if it is very specific for this purpose.
>
> Yours,
> Linus Walleij

Sure. I will send a new patch.

Yours,
Liu Xiang





[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