[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210121164013.cqfxvach4ugkohm7@gilmour>
Date: Thu, 21 Jan 2021 17:40:13 +0100
From: Maxime Ripard <maxime@...no.tech>
To: Liu Xiang <liu.xiang@...ngsmart.com>
Cc: linux-gpio@...r.kernel.org, linus.walleij@...aro.org,
wens@...e.org, jernej.skrabec@...l.net,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
liuxiang_1999@....com
Subject: Re: [PATCH] pinctrl: sunxi: fix use-after-free in sunxi_pmx_free()
Hi,
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@...ngsmart.com>
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
Maxime
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists