[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADiBU3-gr1OrH0_OtuWyAN8WwvZtPghC6zfB3NYuVTq4b+DZBw@mail.gmail.com>
Date: Fri, 2 Dec 2022 11:35:35 +0800
From: ChiYuan Huang <u0084500@...il.com>
To: Mark Brown <broonie@...nel.org>
Cc: lgirdwood@...il.com, lee@...nel.org, matthias.bgg@...il.com,
yangyingliang@...wei.com, chiaen_wu@...htek.com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
ChiYuan Huang <cy_huang@...htek.com>
Subject: Re: [PATCH 1/2] regulator: mt6370: Fix potential UAF issue
Mark Brown <broonie@...nel.org> 於 2022年12月1日 週四 晚上7:43寫道:
>
> On Wed, Nov 30, 2022 at 04:37:42PM +0800, cy_huang wrote:
>
> > The original code uses i2c dev as the parent in order to reuse
> > the 'regulator_of_get_init_data'. But this will cause regulation
> > constraint devres attached to i2c dev, not the mfd cell platform
> > device.
>
> This is a general issue which will affect a lot of MFDs, we would be
> better to fix this by changing the API to provide a device to be used
> for the devres allocations separately to the one used for looking up the
> DT.
Not to affect too much, the better way may change the 'regulator_register' API.
Append it as regulator_register(dev, .....
This could separate device object with devres allocation and DT lookup.
Powered by blists - more mailing lists