[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YxIST6Nb2iYIr+XO@linaro.org>
Date: Fri, 2 Sep 2022 17:25:19 +0300
From: Abel Vesa <abel.vesa@...aro.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorande@....qualcomm.com>,
Konrad Dybcio <konrad.dybcio@...ainline.org>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Amol Maheshwari <amahesh@....qualcomm.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Ekansh Gupta <ekangupt@....qualcomm.com>,
Arnd Bergmann <arnd@...db.de>, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ola Jeppsson <ola@...p.com>
Subject: Re: [PATCH 01/14] misc: fastrpc: Fix use-after-free and race in
fastrpc_map_find
On 22-09-02 15:25:10, Greg Kroah-Hartman wrote:
> On Fri, Sep 02, 2022 at 04:13:31PM +0300, Abel Vesa wrote:
> > Currently, there is a race window between the point when the mutex is
> > unlocked in fastrpc_map_lookup and the reference count increasing
> > (fastrpc_map_get) in fastrpc_map_find, which can also lead to
> > use-after-free.
> >
> > So lets merge fastrpc_map_find into fastrpc_map_lookup which allows us
> > to both protect the maps list by also taking the &fl->lock spinlock and
> > the reference count, since the spinlock will be released only after.
> > Add take_ref argument to make this suitable for all callers.
> >
> > Co-developed-by: Ola Jeppsson <ola@...p.com>
> > Signed-off-by: Ola Jeppsson <ola@...p.com>
> > Signed-off-by: Abel Vesa <abel.vesa@...aro.org>
> > ---
> > drivers/misc/fastrpc.c | 41 +++++++++++++++++++++--------------------
> > 1 file changed, 21 insertions(+), 20 deletions(-)
>
> What commit does this fix? Should it go to stable trees?
Will specify in the next version.
>
> Try splitting this series up into 2, one for 6.0-final with bugfixes to
> resolve issues found, and the next one on top of that for new features.
Fair point. Will do in the next version.
>
> thanks,
>
> greg k-h
Powered by blists - more mailing lists