Skip to contentSkip to conversation

FIx 'noexec' behavior

PATCH Jon Smirl 3 participants 4 messages Dec 6, 2003

lore
Share & tools
lore

Jon Smirl

author
#0 lore raw

CC me on replies. I'm not subscribed.

Here's my fstab.

/dev/sda5               /                       ext3    defaults        1 1
/dev/sda1               /boot                   ext3    defaults        1 2
LABEL=/dos              /rh9                    ext3    defaults        1 2
/dev/sda2               swap                    swap    defaults        0 0
/dev/hda3               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660
noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0
none                    /sys                    sysfs   defaults        0 0
tmpfs                   /tmp                    tmpfs   defaults,size=800M 0 0
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/md0                /home                   ext3    defaults        1 2
/dev/cdrom1             /mnt/cdrom1             udf,iso9660

noauto,owner,kudzu,ro 0 0

=====
Jon Smirl
[email protected]

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 15 lines · Jon Smirl
/dev/sda5               /                       ext3    defaults        1 1
/dev/sda1               /boot                   ext3    defaults        1 2
LABEL=/dos              /rh9                    ext3    defaults        1 2
/dev/sda2               swap                    swap    defaults        0 0
/dev/hda3               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660
noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0
none                    /sys                    sysfs   defaults        0 0
tmpfs                   /tmp                    tmpfs   defaults,size=800M 0 0
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/md0                /home                   ext3    defaults        1 2
/dev/cdrom1             /mnt/cdrom1             udf,iso9660
Quoted 1 line

noauto,owner,kudzu,ro 0 0

Unless one of the filesystems does something funny and sets the noexec bit automatically, I see nothing which could cause the problem since there is no "noexec" anywhere. Maybe you have additional mounts. Instead of looking at fstab, send the output of running "mount" without any parameter.

Also, you can try running mozilla with strace -f. Redirect the strace output to a file with the -o option. Mozilla should work if you use an updated RHL9 or FC1 installation. This will show where the program tries to use mmap in a way conflicting with the patch.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/0i9d2ijCOnn/RHQRAhojAKC/PCc9Q7zStuglTS7jql9OOW65+gCeJkmm 7Dm7Kd72Sju/Km977wGFGxY=
=DGsA
-----END PGP SIGNATURE-----

#2 lore raw

Ulrich Drepper <[email protected]> writes:

	if (file && (!file->f_op || !file->f_op->mmap))
		return -ENODEV;

	if ((prot & PROT_EXEC) && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
		return -EPERM;

Probably he get the oops, because file can be NULL.

Signature · 1 line
OGAWA Hirofumi <[email protected]>
author
#3 lore raw

This seems to fix it:

[jonsmirl@smirl mm]$ bk diffs
===== mmap.c 1.94 vs edited =====
481c481
< if ((prot & PROT_EXEC) && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
---

Quoted 1 line
      if (file && (prot & PROT_EXEC) && (file->f_vfsmnt->mnt_flags & MNT_NOEXE

C))
[jonsmirl@smirl mm]$

Although I didn't have any oops on my console, in dmesg or messages.

Quoted 11 lines · --- OGAWA Hirofumi

Ulrich Drepper <[email protected]> writes:

	if (file && (!file->f_op || !file->f_op->mmap))
		return -ENODEV;

	if ((prot & PROT_EXEC) && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
		return -EPERM;

Probably he get the oops, because file can be NULL.

Signature · 1 line
OGAWA Hirofumi <[email protected]>

=====
Jon Smirl
[email protected]

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/