Bug 711066

Summary: incorrectly reports missing program
Product: [Fedora] Fedora Reporter: Roman Rakus <rrakus>
Component: tcshAssignee: Fridolín Pokorný <fpokorny>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: kdudka, ovasik, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-22 11:08:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Bad ELF interpreter patch none

Description Roman Rakus 2011-06-06 12:43:39 UTC
The same like in bug 60870.
The shell should report the real reason.

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

Comment 1 Roman Rakus 2013-01-29 14:17:58 UTC
Feel free to reassign this bug to kernel or glibc. Handling such things in shell is total overkill.

Comment 2 Fedora Admin XMLRPC Client 2013-03-26 16:50:33 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Fedora Admin XMLRPC Client 2013-03-27 08:18:50 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora End Of Life 2013-04-03 19:21:53 UTC
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

Comment 5 Fridolín Pokorný 2013-05-13 09:33:19 UTC
Created attachment 747148 [details]
Bad ELF interpreter patch

Comment 6 Fridolín Pokorný 2013-05-22 11:08:51 UTC
Fixed by scm-commit [1].

Proposed patch was sent to upstream [2], but without any reaction. Bad ELF
interpreter patch was added to RAWHIDE as an internal patch (like bad ELF bash
internal patch).

[1] http://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20130520/1025059.html
[2] http://mx.gw.com/pipermail/tcsh-bugs/2013-April/000833.html

Comment 7 Kamil Dudka 2015-04-20 10:00:43 UTC
Comment on attachment 747148 [details]
Bad ELF interpreter patch

> +                     do {
> +                         if (actlen == maxlen) {
> +                             char *newinterp = xrealloc(interp, maxlen += 200);
> +                             if (newinterp == NULL) {
> +                                 actlen = 0;
> +                                 break;
> +                             }
> +                             interp = newinterp;
> +#ifdef HAVE_PREAD
> +                             actlen = pread (fd, interp, maxlen, offset);
> +#else /* !HAVE_PREAD */
> +                             if (lseek (fd, offset, SEEK_SET) != -1)
> +                                 actlen = read (fd, interp, maxlen);
> +                             else
> +                                 actlen = -1;
> +#endif /* HAVE_PREAD */
> +                         }
> +                     } 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