iASL/Disassembler: nullify AcpiGbl_ParseOpRoot after deleting parse tree
Colin King
PATCH 1/1 iASL/Disassembler: nullify AcpiGbl_ParseOpRoot after deleting parse tree
From: Colin Ian King <colin.king(a)canonical.com>
On i386 platforms with glibc 2.21 and gcc 6.0 I'm getting double frees on the heap when disassembling with iASL using multiple external tables. The current code deletes the parse tree from the AcpiGbl_ParseOpRoot and not NULLifying it afterwards, causing subsequent tree parsing to re-add existing heap objects back onto this root node causing subsequent parse tree deletes to trip the double free.
Interestingly, this seems to only happen in some configurations so I believe it works on 64 bit x86 and not 32 bit because of heap differences in the libc allocator.
Signed-off-by Colin Ian King <colin.king(a)canonical.com>
--- source/common/adisasm.c | 1 + 1 file changed, 1 insertion(+)
source/common/adisasm.c +1 -0
@@ -700,6 +700,7 @@ AdDoExternalFileList (AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId);AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); + AcpiGbl_ParseOpRoot =NULL ; ExternalListHead = ExternalListHead->Next; }
Signature · 1 line
2.7.0