Bug 2255 - ELF binfmt module calls do_brk to map PT_LOAD segments with a memsize > filesize, so discards mmap PROT flags
Summary: ELF binfmt module calls do_brk to map PT_LOAD segments with a memsize > files...
Alias: None
Product: Other
Classification: Unclassified
Component: Modules (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: other_other
Depends on:
Reported: 2004-03-05 08:59 UTC by Mike Hearn
Modified: 2008-09-24 03:28 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.1
Tree: Mainline
Regression: ---


Description Mike Hearn 2004-03-05 08:59:14 UTC
Line 698 of fs/binfmt_elf.c appears to contain a bug, whereby if a large non-BSS
(nobits) PT_LOAD segment is loaded set_brk is called which in turn calls do_brk,
which maps the area but discards the protection flags requested in the binary.

This bug was reported to me second-hand, so I can't be sure I got all the
details correct. Please let me know if not. This bug prevents Wine from using a
new ELF section to reserve parts of the address space that are required.

thanks -mike
Comment 1 Natalie Protasevich 2007-08-23 15:08:13 UTC
Any update on this problem? How are new kernels work for you?
Comment 2 Natalie Protasevich 2008-05-02 16:00:16 UTC
Someone affiliated with Wine said that this problem has been worked around so far.
Do we need a proper fix to it?
Comment 3 Roland McGrath 2008-05-02 20:16:46 UTC
To get a useful response, the bug needs details such as the eu-readelf -l layout of a binary that reproduces the problem.

Note You need to log in before you can comment on or make changes to this bug.