Re: [PATCH v2] devtmpfs: mount with noexec and nosuid

From: Alan Cox
Date: Tue Nov 20 2012 - 19:26:35 EST


On Tue, 20 Nov 2012 16:18:33 -0800
Kees Cook <keescook@xxxxxxxxxxxx> wrote:

> On Tue, Nov 20, 2012 at 4:13 PM, Kay Sievers <kay@xxxxxxxx> wrote:
> > On Tue, Nov 20, 2012 at 9:42 PM, Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> >> Since devtmpfs is writable, make the default noexec,nosuid as well. This
> >> protects from the case of a privileged process having an arbitrary file
> >> write flaw and an argumentless arbitrary execution (i.e. it would lack
> >> the ability to run "mount -o remount,exec,suid /dev").
> >
> > This only really applies to systems without an initramfs when the
> > kernel mounts /dev over the rootfs it has mounted; with an initramfs,
> > /dev is always mounted by user code.
> >
> > Just checking, that is the use case you are doing that for?
>
> Correct. We're using this in Chrome OS, which does not use an initramfs.

But which has a perfectly good init process of its own, so it's just fine.

If you fix your init to do the work then you can deploy it to all your
Google partners and onto existing devices in an update even with old
kernels. Far better security practise.

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