[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YxIENg1AalM46bpi@kroah.com>
Date: Fri, 2 Sep 2022 15:25:10 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Abel Vesa <abel.vesa@...aro.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 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?
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.
thanks,
greg k-h
Powered by blists - more mailing lists