Bug 1252346 - Use after free in nfct_helper_free
Summary: Use after free in nfct_helper_free
Keywords:
Status: CLOSED DUPLICATE of bug 1252344
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: libnetfilter_cthelper
Version: 6.0 (Juno)
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 8.0 (Liberty)
Assignee: RHOS Maint
QA Contact: Shai Revivo
URL:
Whiteboard:
Depends On: 1252344
Blocks: 1235638
TreeView+ depends on / blocked
 
Reported: 2015-08-11 08:39 UTC by Ján Rusnačko
Modified: 2016-09-16 18:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1252344
Environment:
Last Closed: 2016-09-16 18:37:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ján Rusnačko 2015-08-11 08:39:47 UTC
+++ This bug was initially created as a clone of Bug #1252344 +++

Use after free flaw was found in the following code:

void nfct_helper_free(struct nfct_helper *h)
{
        int i;

        free(h);
        for (i=0; i<NF_CT_HELPER_CLASS_MAX; i++) {
                if (h->expect_policy[i])
                        free(h->expect_policy[i]);
        }
}

This was reported on oss-security as potential vulnerability and fixed by upstream in master in commit 0c52422eb236b16bc663a7f22df3e30fb9c8bf71.

It is also reported by Coverity:

Error: USE_AFTER_FREE (CWE-825): [#def1]
libnetfilter_cthelper-1.0.0/src/libnetfilter_cthelper.c:116: freed_arg: "free" frees "h".
libnetfilter_cthelper-1.0.0/src/libnetfilter_cthelper.c:118: deref_after_free: Dereferencing freed pointer "h".
#  116|   	free(h);
#  117|   	for (i=0; i<NF_CT_HELPER_CLASS_MAX; i++) {
#  118|-> 		if (h->expect_policy[i])
#  119|   			free(h->expect_policy[i]);
#  120|   	}

Additional info:
https://bugzilla.netfilter.org/show_bug.cgi?id=990
http://seclists.org/oss-sec/2015/q2/228

Comment 4 Lon Hohberger 2016-09-16 18:37:35 UTC

*** This bug has been marked as a duplicate of bug 1252344 ***


Note You need to log in before you can comment on or make changes to this bug.