Re: [PATCH 1/1] misc: fastrpc: Fix double free of 'buf' in error path
From: Greg KH
Date: Tue Sep 03 2024 - 06:42:38 EST
On Mon, Sep 02, 2024 at 03:14:09PM +0100, srinivas.kandagatla@xxxxxxxxxx wrote:
> From: Sukrut Bellary <sukrut.bellary@xxxxxxxxx>
>
> smatch warning:
> drivers/misc/fastrpc.c:1926 fastrpc_req_mmap() error: double free of 'buf'
>
> In fastrpc_req_mmap() error path, the fastrpc buffer is freed in
> fastrpc_req_munmap_impl() if unmap is successful.
>
> But in the end, there is an unconditional call to fastrpc_buf_free().
> So the above case triggers the double free of fastrpc buf.
>
> Fixes: 72fa6f7820c4 ("misc: fastrpc: Rework fastrpc_req_munmap")
> Reviewed-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
> Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
> Signed-off-by: Sukrut Bellary <sukrut.bellary@xxxxxxxxx>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
> ---
> drivers/misc/fastrpc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Any reason you forgot a cc: stable@ on this?
I'll go add it by hand...