Skip to contentSkip to conversation

binfmt_misc.c, kernel-2.4.12

PATCH In review Albert Bartoszko 9 participants 26 messages Oct 19, 2001 – Oct 23, 2001

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

PATCH 1/1 binfmt_misc.c, kernel-2.4.12

Hello

I find bug in binfmt_misc.c from kernel 2.4.12 source. The read() syscal return bad value, causes some application SIGSEGV.

Example:

# modprobe binfmt_misc
# echo ':Java:M::\xca\xfe\xba\xbe::/usr/local/bin/javawrapper:'
Quoted 1 line

/proc/sys/fs/binfmt_misc/register

# strace less /proc/sys/fs/binfmt_misc/Java
...............................................................
...............................................................
open("/proc/sys/fs/binfmt_misc/Java", O_RDONLY) = 3
lseek(3, 1, SEEK_SET)                   = 1
lseek(3, 0, SEEK_SET)                   = 0
read(3, "enabled\ninterpreter /usr/local/b"..., 64) = 71

^^^^^^^^
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

I send a patch I wrote that correct this problem and do same cleanup, so source and object are a bit smaller.

Albert Bartoszko
[email protected]

usr/src/linux/fs/binfmt_misc.c renamed from usr/src/linux/fs/binfmt_misc.c.org +15 -21
@@ -13,6 +13,8 @@
  *  1997-06-26 hpa: pass the real filename rather than argv[0]
  *  1997-06-30 minor cleanup
  *  1997-08-09 removed extension stripping, locking cleanup
+ *  2001-10-15 Albert Bartoszko: cleanup, 
+ *		correct return value of proc_read_status()
  */
 
 #include <linux/config.h>
@@ -354,28 +356,19 @@
 	char *dp;
 	int elen, i, err;
 
-#ifndef VERBOSE_STATUS
-	if (data) {
+	if (!data) 
+	    sprintf(page, "%s\n", "enabled");
+	else {
 		if (!(e = get_entry((int) data))) {
 			err = -ENOENT;
 			goto _err;
-		}
-		i = e->flags & ENTRY_ENABLED;
-		put_entry(e);
-	} else {
-		i = enabled;
-	} 
-	sprintf(page, "%s\n", (i ? "enabled" : "disabled"));
+		} 
+#ifndef VERBOSE_STATUS		
+    		sprintf(page, "%s\n", 
+			(e->flags & ENTRY_ENABLED) ? "enabled" : "disabled");
 #else
-	if (!data)
-		sprintf(page, "%s\n", (enabled ? "enabled" : "disabled"));
-	else {
-		if (!(e = get_entry((long) data))) {
-			err = -ENOENT;
-			goto _err;
-		}
-		sprintf(page, "%s\ninterpreter %s\n",
-		        (e->flags & ENTRY_ENABLED ? "enabled" : "disabled"),
+		sprintf(page, "%s\ninterpreter %s\n", 
+			(e->flags & ENTRY_ENABLED) ? "enabled" : "disabled",	
 			e->interpreter);
 		dp = page + strlen(page);
 		if (!(e->flags & ENTRY_MAGIC)) {
@@ -399,13 +392,14 @@
 			*dp++ = '\n';
 			*dp = '\0';
 		}
-		put_entry(e);
-	}
 #endif
-
+		put_entry(e);	
+	}
 	elen = strlen(page) - off;
 	if (elen < 0)
 		elen = 0;
+	if (elen > count)
+		elen = count;
 	*eof = (elen <= count) ? 1 : 0;
 	*start = page + off;
 	err = elen;
#1 lore raw
Quoted 3 lines · Albert Bartoszko

Hello

I find bug in binfmt_misc.c from kernel 2.4.12 source. The read() syscal

only one?

Quoted 1 line

return bad value, causes some application SIGSEGV.

Hardly a surprise. Not everything that passes compiler is valid C. Stuff in fs/binfmt_misc.c from Linus' tree isn't. Pick one from -ac
+ corresponding change in fs/proc/root.c (again, see -ac). Variant in Linus' tree is complete crap.

<goes back to sleep>

#2 lore raw

Hi Linus,

As Al pissed me off again with complaining about binfmt_misc, please apply the attached patch which corrects the 'not C code' line and fixes the problem Albert noticed. This doesnt fix various assumptions about the /proc code that were either valid at the time of writing binfmt_misc or badly/not documented.

Feel free to use binfmt_misc version from -ac, I'm sure Al will take responsibility of maintaining that crappy version then.

Thanx, Richard.

Quoted 7 lines · Alexander Viro
Quoted 3 lines · Albert Bartoszko

Hello

I find bug in binfmt_misc.c from kernel 2.4.12 source. The read() syscal

only one?

Quoted 8 lines
Quoted 1 line

return bad value, causes some application SIGSEGV.

Hardly a surprise. Not everything that passes compiler is valid C. Stuff in fs/binfmt_misc.c from Linus' tree isn't. Pick one from -ac
+ corresponding change in fs/proc/root.c (again, see -ac). Variant in Linus' tree is complete crap.

<goes back to sleep>

--
Richard Guenther <[email protected]>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
The GLAME Project: http://www.glame.de/

binfmt_misc.c renamed from home/kobras/tatadm/kernel/linux-2.4.3-UP/fs/binfmt_misc.c +16 -24
@@ -13,6 +13,8 @@
  *  1997-06-26 hpa: pass the real filename rather than argv[0]
  *  1997-06-30 minor cleanup
  *  1997-08-09 removed extension stripping, locking cleanup
+ *  2001-10-15 Albert Bartoszko: cleanup, 
+ *		correct return value of proc_read_status()
  */
 
 #include <linux/config.h>
@@ -300,9 +302,7 @@
 
 	e->proc_name = copyarg(&dp, &sp, &cnt, del, 0, &err);
 
-	/* we can use bit 3 of type for ext/magic
-	   flag due to the nice encoding of E and M */
-	if ((*sp & ~('E' | 'M')) || (sp[1] != del))
+	if ((*sp != 'E' && *sp != 'M') || (sp[1] != del))
 		err = -EINVAL;
 	else
 		e->flags = (*sp++ & (ENTRY_MAGIC | ENTRY_ENABLED));
@@ -354,28 +354,19 @@
 	char *dp;
 	int elen, i, err;
 
-#ifndef VERBOSE_STATUS
-	if (data) {
+	if (!data) 
+	    sprintf(page, "%s\n", "enabled");
+	else {
 		if (!(e = get_entry((int) data))) {
 			err = -ENOENT;
 			goto _err;
-		}
-		i = e->flags & ENTRY_ENABLED;
-		put_entry(e);
-	} else {
-		i = enabled;
-	} 
-	sprintf(page, "%s\n", (i ? "enabled" : "disabled"));
+		} 
+#ifndef VERBOSE_STATUS		
+    		sprintf(page, "%s\n", 
+			(e->flags & ENTRY_ENABLED) ? "enabled" : "disabled");
 #else
-	if (!data)
-		sprintf(page, "%s\n", (enabled ? "enabled" : "disabled"));
-	else {
-		if (!(e = get_entry((long) data))) {
-			err = -ENOENT;
-			goto _err;
-		}
-		sprintf(page, "%s\ninterpreter %s\n",
-		        (e->flags & ENTRY_ENABLED ? "enabled" : "disabled"),
+		sprintf(page, "%s\ninterpreter %s\n", 
+			(e->flags & ENTRY_ENABLED) ? "enabled" : "disabled",	
 			e->interpreter);
 		dp = page + strlen(page);
 		if (!(e->flags & ENTRY_MAGIC)) {
@@ -399,13 +390,14 @@
 			*dp++ = '\n';
 			*dp = '\0';
 		}
-		put_entry(e);
-	}
 #endif
-
+		put_entry(e);	
+	}
 	elen = strlen(page) - off;
 	if (elen < 0)
 		elen = 0;
+	if (elen > count)
+		elen = count;
 	*eof = (elen <= count) ? 1 : 0;
 	*start = page + off;
 	err = elen;
#3 lore raw
Quoted 7 lines · Richard Guenther

Hi Linus,

As Al pissed me off again with complaining about binfmt_misc, please apply the attached patch which corrects the 'not C code' line and fixes the problem Albert noticed. This doesnt fix various assumptions about the /proc code that were either valid at the time of writing binfmt_misc or badly/not documented.

Like, say it, "thou shalt not dereference user-supplied pointers for verily, copy_from_user() is there for purpose"?

Or "tons of blind sprintf() calls can really ruin your day when you overflow the buffer"?

Or that checking the values of arguments, while a noble thing, should be done _before_ you use them?

Or, say it, one about meaning of

        if ((count == 1) && !(buffer[0] & ~('0' | '1'))) {
not being the same as
        if (count == 1 && (buffer[0] == '0' || buffer[0] == '1')) {

Darn that Ritchie guy - he should've documented that stuff. Oh, wait - he had actually done that...

Please, learn C. Then learn some basic stuff about kernel programming. Then feel free to start mouthing off.

As for the version in -ac and maintaining it - sure I will.

#4 lore raw
Quoted 9 lines · Alexander Viro
Quoted 7 lines · Richard Guenther

Hi Linus,

As Al pissed me off again with complaining about binfmt_misc, please apply the attached patch which corrects the 'not C code' line and fixes the problem Albert noticed. This doesnt fix various assumptions about the /proc code that were either valid at the time of writing binfmt_misc or badly/not documented.

As binfmt_misc write access is root only, I didnt care to check too much as root can shoot himself anyway. Some places could use more checking, some even less.

Quoted 4 lines

Or, say it, one about meaning of

        if ((count == 1) && !(buffer[0] & ~('0' | '1'))) {
not being the same as
        if (count == 1 && (buffer[0] == '0' || buffer[0] == '1')) {

Err, who said that it is the same?? Its sufficient, if you trust root to just pass '0' or '1'. Ok, its probably too clever for the average C programmer, but it seems I didnt care.

Quoted 2 lines

Please, learn C. Then learn some basic stuff about kernel programming. Then feel free to start mouthing off.

Well, try to get some basic communication style and you'll even get a long with guys like me.

Quoted 1 line

As for the version in -ac and maintaining it - sure I will.

Just get Linus to take the -ac version then. I'm sick to read your comments about binfmt_misc over and over again. You've made your point(s) - more than one time. Thats enough. Welcome to my killfile now.

Richard.

--
Richard Guenther <[email protected]>
PGP: 2E829319 - 2F 83 FC 93 E9 E4 19 E2 93 7A 32 42 45 37 23 57
WWW: http://www.anatom.uni-tuebingen.de/~richi/

#5 lore raw
Quoted 8 lines · Richard Guenther
Quoted 4 lines

Or, say it, one about meaning of

        if ((count == 1) && !(buffer[0] & ~('0' | '1'))) {
not being the same as
        if (count == 1 && (buffer[0] == '0' || buffer[0] == '1')) {

Err, who said that it is the same?? Its sufficient, if you trust root to just pass '0' or '1'. Ok, its probably too clever for the average C programmer, but it seems I didnt care.

	If you trust root to pass '0' or '1' - (count == 1) would do nicely.

And sorry, but "clever" is not the word that comes to mind. "Not having a clue on the meaning of bitwise operations" would be more accurate.

Quoted 3 lines
Quoted 1 line

As for the version in -ac and maintaining it - sure I will.

Just get Linus to take the -ac version then. I'm sick to read

<shrug> might be a good idea. The thing is extremely sloppy and considering the blatant "I'm t00 l33t t0 F1X 7h4t" attitude of maintainer...

#6 lore raw
In reply to Alexander Viro
Quoted 1 line
Quoted 1 line

I find bug in binfmt_misc.c from kernel 2.4.12 source. The read()

syscal

Quoted 2 lines

only one?

"Gutta cavat lapidem non vi, sed saepe cadendo"

Quoted 7 lines
Quoted 2 lines

return bad value, causes some application SIGSEGV.

Hardly a surprise. Not everything that passes compiler is valid C. Stuff in fs/binfmt_misc.c from Linus' tree isn't. Pick one from -ac
+ corresponding change in fs/proc/root.c (again, see -ac). Variant in Linus' tree is complete crap.

You are sarcastic.

I do it. And:

# uname -a
Linux xxxx 2.4.12-ac3 #1 Sun Oct 21 13:50:52 CEST 2001 i686 unknown
# insmod binfmt_misc
Using /lib/modules/2.4.12-ac3/kernel/fs/binfmt_misc.o
# echo ':Java:M::\xca\xfe\xba\xbe::/usr/local/bin/javawrapper:'
Quoted 1 line

/proc/sys/fs/binfmt_misc/register

bash: /proc/sys/fs/binfmt_misc/register: No such file or directory

# lsmod
Module                  Size  Used by
binfmt_misc             5680   1
#rmmod binfmt_misc
binfmt_misc: Device or resource busy                # ?????

Very high C. But this don't work for me.

#7 lore raw
Quoted 5 lines · Albert Bartoszko

Linux xxxx 2.4.12-ac3 #1 Sun Oct 21 13:50:52 CEST 2001 i686 unknown

# insmod binfmt_misc
Using /lib/modules/2.4.12-ac3/kernel/fs/binfmt_misc.o
# echo ':Java:M::\xca\xfe\xba\xbe::/usr/local/bin/javawrapper:'
Quoted 1 line

/proc/sys/fs/binfmt_misc/register

Quoted 8 lines

bash: /proc/sys/fs/binfmt_misc/register: No such file or directory

# lsmod
Module                  Size  Used by
binfmt_misc             5680   1
#rmmod binfmt_misc
binfmt_misc: Device or resource busy                # ?????

Very high C. But this don't work for me.

Check that your modules.conf contains

post-install binfmt_misc mount -t binfmt_misc none /proc/sys/binfmt_misc pre-remove binfmt_misc umount /proc/sys/binfmt_misc

That should've been there for quite a while, actually. Keith?

#8 lore raw
Quoted 6 lines · Alexander Viro

Check that your modules.conf contains

post-install binfmt_misc mount -t binfmt_misc none /proc/sys/binfmt_misc pre-remove binfmt_misc umount /proc/sys/binfmt_misc

That should've been there for quite a while, actually. Keith?

It is not hard wired in the standard modutils, because there is no way of overriding it. If the kernel changes the way that binfmt_misc is handled then users would be stuffed.

RedHat hard code binfmt_misc into their version of modutils but I won't take the patch, users have to edit modules.conf themselves.

#9 lore raw
Quoted 11 lines · Keith Owens
Quoted 6 lines · Alexander Viro

Check that your modules.conf contains

post-install binfmt_misc mount -t binfmt_misc none /proc/sys/binfmt_misc pre-remove binfmt_misc umount /proc/sys/binfmt_misc

That should've been there for quite a while, actually. Keith?

It is not hard wired in the standard modutils, because there is no way of overriding it.

???
Elaborate, please.

#10 lore raw
Quoted 11 lines · Alexander Viro
Quoted 7 lines · Keith Owens
Quoted 2 lines · Alexander Viro

post-install binfmt_misc mount -t binfmt_misc none /proc/sys/binfmt_misc pre-remove binfmt_misc umount /proc/sys/binfmt_misc

It is not hard wired in the standard modutils, because there is no way of overriding it.

???
Elaborate, please.

When the post-install and pre-remove entries for module binfmt_misc are hard coded into modprobe, there is no syntax in modules.conf to prevent modprobe from always issuing those commands. The next time somebody decides that binfmt_misc needs different commands, everybody using the old modutils on the new kernel will break. I don't want the hassle, put it in modules.conf where it can easily be changed.

If I can get an iron clad guarantee that binfmt_misc will never, ever change again then I might consider hard coding the entries in modprobe. BTW, I will need a signature in blood that says I can kill you if binfmt_misc is ever changed :).

#11 lore raw
Quoted 11 lines · Keith Owens

When the post-install and pre-remove entries for module binfmt_misc are hard coded into modprobe, there is no syntax in modules.conf to prevent modprobe from always issuing those commands. The next time somebody decides that binfmt_misc needs different commands, everybody using the old modutils on the new kernel will break. I don't want the hassle, put it in modules.conf where it can easily be changed.

If I can get an iron clad guarantee that binfmt_misc will never, ever change again then I might consider hard coding the entries in modprobe. BTW, I will need a signature in blood that says I can kill you if binfmt_misc is ever changed :).

Wait a second. Who says anything about hardcoding that into modprobe? There is such thing as skeleton stuff for modules.conf, right?

#12 lore raw
Quoted 8 lines · Alexander Viro
Quoted 4 lines · Keith Owens

If I can get an iron clad guarantee that binfmt_misc will never, ever change again then I might consider hard coding the entries in modprobe. BTW, I will need a signature in blood that says I can kill you if binfmt_misc is ever changed :).

Wait a second. Who says anything about hardcoding that into modprobe? There is such thing as skeleton stuff for modules.conf, right?

Same thing. The preset entries in modutils util/alias.h are added to whatever the user has in modules.conf. In some cases the preset entries cannot be removed, they are cumulative so the hard coded entry cannot be removed.

The preset entries already causes problems, why should modutils insist on options sb io=0x220 irq=7 dma=1 dma16=5 mpu_io=0x330?

Quoted 3 lines

Erm... Keith, I might be misreading the source, but... Shouldn't the information like "block major $FOO is in module $BAR" live in /lib/modules/*/* ?

Historically the mapping of device majors to module or binary format type to module was coded into modutils, via util/alias.h. That was a mistake, it should have used the same technique as pci, isapnp, parport etc., each module has a table that defines what it handles and modutils extracts the data directly from the modules. Developers have changed the names of their modules and now we have hard coded module names in modutils that do not match the names used by some kernels. Hindsight is wonderful!

In modutils 2.5 I will get rid of all the hard coded entries in util/alias.h. Instead each module will define what it supports, including any special commands to be run when the module is loaded or unloaded. Much easier for everyone and far more flexible.

#13 lore raw
Quoted 13 lines · Keith Owens
Quoted 3 lines

Erm... Keith, I might be misreading the source, but... Shouldn't the information like "block major $FOO is in module $BAR" live in /lib/modules/*/* ?

Historically the mapping of device majors to module or binary format type to module was coded into modutils, via util/alias.h. That was a mistake, it should have used the same technique as pci, isapnp, parport etc., each module has a table that defines what it handles and modutils extracts the data directly from the modules. Developers have changed the names of their modules and now we have hard coded module names in modutils that do not match the names used by some kernels. Hindsight is wonderful!

Quoted 4 lines

In modutils 2.5 I will get rid of all the hard coded entries in util/alias.h. Instead each module will define what it supports, including any special commands to be run when the module is loaded or unloaded. Much easier for everyone and far more flexible.

Heh. OK, so you've stopped me in the middle of writing RFC that proposes addition of
MODULE_CONF(string)
that would put that string into separate section and making modules_install dump these sections, feed them through s/_NAME_/basename $module/ and cat them into defaults file that would go into $INSTALL_MOD_PATH. MODULES_BLKDEV(), MODULE_LDISC(), etc. would be trivial wrappers around that.

Looks like the thing you mentioned would make quite a few people happy. Might be worth doing in 2.4...

#14 lore raw

While we are at it, that would also fix the idiocy with "v7 and sysvfs live in the same module, need to edit modules.conf to make mount -t v7 ... work". I can easily think of many other examples of that sort. Hell, after a look at /etc/modules.conf on a Debian box... And yes, stuff with default options for soundcards... _ouch_

Is there any chance to get that done in 2.4? Removal of defaults from modprobe binary is a different story, but at least getting rid of temptation to add new ones would be a Nice Thing(tm). Adding relevant stuff on the kernel side wouldn't break anything and could be tested gradually...

I'm more than willing to help with that; if you start doing something of that kind in 2.4 - count me in. AFAICS it can be done without breaking compatibility and it's long overdue.

#15 lore raw
In reply to Alexander Viro
Quoted 9 lines · Alexander Viro
Quoted 4 lines · Keith Owens

In modutils 2.5 I will get rid of all the hard coded entries in util/alias.h. Instead each module will define what it supports, including any special commands to be run when the module is loaded or unloaded. Much easier for everyone and far more flexible.

Heh. OK, so you've stopped me in the middle of writing RFC that proposes addition of
MODULE_CONF(string)

Strange, that was exactly what I was planning for 2.5 :).

Quoted 1 line

that would put that string into separate section and making modules_install

<pedantic>
depmod, not modules_install, depmod is run at other times. </pedantic>

Quoted 1 line

dump these sections, feed them through s/_NAME_/basename $module/ and

kbuild 2.5 does -DKBUILD_OBJECT=module_name for all objects linked into a module. KBUILD_OBJECT defines the overall module, not the individual files that make up the module. We have the technology!

Quoted 1 line

cat them into defaults file that would go into $INSTALL_MOD_PATH.

Just another modules.* file, probably modules.dynamic.conf.

BTW, INSTALL_MOD_PATH is dead in kbuild 2.5, it is a configuration option and is held in .config.

Quoted 1 line

MODULES_BLKDEV(), MODULE_LDISC(), etc. would be trivial wrappers around that.

Everything is a device and can be handled by the hotplug project. It is really a cunning plan by David Brownell and Greg Kroah-Hartman to own the entire device subsystem ;).

Quoted 2 lines

Looks like the thing you mentioned would make quite a few people happy. Might be worth doing in 2.4...

Please, no more 2.4 changes. Let Linus get 2.4 stable, fork 2.5 so we can break it on a daily basis then backport to 2.4 when it works.

#16 lore raw
Quoted 5 lines · Keith Owens
Quoted 1 line

MODULES_BLKDEV(), MODULE_LDISC(), etc. would be trivial wrappers around that.

Everything is a device and can be handled by the hotplug project. It is really a cunning plan by David Brownell and Greg Kroah-Hartman to own the entire device subsystem ;).

No-go - we need that for filesystems. But that's a separate story - if MODULE_CONF() is there life already becomes much easier.

Quoted 5 lines
Quoted 2 lines

Looks like the thing you mentioned would make quite a few people happy. Might be worth doing in 2.4...

Please, no more 2.4 changes. Let Linus get 2.4 stable, fork 2.5 so we can break it on a daily basis then backport to 2.4 when it works.

I suspect that in this case s/2.5/2.4-ac/ might be a possibility. Since we are talking about defaults, nothing is going to break if file simply doesn't exist. So teaching modprobe to handle it if it's there would be a compatible change and would allow testing the kernel side of that stuff. Alan?

#17 lore raw
Quoted 5 lines · Alexander Viro

I suspect that in this case s/2.5/2.4-ac/ might be a possibility. Since we are talking about defaults, nothing is going to break if file simply doesn't exist. So teaching modprobe to handle it if it's there would be a compatible change and would allow testing the kernel side of that stuff. Alan?

Do you really want modules exhibiting different behaviour in Linus and -ac kernels? And have that behaviour depending on which version of modutils the user installed? Not in 2.4, modutils strives for stability in production kernels, it is an important interface between the kernel and user space.

#18 lore raw
Quoted 2 lines · Keith Owens

Please, no more 2.4 changes. Let Linus get 2.4 stable, fork 2.5 so we can break it on a daily basis then backport to 2.4 when it works.

and

Quoted 4 lines

-ac kernels? And have that behaviour depending on which version of modutils the user installed? Not in 2.4, modutils strives for stability in production kernels, it is an important interface between the kernel and user space.

Correct me if I'm wrong, but two quotes above seem to contradict each other
- AFAICS arguments in the latter apply to backporting...

#19 lore raw
Quoted 7 lines · Alexander Viro
Quoted 2 lines · Keith Owens

Please, no more 2.4 changes. Let Linus get 2.4 stable, fork 2.5 so we can break it on a daily basis then backport to 2.4 when it works.

and

Quoted 7 lines
Quoted 4 lines

-ac kernels? And have that behaviour depending on which version of modutils the user installed? Not in 2.4, modutils strives for stability in production kernels, it is an important interface between the kernel and user space.

Correct me if I'm wrong, but two quotes above seem to contradict each other
- AFAICS arguments in the latter apply to backporting...

I left out a phrase. "backport to 2.4 when it works and does not affect 2.4 compatibility". That is a given on modutils, I won't consider anything that breaks modutils compatibility on any kernel from 2.4 right down to 2.0. modutils 2.5 can shatter into tiny pieces, not a problem.

#20 lore raw
In reply to Keith Owens

In article <[email protected]> [email protected] wrote:

| Historically the mapping of device majors to module or binary format
| type to module was coded into modutils, via util/alias.h.  That was a
| mistake, it should have used the same technique as pci, isapnp, parport
| etc., each module has a table that defines what it handles and modutils
| extracts the data directly from the modules.  Developers have changed
| the names of their modules and now we have hard coded module names in
| modutils that do not match the names used by some kernels.  Hindsight
| is wonderful!

Not to mention the recent surge of renaming the parameters of modules
for no obvious reason... The number of conditionals in modules.conf is getting pretty large for people who need to run multiple kernels until the release of one which fixes all the bugs.

| In modutils 2.5 I will get rid of all the hard coded entries in
| util/alias.h.  Instead each module will define what it supports,
| including any special commands to be run when the module is loaded or
| unloaded.  Much easier for everyone and far more flexible.

I'm not sure about flexible, does it matter where the parameters or
commands are built-in as long as the admin has to change source code instead of config files to change it? It just seems like a really poor approach to what has been very flexible.

Signature · 3 lines
bill davidsen <[email protected]>
  His first management concern is not solving the problem, but covering
his ass. If he lived in the middle ages he'd wear his codpiece backward.
#21 lore raw
In reply to Keith Owens

In article <[email protected]> you write:

| When the post-install and pre-remove entries for module binfmt_misc are
| hard coded into modprobe, there is no syntax in modules.conf to prevent
| modprobe from always issuing those commands.  The next time somebody
| decides that binfmt_misc needs different commands, everybody using the
| old modutils on the new kernel will break.  I don't want the hassle,
| put it in modules.conf where it can easily be changed.

Thank you. Configuration things should be in configuration files!

I hope people will continue to resist changes which make things easy
for casual users while making them very difficult for more technically inclined people. Having to get source and recompile to disable a feature is hardly reasonable.

Signature · 3 lines
bill davidsen <[email protected]>
  His first management concern is not solving the problem, but covering
his ass. If he lived in the middle ages he'd wear his codpiece backward.
#22 lore raw
In reply to Alexander Viro
Quoted 6 lines

...............
Check that your modules.conf contains

post-install binfmt_misc mount -t binfmt_misc none /proc/sys/binfmt_misc pre-remove binfmt_misc umount /proc/sys/binfmt_misc

Yes, now contains, and mount, umount and binfmt work propely. This should be documented in sources

xx:/tmp# egrep -Hr "mount[[:space:]]+-t[[:space:]]+binfmt_misc"
/usr/src/linux
xx:/tmp#

But I still can't unload module (unmounted):
#rmmod binfmt_misc
binfmt_misc: Device or resource busy

#23 lore raw
In reply to Albert Bartoszko
Quoted 7 lines · Alexander Viro

...
Check that your modules.conf contains

post-install binfmt_misc mount -t binfmt_misc none /proc/sys/binfmt_misc pre-remove binfmt_misc umount /proc/sys/binfmt_misc

Why is it necessary that the new binfmt_misc create its own filesystem type, when all it seems to need is a couple of /proc entries?

#24 lore raw
Quoted 3 lines · Andrew Morton

Why is it necessary that the new binfmt_misc create its own filesystem type, when all it seems to need is a couple of /proc entries?

If it was so nice... It needs to create and remove them upon write(2). And doing that correctly via procfs is _not_ pretty. The damn thing is very bad at doing dynamic contents and when mixed with API of that weirdness...

#25 lore raw
In reply to Albert Bartoszko
Quoted 2 lines

I find bug in binfmt_misc.c from kernel 2.4.12 source. The read() syscal return bad value, causes some application SIGSEGV.

This has been fixed in the -ac tree since early 2.4, but Linus didnt want the fs based binfmt changes