Re: [PATCH v2] tee: fix missing shm reference cleanup in tee_ioctl_supp_recv

Jens Wiklander <[email protected]> Thu, 7 May 2026 09:31:08 +0200
Newsgroups org.trustedfirmware.lists.op-tee
Message-ID <CAHUa44HGzi5nS2=vq7EWnbXy=a-347tqQh=GPSk95wR0=UaWKA@mail.gmail.com>
Hi Qihang,

On Wed, May 6, 2026 at 4:18 AM Qihang <[email protected]> wrote:
>
> Hi Jens, Sumit,
>
> While reworking this, I noticed that there may be two slightly
> different cleanup issues involved here.
>
> One appears to be in tee_ioctl_supp_recv() itself. Another may be in a
> qcomtee-specific error path where MEMREF references can already have
> been acquired before the backend rejects the parameters.
>
> I am not entirely sure where you would prefer the boundary between the
> core fix and any backend-specific fix to be.
>
> Would you prefer that I keep the current patch strictly focused on the
> tee_ioctl_supp_recv() cleanup path first, and handle any qcomtee-side
> issue separately if needed?

qcomtee-specific changes should preferably go into a separate patch.
In this case, I suspect the fix is to add a similar tee_shm_put() as
we have in supp_check_recv_params() in drivers/tee/optee/supp.c.

Cheers,
Jens