Skip to contentSkip to conversation

2.6.0 kernel panic

DISCUSSION Murray J. Root 4 participants 6 messages Dec 28, 2003 – Dec 31, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

P4 2GHz
ASUS P4S533 mainboard
1G PC2700 RAM
GF2 GTS video using nv driver
2.6.0 compiled with gcc 3.3.2

At boot kernel gets:
INIT: cannot execute "/etc/rc.d/rc.sysinit"
then panic.

Same configuration for 2.6.0-test11 and earlier works fine.

Signature · 1 line
Murray J. Root
#1 lore raw
Quoted 11 lines · Murray J. Root

P4 2GHz
ASUS P4S533 mainboard
1G PC2700 RAM
GF2 GTS video using nv driver
2.6.0 compiled with gcc 3.3.2

At boot kernel gets:
INIT: cannot execute "/etc/rc.d/rc.sysinit"
then panic.

Same configuration for 2.6.0-test11 and earlier works fine.

Update your gcc-rpm and recompile

# Han

#2 lore raw
In reply to Murray J. Root
Quoted 6 lines · Murray J. Root

P4 2GHz
ASUS P4S533 mainboard
1G PC2700 RAM
GF2 GTS video using nv driver
2.6.0 compiled with gcc 3.3.2

Quoted 6 lines

At boot kernel gets:
INIT: cannot execute "/etc/rc.d/rc.sysinit"
then panic.

Same configuration for 2.6.0-test11 and earlier works fine.

To answer myself, I did a diff between 2.6.0-test11 and 2.6.0. Found this:

mm/mmap.c +8 -2
diff -ru RAW260T11/mm/mmap.c RAW260/mm/mmap.c
@@ -19,6 +19,7 @@
 #include <linux/hugetlb.h>
 #include <linux/profile.h>
 #include <linux/module.h>
+#include <linux/mount.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
@@ -474,8 +475,13 @@
 	struct rb_node ** rb_link, * rb_parent;
 	unsigned long charged = 0;
 
-	if (file && (!file->f_op || !file->f_op->mmap))
-		return -ENODEV;
+	if (file) {
+		if (!file->f_op || !file->f_op->mmap)
+			return -ENODEV;
+
+		if ((prot & PROT_EXEC) && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
+			return -EPERM;
+	}
 
 	if (!len)
 		return addr;

I undid the changes and it boots fine.
Don't know if it makes a difference but I don't use an initrd.

Signature · 1 line
Murray J. Root
#3 lore raw
Quoted 7 lines · Murray J. Root
Quoted 6 lines · Murray J. Root

P4 2GHz
ASUS P4S533 mainboard
1G PC2700 RAM
GF2 GTS video using nv driver
2.6.0 compiled with gcc 3.3.2

Quoted 8 lines
Quoted 6 lines

At boot kernel gets:
INIT: cannot execute "/etc/rc.d/rc.sysinit"
then panic.

Same configuration for 2.6.0-test11 and earlier works fine.

To answer myself, I did a diff between 2.6.0-test11 and 2.6.0. Found this:

Sounds like one of the partitions that has the executable script loader is mounted with "noexec".

On most systems, /etc/rc.d/rc.sysinit is a bash script, and explicitly points to /bin/bash. Check "ldd /bin/bash", and verify that all the libraries (and /bin itself, of course) are mounted on executable filesystems.

That would be a bug that 2.6.0 uncovers.

Linus

#4 lore raw
Quoted 22 lines · Linus Torvalds
Quoted 7 lines · Murray J. Root
Quoted 6 lines · Murray J. Root

P4 2GHz
ASUS P4S533 mainboard
1G PC2700 RAM
GF2 GTS video using nv driver
2.6.0 compiled with gcc 3.3.2

Quoted 8 lines
Quoted 6 lines

At boot kernel gets:
INIT: cannot execute "/etc/rc.d/rc.sysinit"
then panic.

Same configuration for 2.6.0-test11 and earlier works fine.

To answer myself, I did a diff between 2.6.0-test11 and 2.6.0. Found this:

Sounds like one of the partitions that has the executable script loader is mounted with "noexec".

Quoted 7 lines

On most systems, /etc/rc.d/rc.sysinit is a bash script, and explicitly points to /bin/bash. Check "ldd /bin/bash", and verify that all the libraries (and /bin itself, of course) are mounted on executable filesystems.

That would be a bug that 2.6.0 uncovers.

Thought of that. What does the initial mounting of / ? If it's using /etc/fstab then that isn't the problem - I have no partitions mounting noexec. /bin and /lib are on the / partition. If it's a script then it's from Mandrake and I'll have to hunt it down and send them a patch.

Not using devfs or udev. No initrd. All components built-in although module support is enabled.

/etc/fstab is included below.

Signature · 15 lines
Murray J. Root

[root@Master source]# cat /etc/fstab
/dev/hda1 /mnt/windows vfat iocharset=iso8859-1,codepage=850,umask=0 0 0
/dev/hda5 / reiserfs notail 1 1
/dev/hda6 /usr/local reiserfs notail 1 2
/dev/hda7 /mirror reiserfs notail 1 2
/dev/hda8 /home reiserfs notail 1 2
/dev/hda9 swap swap defaults 0 0
/dev/hda10 /common reiserfs notail 1 2
/dev/hdc /mnt/cdrom iso9660 noauto,nosuid,ro,umask=0,user,nodev 0 0
/dev/hdd /mnt/cdrom2 iso9660 codepage=850,iocharset=iso8859-1,noauto,nosuid,ro,umask=0,user,nodev 0 0
/dev/sda1 /mnt/disk vfat noauto,rw,user,umask=0 0 0
none /dev/pts devpts mode=0620 0 0
none /proc proc defaults 0 0
#5 lore raw
In reply to Linus Torvalds
Quoted 22 lines · Linus Torvalds
Quoted 7 lines · Murray J. Root
Quoted 6 lines · Murray J. Root

P4 2GHz
ASUS P4S533 mainboard
1G PC2700 RAM
GF2 GTS video using nv driver
2.6.0 compiled with gcc 3.3.2

Quoted 8 lines
Quoted 6 lines

At boot kernel gets:
INIT: cannot execute "/etc/rc.d/rc.sysinit"
then panic.

Same configuration for 2.6.0-test11 and earlier works fine.

To answer myself, I did a diff between 2.6.0-test11 and 2.6.0. Found this:

Sounds like one of the partitions that has the executable script loader is mounted with "noexec".

Quoted 6 lines

On most systems, /etc/rc.d/rc.sysinit is a bash script, and explicitly points to /bin/bash. Check "ldd /bin/bash", and verify that all the libraries (and /bin itself, of course) are mounted on executable filesystems.

That would be a bug that 2.6.0 uncovers.

I've noticed that 2.4.23 lacks this additional check, and included a patch against it.

Marcelo, does this trivial stuff look good enough to be applied?

-Isaac

Quoted 7 lines

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

Signature · 3 lines
Regards, Isaac
()  ascii ribbon campaign - against html e-mail
/\                        - against microsoft attachments
mmap.c.execproto renamed from mmap.c +8 -2
@@ -17,6 +17,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
+#include <linux/mount.h>
 
 /*
  * WARNING: the debugging will use recursive algorithms so never enable this
@@ -400,8 +401,13 @@ unsigned long do_mmap_pgoff(struct file 
 	int error;
 	rb_node_t ** rb_link, * rb_parent;
 
-	if (file && (!file->f_op || !file->f_op->mmap))
-		return -ENODEV;
+	if (file) {
+		if (!file->f_op || !file->f_op->mmap)
+			return -ENODEV;
+
+		if ((prot & PROT_EXEC) && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
+			return -EPERM;
+	}
 
 	if (!len)
 		return addr;