| Summary: | bugs in procps-3.2.7-ps-cgroup.patch and procps-3.2.8-pmap-smaps.patch | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Kamil Dudka <kdudka> | |
| Component: | procps | Assignee: | Jan Görig <jgorig> | |
| Status: | CLOSED ERRATA | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 6.1 | CC: | albert, bnater, ovasik, syeghiay | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | procps-3.2.8-17.el6 | Doc Type: | Bug Fix | |
| Doc Text: |
There have been found various memory leaks and incorrect use of close function in procps.
These leaks have been fixed.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 690078 (view as bug list) | Environment: | ||
| Last Closed: | 2011-05-19 14:08:17 UTC | Type: | --- | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Bug Depends On: | ||||
| Bug Blocks: | 690078 | |||
|
Description
Kamil Dudka
2011-03-10 22:40:56 UTC
Uninitialized variable 'start' isn't problem because of /proc/*/smaps file syntax. Other problems are fixed in procps-3.2.8-17.el6. (In reply to comment #4) > Uninitialized variable 'start' isn't problem because of /proc/*/smaps file > syntax. It's still worth nullifying the variable. As you can see, the return value of sscanf() is also not checked a few lines later, so it would most likely crash on any deviation from the expected input data format. Please consider also the following patch for the next iteration:
--- a/ps/output.c
+++ b/ps/output.c
@@ -1187,10 +1187,10 @@ static int pr_context(char *restrict const outbuf, const proc_t *restrict const
if(!ps_getpidcon && !tried_load){
void *handle = dlopen("libselinux.so.1", RTLD_NOW);
if(handle){
- dlerror();
ps_getpidcon = dlsym(handle, "getpidcon");
if(dlerror())
ps_getpidcon = 0;
+ dlclose(handle);
}
tried_load++;
}
(In reply to comment #6) > if(!ps_getpidcon && !tried_load){ > void *handle = dlopen("libselinux.so.1", RTLD_NOW); > if(handle){ > - dlerror(); > ps_getpidcon = dlsym(handle, "getpidcon"); > if(dlerror()) > ps_getpidcon = 0; > + dlclose(handle); This is actually a completely wrong fix, I'll try to prepare a better one... Maybe better to not fix the dlopen() handle leakage in el6. The ps_getpidcon variable is declared static and reused on the subsequent calls of pr_context(). A proper fix would require to make the handle variable globally visible and call dlclose() somewhere else. The procps-3.2.8-pmap-smaps.patch should be rewritten but it is too late to do this in 6.1. Cloning to 6.2.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
There have been found various memory leaks and incorrect use of close function in procps.
These leaks has been fixed.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Diffed Contents:
@@ -1,2 +1,2 @@
There have been found various memory leaks and incorrect use of close function in procps.
-These leaks has been fixed.+These leaks have been fixed.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0708.html |