Bug 133317

Summary: 64-bit "prelink -y" fails on 32-bit objects
Product: [Fedora] Fedora Reporter: Nicholas Miell <nmiell>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: jakub, pfrields, roland
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-15 22:43:57 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:

Description Nicholas Miell 2004-09-23 04:33:15 UTC
[nicholas@entropy ~]$ rpm -q --qf "%{n}-%{v}-%{r}.%{arch}\n" prelink
prelink-0.3.2-6.x86_64

[nicholas@entropy ~]$ file /usr/sbin/prelink
/usr/sbin/prelink: ELF 64-bit LSB executable, AMD x86-64, version 1
(SYSV), for GNU/Linux 2.4.0, statically linked, stripped

[nicholas@entropy ~]$ prelink -vvvvvv -y --sha /usr/bin/xml_parser
Checking executable /usr/bin/xml_parser
Checking shared library /usr/lib/libestbase.so.1.2.2.1
Checking shared library /usr/lib/libeststring.so.1.2
Checking shared library /lib/libgcc_s-3.4.2-20040908.so.1
Checking shared library /lib/tls/libc-2.3.3.so
Checking shared library /lib/ld-2.3.3.so
Checking shared library /lib/libtermcap.so.2.0.8
Checking shared library /lib/libdl-2.3.3.so
Checking shared library /lib/tls/libm-2.3.3.so
Checking shared library /usr/lib/libstdc++.so.6.0.2
prelink: /tmp/#prelink#.8wz2rn: Recorded 9 dependencies, now seeing -1

[nicholas@entropy ~]$ prelink -vvvvvv -y --sha /lib/libdl-2.3.3.so
Checking shared library /lib/libdl-2.3.3.so
Checking shared library /lib/tls/libc-2.3.3.so
Checking shared library /lib/ld-2.3.3.so
prelink: /tmp/#prelink#.cNHace: Recorded 2 dependencies, now seeing -1

Comment 1 Jakub Jelinek 2004-09-26 22:15:56 UTC
This looks like a kernel issue.
All arches seem to flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE)
in their native mmap/mmap2 wrappers around do_mmap_pgoff.
On x86-64, for 32-bit binaries sys32_mmap2 does that too, but
sys32_mmap does not.
On i386, this masking off is done in do_mmap2, which is called
by both sys_mmap2 and old_mmap.

On the other side, I wonder why this masking off these bits is done
on all arches.  If that is reverted, prelink will need to change
to cope with it for --verify.

Comment 2 Jakub Jelinek 2004-10-02 17:05:08 UTC
I have changed prelink-0.3.2-10 so that it doesn't keep the fd open
in read-only over running ld.so on it.  Still, at least for consistency
the kernel IMHO should be changed, either way.

Comment 3 Dave Jones 2005-07-15 18:41:01 UTC
An update has been released for Fedora Core 3 (kernel-2.6.12-1.1372_FC3) which
may contain a fix for your problem.   Please update to this new kernel, and
report whether or not it fixes your problem.

If you have updated to Fedora Core 4 since this bug was opened, and the problem
still occurs with the latest updates for that release, please change the version
field of this bug to 'fc4'.

Thank you.

Comment 4 Nicholas Miell 2005-07-15 20:01:20 UTC
Huh. I didn't realize this was still open. It hasn't been a problem for ....
long enough for me to forget about it, anyway.