Bug 1252344 - Use after free in nfct_helper_free [NEEDINFO]
Use after free in nfct_helper_free
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libnetfilter_cthelper (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Paul Wouters
Li Shuang
: 1252346 (view as bug list)
Depends On:
Blocks: 1235638 1252346
  Show dependency treegraph
Reported: 2015-08-11 04:37 EDT by Ján Rusnačko
Modified: 2016-11-04 04:38 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1252346 (view as bug list)
Last Closed: 2016-11-04 04:38:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
shuali: needinfo? (pwouters)

Attachments (Terms of Use)

  None (edit)
Description Ján Rusnačko 2015-08-11 04:37:14 EDT
Use after free flaw was found in the following code:

void nfct_helper_free(struct nfct_helper *h)
        int i;

        for (i=0; i<NF_CT_HELPER_CLASS_MAX; i++) {
                if (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:
Comment 8 Lon Hohberger 2016-09-16 14:37:35 EDT
*** Bug 1252346 has been marked as a duplicate of this bug. ***
Comment 12 errata-xmlrpc 2016-11-04 04:38:20 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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