Bug 1163404
Summary: | [procps] find_elf_note invalid read if setenv has been called before libproc init | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Peter Edwards <thatsafunnyname> | |
Component: | procps | Assignee: | Jaromír Cápík <jcapik> | |
Status: | CLOSED ERRATA | QA Contact: | Branislav Náter <bnater> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 6.5 | CC: | albert, bnater, jhouska, kdudka, ovasik, pandrade, sgaikwad, thatsafunnyname | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | procps-3.2.8-31.el6 | Doc Type: | Bug Fix | |
Doc Text: |
Previously, behavior of the libproc library was unreliable when it was loaded with the dlopen() call after the environment was changed with the setenv() call. As a consequence, an invalid memory access error could occur in libproc. With this update, the find_elf_note() function obtains the auxiliary vector values using a different and safer method based on parsing the /proc/self/auxv file, and the described problem no longer occurs.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1287752 (view as bug list) | Environment: | ||
Last Closed: | 2015-07-22 07:35:36 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | 1287752 | |||
Bug Blocks: |
Description
Peter Edwards
2014-11-12 16:11:21 UTC
Also see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=460331 I am wondering if sysconf(_SC_CLK_TCK) can now be used to obtain Hertz. The old comment towards the top of proc/sysinfo.c includes: "Note that sysconf() is still unreliable, because it doesn't return an error code when it is used with a kernel that doesn't support the ELF note. On some other architectures there may be a system call or sysctl() that will work." It seems a popular approach these days - https://searchcode.com/?q=_SC_CLK_TCK It was this change that added the find_elf_note function: http://procps.cvs.sourceforge.net/viewvc/procps/procps/proc/sysinfo.c?r1=1.7&r2=1.8 getauxval was (only) added in glibc 2.16 [ http://lwn.net/Articles/519085/ ] Hello Peter. Prior glibc 2.19 the getauxval didn't support the errno==ENOENT checking and we need that check in order to evaluate the AT_SECURE type as it usually contains a zero value. Therefore the getauxval function is currently unsuitable as a replacement and the only fix we can do is to document the limitation. If someone wants to use dlopen for accessing the libproc functions, he/she simply needs to do the init prior manipulating with the environment variables. There seems to be no easy way around this. If you have any idea how to resolve this reliably, then tell me, please. Regards, Jaromir. It seems the auxiliary vector values can be obtained from /proc/self/auxv. Thank you. 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. https://rhn.redhat.com/errata/RHBA-2015-1407.html |