Re: [PATCH][RFC] Simple tamper-proof device filesystem.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Tetsuo Handa <penguin-kernel@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>, <w@...>, <serue@...>
Date: Friday, January 11, 2008 - 8:22 am

Hi,

On Fri, January 11, 2008 09:46, Tetsuo Handa wrote:

Source isn't needed, as long as the vendor has it.


Then why should anyone else support it?


Then you can't trust it and it shouldn't have permission to do
potentially dangerous things in /dev/ either. Even if you can
contain the device node creation, it most likely does other
potentially dangerous things too. As a whole it can't be trusted.


I'm not talking about devfs, I'm talking about a real static /dev.
I'm using it now and it works fine (I let udev manage /udev/ to see
what's it's doing).


Wrong. All nodes are created and thus there's never a need to create
new nodes. So /dev/ can't be modified by anyone. This works because
all nodes that anyone might want to create already exist.


This would also be true for all nodes in a static /dev I think.


In a static /dev you only create the nodes you want. It's true that it
can't hide nodes for hardware that doesn't exist (other than deleting
the nodes manually), but that was the norm for years before the
whole dynamic /dev thing catched up.


It doesn't have to be rare, anything is fine. You don't know
anything else than udev? (And shell commands like mknod etc.)

Then why all the talk about mysterious apps that might need to
do all kind of crazy things in /dev?



This is true on a theoretical level. But practically I think you can either
run multiple daemons, one for each namespace where you want to
control /dev/, or if you really want one daemon you can pass the
directory fd to it where the node should be created and use mknodat().
I believe that crosses namespaces correctly.

If the daemon can't be contacted or doesn't want to do a mknod for you,
the preloaded lib can fallback to doing the mknod itself, though normally
that would be disallowed by MAC.

But I think that the chance that any process needs to create device nodes
in a chroot is at the level of fairy existance.


If the preloaded library is setuid, it will also work for setuid programs.
It's true that it won't work for statically linked apps, but so what?

Device node creating apps are rare enough, let alone the ones that are
also statically linked. Nice theoretical problem, but I don't think anyone
will care in practice.


That "only the tiny daemon can modify /dev/" is done with MAC rules,
the ones that should be the default for all applications except udev by
default already. For teh kernel nothing changes.


Or ignore the problem and see if it's a real problem or a nice theoretical
case. And when it turns out to be a real problem, there are probably
ways to fix it (See above). But you know what exactly is needed only
after problems do turn up.


With this the filesystem at least adds some unique abilities.

If anyone really needs it and where/how it should be implemented is
another matter.

Without it it's a glorified and complicated drop-in replacement for
a static /dev/.

Regards,

Indan


-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH][RFC] Simple tamper-proof device filesystem., Tetsuo Handa, (Sun Jan 6, 2:20 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Willy Tarreau, (Sun Jan 6, 2:26 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Tetsuo Handa, (Sun Jan 6, 11:20 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Indan Zupancic, (Mon Jan 7, 4:37 pm)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Indan Zupancic, (Tue Jan 8, 11:47 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Tetsuo Handa, (Wed Jan 9, 12:39 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Indan Zupancic, (Wed Jan 9, 9:59 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Tetsuo Handa, (Thu Jan 10, 12:57 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Indan Zupancic, (Thu Jan 10, 7:05 pm)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Tetsuo Handa, (Fri Jan 11, 4:46 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Indan Zupancic, (Fri Jan 11, 8:22 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Tetsuo Handa, (Fri Jan 11, 10:05 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Lennart Sorensen, (Fri Jan 11, 10:46 am)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Serge E. Hallyn, (Wed Jan 9, 7:08 pm)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Indan Zupancic, (Wed Jan 9, 9:06 pm)
Re: [PATCH][RFC] Simple tamper-proof device filesystem., Willy Tarreau, (Sun Jan 6, 3:45 am)