Index Home About Blog
From: Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups: fa.linux.kernel
Subject: Re: changeset: Make forced module loading optional
Date: Mon, 05 May 2008 05:06:38 UTC
Message-ID: <fa.yRCmy0bAJ9JDRGro6ISpjMGJ5E8@ifi.uio.no>

On Mon, 5 May 2008, Rusty Russell wrote:
>
>    I'm trying to figure out how you did this.  So fedora builds unversioned
> modules, and version (and vermagic) matched your kernel?  And you somehow
> mixed them up?

I don't use modules much, so many of my kernels tend to have modules off
entirely. However, the Intel wireless drivers used to not work when
built-in (fixed now, but I still had a legacy config), so my laptop had
modules enabled, and MODVERSIONS set.

And I don't build initrd's etc crap, very much on purpose. I want to
replace the kernel, nothing else, so my /etc/grub.conf file just replaces
the distro kernel with my own, and keeps everything else untouched.

>    I don't think relying on modversions is the complete answer here.  Perhaps
> we should make modules_install blow away old modules?

Wouldn't help one whit, and is against my rules anyway. See above. I want
my own kernel, no other changes. That means that I run the distro initrd,
which has its modules for bringing stuff up with distro kernels.

And quite frankly, when I finally figured out what was going on, I was
like *WHAT THE HELL*. That kernel/module.c code was absolute and utter
crap in accepting modules that neither matched the kernel version
signature (because it had CONFIG_MODVERSIONS) *nor* the actual versioned
symbols (because the distro modules had been built without
CONFIG_MODVERSIONS).

So no, I'm not at all interested in blowing away old modules. I'm
interested in having a module loader that isn't complete and utter crap
and bypasses all the sanity checks that it has.

Which is what that changeset basically does.

People can still set CONFIG_MODULE_LOAD_FORCE, but quite frankly, I
suspect that anybody who does that is just insane and/or works with
proprietary and broken modules. So it's off by default, and hopefully no
distro will ever set it.

			Linus


From: Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups: fa.linux.kernel
Subject: Re: changeset: Make forced module loading optional
Date: Mon, 05 May 2008 17:07:46 UTC
Message-ID: <fa.UCnrhZKc6+gM0p4kqwOs6P9o304@ifi.uio.no>

On Mon, 5 May 2008, Rusty Russell wrote:
>
> BTW, for the peanut gallery: I don't recommend modversions: it's not reliable
> in detecting all differences, nor being stable when there are no real
> differences.

Umm. modversions is in general a whole lot *more* reliable than just
looking at the kernel version.

The kernel version is pretty good if you use CONFIG_LOCALVERSION_AUTO and
have a git kernel tree, but if not, then modversions is much more likely
to stop modules across big infrastructure changes during (say) the merge
window.

So I agree that modversions is not "reliable", but I think that the
alternative is often even *less* reliable, so I find the "don't recommend
modversions" comment to be pretty debatable.

Since I personally try to avoid modules, and if I do use them I'd prefer
the checking to be as strict as possible, I'd really not mind a "strict"
mode that tests both MODVERSIONS _and_ the full kernel version string.
Along with not allowing forced module loads, of course.

I also find it sad that apparently I'm one of the few ones that test with
modules turned off. It's both more secure and simpler, but it does cause
lots of noise at least during a Fedora boot, and it occasionally breaks
the /etc/rc.d scripts because they assume that they have to load modules,
and that it's an error if that fails. We had that happen with the iptables
scripts not that long ago (and note how that was unrelated to initrd: this
is past the point when things have switched to the normal root
filesystem).

IOW, I wish distros did some testing with non-modular kernels too. Oh
well. At least I can generally fix the problems, and make error reports,
but I bet it means that most other kernel users simply turn on modules
whether they need them or not.

			Linus


From: Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups: fa.linux.kernel
Subject: Re: changeset: Make forced module loading optional
Date: Mon, 05 May 2008 14:38:53 UTC
Message-ID: <fa.VTb5BzKyLEqN0PsUgxRHNfpfmWA@ifi.uio.no>

On Mon, 5 May 2008, Jan Engelhardt wrote:
>
> That's not good procedure IMO. You always want to keep a known good
> (=booting) kernel, and the distro-provided one might just be that.

Yes, I've always had a known-good fallback. So I actually do duplicate the
lines and leave unchanged versions in /etc/grub.conf for when things go
wrong.

But my point is, I really want to change just the kernel. I don't want to
care what the initrd does, and I don't want to build my own. It's all
"user space" to me - and thus beneath my notice.

And the module loading bug was just that - a kernel bug.

			Linus


From: Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups: fa.linux.kernel
Subject: Re: changeset: Make forced module loading optional
Date: Mon, 05 May 2008 15:09:28 UTC
Message-ID: <fa.KSudn7cvCMmdwCITQM6K40HU8i8@ifi.uio.no>

On Mon, 5 May 2008, Linus Torvalds wrote:
>
> Right. Which is why I build the stuff into my kernel that is required, and
> then initrd can do whatever it damn well pleases.

Btw, I realize that a distro *can* make an initrd that only works with
their own kernel. I personally suspect I'll just switch distros if that
happens - I'm already irritated enough with startup scripts etc that
complain about "/proc/modules: No such file or directory" for stuff that
is already compiled in because they want to check if it's loaded.

But quite frankly, the distro really shouldn't need to make their startup
scripts (whether on initrd or just the regular /etc/rc.d/ ones) so
fragile. And quite frankly, I don't understand why people seem to use a
kernel *BUG* as an excuse to say that I shouldn't do what I have always
done - replace just the kernel.

				Linus


From: Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups: fa.linux.kernel
Subject: Re: changeset: Make forced module loading optional
Date: Mon, 05 May 2008 15:49:54 UTC
Message-ID: <fa.LESWZBVeDtOFLYM7An/mfWQY/VM@ifi.uio.no>

On Mon, 5 May 2008, Dave Jones wrote:
>
> For Fedora (and many other distros), you can replace the last three lines with 'make install'
> It'll do everything. Construct the initrd. Install it & the vmlinuz, point grub.conf at it. etc.

You guys aren't even listening, are you?

None of the above even *works* if you don't have modules enabled (which I
mostly don't).

This bug reared its ugly head exactly because I normally don't do modules
AT ALL, but had to have modules enabled on some of my machines due to
Intel wireless legacy reasons.

Anyway, can we please agree to not beat a dead horse. If you cannot accept
the fact that I want to just replace the kernel, then please don't even
bother Cc'ing me in the discussion. Ok? Because if you cannot respect my
choices, I sure as hell am not interested in hearing you blather about how
I need to change how I use my kernel. You diss me, I diss you.

End of discussion.

		Linus

Index Home About Blog