[apparmor] Memory leaks in parser/parser_regex.c (at least)
Steve Beattie
steve at nxnw.org
Thu Aug 27 05:46:15 UTC 2015
On Mon, Aug 24, 2015 at 08:43:46AM -0700, Steve Beattie wrote:
> > SUMMARY: AddressSanitizer: alloc-dealloc-mismatch ??:0 operator delete(void*)
> > ==16428==HINT: if you don't care about these warnings you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
> > ==16428==ABORTING
> > Makefile:33: recipe for target 'error_output' failed
> > make[3]: *** [error_output] Error 1
> > make[3]: Leaving directory '/tmp/buildd/apparmor-2.10/parser/tst'
> > Makefile:298: recipe for target 'tests' failed
>
> Looks like a legitimate type mismatch error when the objects are
> deleted.
Try the following patch:
---
parser/libapparmor_re/expr-tree.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: b/parser/libapparmor_re/expr-tree.h
===================================================================
--- a/parser/libapparmor_re/expr-tree.h
+++ b/parser/libapparmor_re/expr-tree.h
@@ -672,7 +672,7 @@ public:
~hashedNodeVec()
{
- delete nodes;
+ delete[] nodes;
}
unsigned long size()const { return len; }
With that applied, local testing with AddressSanitzer shows the
caching tests failing due to leaking cached and feature objects
from libapparmor. I'll dig into it tomorrow.
(Looks like the packaging might be missing the caching related manpage.)
--
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150826/7616fc8f/attachment-0001.pgp>
More information about the AppArmor
mailing list