Next Gen of Linux

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Next Gen of Linux

Post by Kevin »

Solar, you seems to have as strong opinions (or should I say belief?) as some of the kernel developers and honestly I don't want to judge who has the "better" ones. ;)

Anyway, all of your examples definitely shouldn't have happened within one version of your distro and managing the upgrade case to a newer version of your distribution is not the job of kernel.org (but the same developers for their respective distribution).
Developer of tyndur - community OS of Lowlevel (German)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Next Gen of Linux

Post by Brendan »

Hi,
Solar wrote:Read /usr/src/linux/Documentation/stable_api_nonsense.txt for the official POV of the kernel dev's. In one line, no driver that's not in the kernel repo (i.e., fully disclosed GPL source) will ever be considered, and they think this is a good thing to do.
AFAIK for Linux "many eyes" is the only thing protecting people from malicious (and/or buggy) code running at CPL=0 with full access to everything.

Pretend for a minute that you're evil, and you want to write a keylogger to steal passwords. My first step would be to think of something people want (e.g. a graphical utility to configure, start, pause and stop virtual machines that supports lots of different VMMs and emulators) and find a believable excuse for this utility to require some sort of kernel module (e.g. to install generic "cross-VMM" TUN/TAP, or to control KVM); and then use the kernel module as a trojan to get the keylogger running.

IMHO there's only 5 approaches to handling this problem:
  • The Linux approach: require that all kernel modules are open source (and then complain that hardware manufacturers don't provide open source drivers)
  • The Microsoft approach: have some sort of certification program (and hope that the people doing the certification actually catch any problems)
  • The "sealed system" approach: make it impossible for anyone to install a kernel module (e.g. build everything into the kernel, with no support for dynamically loaded device drivers, etc)
  • The micro-kernel approach: use actual protection (e.g. run device drivers at CPL=3)
  • The "bending over with pants down and fingers crossed" approach: Do nothing and hope nobody feels like taking advantage ;)
Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Next Gen of Linux

Post by Solar »

Approach 6:
  • Use one of the available (!) techniques for executing untrusted bytecode in a trusted kernel sandbox.
However, I don't see how any of this - even the "all drivers in the kernel" part - makes it necessary to switch ABI, internal architecture etc. on a whim...
Every good solution is obvious once you've found it.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Next Gen of Linux

Post by Brendan »

Hi,
Solar wrote:However, I don't see how any of this - even the "all drivers in the kernel" part - makes it necessary to switch ABI, internal architecture etc. on a whim...
It doesn't make it necessary to switch ABI, internal architecture etc. on a whim, but if all drives are in the kernel's source code there's no reason not to switch ABI, internal architecture etc. on a whim.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Next Gen of Linux

Post by Solar »

Brendan wrote:...but if all drives are in the kernel's source code there's no reason not to switch ABI...
...but they aren't, and they won't.

Oh, I forgot to mention another case that drove me up the walls: ReiserFS 4...
Every good solution is obvious once you've found it.
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: Next Gen of Linux

Post by Craze Frog »

Brendan wrote:Hi,

Pretend for a minute that you're evil, and you want to write a keylogger to steal passwords. My first step would be to think of something people want (e.g. a graphical utility to configure, start, pause and stop virtual machines that supports lots of different VMMs and emulators) and find a believable excuse for this utility to require some sort of kernel module (e.g. to install generic "cross-VMM" TUN/TAP, or to control KVM); and then use the kernel module as a trojan to get the keylogger running.

IMHO there's only 5 approaches to handling this problem:
  • The Linux approach: require that all kernel modules are open source (and then complain that hardware manufacturers don't provide open source drivers)
How would the Linux approach help? If you can write a kernel level keylogger you should be able to write a script to compile it automatically on the target's computer with the target's header files and compiler, and that will bypass any "protection".
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: Next Gen of Linux

Post by Craze Frog »

...but if all drives are in the kernel's source code there's no reason not to switch ABI...
Oh sure there is. Linux drivers break all the time. Imagine if you could just copy over an old version (like using a Windows XP driver on Vista).
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: Next Gen of Linux

Post by quok »

Craze Frog wrote:
Brendan wrote:Hi,

Pretend for a minute that you're evil, and you want to write a keylogger to steal passwords. My first step would be to think of something people want (e.g. a graphical utility to configure, start, pause and stop virtual machines that supports lots of different VMMs and emulators) and find a believable excuse for this utility to require some sort of kernel module (e.g. to install generic "cross-VMM" TUN/TAP, or to control KVM); and then use the kernel module as a trojan to get the keylogger running.

IMHO there's only 5 approaches to handling this problem:
  • The Linux approach: require that all kernel modules are open source (and then complain that hardware manufacturers don't provide open source drivers)
How would the Linux approach help? If you can write a kernel level keylogger you should be able to write a script to compile it automatically on the target's computer with the target's header files and compiler, and that will bypass any "protection".
You can't assume every linux box (or in this case any kind of box) will have a compiler on it. Having compilers on production machines is a huge security hole for exactly this reason. I rather dislike that so many linux distros default to installing any development tools. But you're right; if a compiler is available anyone could use it to bypass any protection by compiling a kernel module and loading it. Hopefully in that case, the machine is otherwise locked down pretty well, so remote root access is much harder to come by.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Next Gen of Linux

Post by Combuster »

quok wrote:Having compilers on production machines is a huge security hole for exactly this reason.
Why is it? if you have access to any account on a machine then you can just as easily wget a copy from somewhere instead of compiling it yourself. Even then, you need root access to modify the kernel in any way (including loading kernel modules or putting them somewhere for the kernel to find).

Basically, a not installing a compiler is only good enough to save a cracker a few minutes. It doesn't add to security, it doesn't break down on security. And in most instances, it doesn't matter at all.

That said, I once had a distro (SuSe) that did not install a compiler, and did not allow it to be installed either. The result was that the machine was crippled for my server purposes. (More rants on that distro available on request)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: Next Gen of Linux

Post by quok »

Combuster wrote:
quok wrote:Having compilers on production machines is a huge security hole for exactly this reason.
Why is it? if you have access to any account on a machine then you can just as easily wget a copy from somewhere instead of compiling it yourself. Even then, you need root access to modify the kernel in any way (including loading kernel modules or putting them somewhere for the kernel to find).

Basically, a not installing a compiler is only good enough to save a cracker a few minutes. It doesn't add to security, it doesn't break down on security. And in most instances, it doesn't matter at all.

That said, I once had a distro (SuSe) that did not install a compiler, and did not allow it to be installed either. The result was that the machine was crippled for my server purposes. (More rants on that distro available on request)
You're right, an intruder could always just wget a copy. However, security is one of those things that's best done in layers, and a few extra minutes spent by an intruder having to download a compiler could be just the couple of minutes you need to save your machine.

Besides, any account with access to a compiler has the potential to gain root access. There's plenty of examples of privilege escalation out there.

Any company I've ever worked at has disallowed compilers on production servers (even internal facing servers) as a matter of security policy. It doesn't fix much of anything, really, but it is does slow people down. It's been my experience that most script kiddies rely on a compiler being available, and as soon as they see that gcc isn't there, they lose interest and go elsewhere.

As for SuSE, I use to love that distro and I do still use it as my primary distro. I've never had that problem, but I've got my own book of rants about the distro. (YaST overwriting config files isn't one of them, though.)
Post Reply