Created attachment 706000 [details] test.c Description of problem: Testing with valgrind shows a memory leak in setsockcreatecon in libselinux in Rawhide. It only occurs when you call setsockcreatecon (some_context) followed later in the same program by calling setsockcreatecon (NULL). The attached test program demonstrates the problem. ==11843== 56 bytes in 1 blocks are definitely lost in loss record 6 of 6 ==11843== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==11843== by 0x38EAC861F9: strdup (strdup.c:42) ==11843== by 0x38EC8097C9: setprocattrcon_raw.constprop.3 (procattr.c:241) ==11843== by 0x38EC8099B7: setprocattrcon.constprop.2 (procattr.c:274) ==11843== by 0x400955: main (in /tmp/test) This seems to be a regression compared to Fedora 18. Version-Release number of selected component (if applicable): libselinux-2.1.13-6.fc19.x86_64 How reproducible: 100% Steps to Reproduce: 1. Download the attached test program. 2. gcc -Wall test.c -o test -lselinux 3. valgrind --leak-check=full ./test Also try removing the second call to setsockcreatecon (NULL). The memory leak goes away. Also try running the same test on Fedora 18 with libselinux-2.1.12-7.1.fc18.x86_64. There is no memory leak in this version.
Fixed in libselinux-2.1.13-7.el7 Nice catch.
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Since we have libselinux 2.3 in Fedora 21, I think we can close this.