From: Greg KH <gregkh@linuxfoundation.org>
To: Xingjing Deng <micro6947@gmail.com>
Cc: stable@vger.kernel.org, srini@kernel.org,
amahesh@gti.qualcomm.com, linux-arm-msm@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [BUG] misc: fastrpc: possible double-free of cctx->remote_heap
Date: Mon, 12 Jan 2026 09:20:07 +0100 [thread overview]
Message-ID: <2026011208-anger-jurist-a101@gregkh> (raw)
In-Reply-To: <CAK+ZN9rJypDknnR0b5UVme6x9ABx_hCVtveTyJQT-x0ROpU1vw@mail.gmail.com>
On Mon, Jan 12, 2026 at 04:15:01PM +0800, Xingjing Deng wrote:
> While reviewing drivers/misc/fastrpc.c, I noticed a potential lifetime
> issue around struct fastrpc_buf *remote_heap;
> In fastrpc_init_create_static_process(), the error path err_map: frees
> fl->cctx->remote_heap but does not clear the pointer(set to NULL).
> Later, in fastrpc_rpmsg_remove(), the code frees cctx->remote_heap
> again if it is non-NULL.
>
> Call paths (as I understand them)
>
> 1) First free (ioctl error path):
>
> fastrpc_fops.unlocked_ioctl → fastrpc_device_ioctl()
> FASTRPC_IOCTL_INIT_CREATE_STATIC → fastrpc_init_create_static_process()
> err_map: → fastrpc_buf_free(fl->cctx->remote_heap) (pointer not cleared)
>
> 2) Second free (rpmsg remove path):
>
> rpmsg driver .remove → fastrpc_rpmsg_remove()
> if (cctx->remote_heap) fastrpc_buf_free(cctx->remote_heap);
>
Hi,
Please note, stable@vger is not the email address to be asking about
this, it is only for stable kernel release stuff.
Andn do you have a potential patch to resolve this issue? That's the
simplest way to get it fixed up and to show what you are discussing.
thanks,
greg k-h
next prev parent reply other threads:[~2026-01-12 8:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 8:15 [BUG] misc: fastrpc: possible double-free of cctx->remote_heap Xingjing Deng
2026-01-12 8:20 ` Greg KH [this message]
2026-01-12 10:39 ` Xingjing Deng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026011208-anger-jurist-a101@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=amahesh@gti.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=micro6947@gmail.com \
--cc=srini@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox