libminkadaptor: Fix memory object leak in TA autoload CBO - #82
Jiaxing Li (jiaxli-QC) wants to merge 1 commit into
Conversation
|
This is completely wrong. The underlying issue here is that when So, we have two options:
|
Harshal Dev (harshaldev27)
left a comment
There was a problem hiding this comment.
Please make the changes as requested.
0ab7349 to
186bcff
Compare
186bcff to
313ccf4
Compare
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
313ccf4 to
c567ae4
Compare
CRequestTABuffer_get() hands out a memObj for each requested TA image but retains a reference on it, so every TA autoload leaked one memObj that was never released. Track each handed-out memObj in a per-instance memObjList and add an IRequestTABuffer.cleanup() method that walks the list and drops those references. libminkadaptor invokes the new cleanup() from qcomtee_callback_obj_cleanup(), which QCOMTEE calls after the callback response has been marshalled and sent, so the references are released once the memObj is no longer needed. Wire-up: - Add the cleanup() method to IRequestTABuffer.idl. - Track memObj nodes with a QList, free them in CRequestTABuffer_cleanup(). - Override container_of() in CRequestTABuffer.h with a char*-based definition, since qlist.h's void*-arithmetic version is ill-formed in C++ and rejected under -Werror=pointer-arith. - Add the required include directories to both CMakeLists.txt files. Signed-off-by: Jiaxing Li <jiaxing.li@oss.qualcomm.com>
c567ae4 to
13ba5a3
Compare
Hi Harshal Dev (@harshaldev27) , Please review the changes. Thanks for your support. Fix this issue based on the option 2. and Updated the description for this PR. |
Yes, Thanks for your comments. Could you review the changes? Thank you very much. |
libtaautoload: Fix memory object leak in TA autoload CBO
CRequestTABuffer_get() hands out a memObj for each requested TA image but retains a reference on it, so every TA autoload leaked one memObj that was never released. Track each handed-out memObj in a per-instance memObjList and add an IRequestTABuffer.cleanup() method that walks the list and drops those references.
libminkadaptor invokes the new cleanup() from qcomtee_callback_obj_cleanup(), which QCOMTEE calls after the callback response has been marshalled and sent, so the references are released once the memObj is no longer needed.
Wire-up:
CRs-Fixed: 4622877
Fix-issue: #9