Re: Executing binaries on new filesystem

Ryan Cumming (bodnar42@phalynx.dhs.org)
Mon, 19 Nov 2001 15:45:20 -0800


On November 19, 2001 08:34, Rock Gordon wrote:
> I don't think mmap is the problem; you don't need it
> in order to run binaries ...

Er... and what brings you to that assertion? Try cat'ing /proc/<pid>/maps on
any program, and you'll see the program's binary in the maps list multiple
times, including one executable map of the .code section. To use my current
mail client as an example:

bodnar42:~$ pidof kmail
3905
bodnar42:~$ cat /proc/3905/maps
08048000-081b0000 r-xp 00000000 03:05 1209118 /usr/bin/kmail
081b0000-081bb000 rw-p 00167000 03:05 1209118 /usr/bin/kmail
081bb000-0863a000 rwxp 00000000 00:00 0
40000000-40014000 r-xp 00000000 03:05 1154 /lib/ld-2.2.4.so
40014000-40015000 rw-p 00013000 03:05 1154 /lib/ld-2.2.4.so
40015000-40016000 rwxp 00000000 00:00 0
40016000-4001c000 rw-p 00000000 00:00 0
4001d000-4001e000 rw-p 00007000 00:00 0
40022000-40203000 r-xp 00000000 03:05 442168 /usr/lib/libkhtml.so.3.0.0
40203000-40235000 rw-p 001e0000 03:05 442168 /usr/lib/libkhtml.so.3.0.0
...

Any sane ELF loader will use mmap() to both execute binaries and load shared
libraries, and Linux's ELF loader is certainly no exception. I remember users
not being able to run binaries (both Win32 and Linux/ELF) off of NTFS
partitions, because the Linux NTFS driver did not implement mmap(). You'll
probably have much better luck once you implement it on yours.

-Ryan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/