[apparmor] Memory leaks in parser/parser_regex.c (at least)

Seth Arnold seth.arnold at canonical.com
Tue Sep 1 05:07:41 UTC 2015


On Mon, Aug 31, 2015 at 06:06:11PM -0700, Steve Beattie wrote:
> Possible. It turns out this portion of the parser code wasn't exercised
> enough, as many tests failed, but only on i386 where it segfaults
> when a new cache object is not needed/created but then an attempt is
> made to unref it -- we apparently got "lucky" on x86-64. The following
> patch should address it:
> 
> Signed-off-by: Steve Beattie <steve at nxnw.org>
> ---
>  parser/parser_main.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: b/parser/parser_main.c
> ===================================================================
> --- a/parser/parser_main.c
> +++ b/parser/parser_main.c
> @@ -860,7 +860,7 @@ static void setup_flags(void)
>  int main(int argc, char *argv[])
>  {
>  	aa_kernel_interface *kernel_interface = NULL;
> -	aa_policy_cache *policy_cache;
> +	aa_policy_cache *policy_cache = NULL;
>  	int retval, last_error;
>  	int i;
>  	int optind;
> 

Nice find.

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150831/b3d8d519/attachment.pgp>


More information about the AppArmor mailing list