Bug 60870
| Summary: | bash incorrectly reports missing program | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | Ulrich Drepper <drepper> | ||||||
| Component: | bash | Assignee: | wdovlrrw <brosenkr> | ||||||
| Status: | CLOSED RAWHIDE | QA Contact: | |||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 7.2 | CC: | kdudka | ||||||
| Target Milestone: | --- | Keywords: | FutureFeature | ||||||
| Target Release: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Enhancement | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2002-03-11 14:34:02 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
Created attachment 47840 [details]
patch to implement check for PT_INTERP
Created attachment 47881 [details]
New patch which will also work on platforms with alignment requirements
Agreed, added to 2.05a-9. Comment on attachment 47881 [details] New patch which will also work on platforms with alignment requirements > + do > + { > + if (actlen == maxlen) > + { > + char *newinterp = realloc (interp, maxlen += 200); > + if (newinterp == NULL) > + { > + actlen = 0; > + break; > + } > + interp = newinterp; > + > +#ifdef HAVE_PREAD > + actlen = pread (fd, interp, maxlen, offset); > +#else > + if (lseek (fd, offset, SEEK_SET) != -1) > + actlen = read (fd, interp, maxlen); > + else > + actlen = -1; > +#endif > + } > + } > + while (actlen > 0 && memchr (interp, '\0', actlen) == NULL); If (p)read reads less than maxlen bytes (and there is no NUL in the data), the code ends up in an infinite loop. Note there is a different version of the patch, which should be free of this bug (originally intended for zsh): http://www.zsh.org/mla/workers/2015/msg00833.html |
From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9+) Gecko/20020306 Description of problem: If a dynamically linked ELF binary is executed and the referenced ELF interpreter (aka dynamic linker) is missing the report says that the executable itself is missing. This is of course bogus. With some more work bash can report the real reason. I will append a patch for this. It was also sent to the bash maintainer for inclusion in the next release but it is important enough to go in even without the upstream maintainer agreeing to it. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.echo 'int main () { return 0; }' > u.c 2.gcc -o u u.c -Wl,-dynamic-linker,/foo/bar/baz 3../u Actual Results: bash: ./u: No such file or directory Expected Results: bash: ./u: /foo/bar/baz: bad ELF interpreter: No such file or directory Additional info: