Memory leak when dlopen() selinux

Solution Unverified - Updated -

Issue

  • The issue is observed when our product dlopen() libselinux on RedHat 5.x/6.x
  • We have confirmed the memory leak after dlopen() using valgrind, see below:
==11099== 1,288 bytes in 8 blocks are definitely lost in loss record 5,740 of 5,870
==11099==    at 0x4A04820: memalign (vg_replace_malloc.c:581)
==11099==    by 0x3BB9C1104F: tls_get_addr_tail (in /lib64/ld-2.12.so)
==11099==    by 0x3BB9C1151F: __tls_get_addr (in /lib64/ld-2.12.so)
==11099==    by 0x3BBBC14333: selinux_raw_to_trans_context (in /lib64/libselinux.so.1)
==11099==    by 0x3BBBC0CA79: getfilecon (in /lib64/libselinux.so.1)
==11099==    by 0x56F0B5B: cims::SELinuxModule::getfilecon(char const*, char**) (selinux_context.cpp:63)
==11099==    by 0x56F021D: cims::RestoreFileSELinuxLabel(std::string const&) (selinux_context.cpp:267)
==11099==    by 0x56B3990: renameFile(std::string, std::string) (file_util.cpp:134)
...
  • We believe this is related to a bug in glibc (see http://sourceware.org/bugzilla/show_bug.cgi?id=12650 )

Environment

  • Red Hat Enterprise Linux 5/6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.