<p dir="ltr"><br>
On Mar 18, 2014 12:59 PM, "Leonid Isaev" <<a href="mailto:lisaev@umail.iu.edu">lisaev@umail.iu.edu</a>> wrote:<br>
><br>
> [Sorry, forgot to CC the mailing list]<br>
><br>
> Hi Lennart,<br>
><br>
> On Tue, 18 Mar 2014 02:33:50 +0100<br>
> Lennart Poettering <<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>> wrote:<br>
><br>
> > On Mon, 17.03.14 19:04, Leonid Isaev (<a href="mailto:lisaev@umail.iu.edu">lisaev@umail.iu.edu</a>) wrote:<br>
> ><br>
> > > Hi,<br>
> > ><br>
> > > Currently, XDG_RUNTIME_DIR=/run/user/<UID> is mounted with rather<br>
> > > permissive, hardcoded mount options (or at least I couldn't find a<br>
> > > documented way of changing them). Specifically, a user is allowed to<br>
> > > execute things from his $XDG_RUNTIME_DIR. This effectively negates admin's<br>
> > > ability to constrain users, e.g. by mounting /home as noexec (I have seen<br>
> > > this done in some environments).<br>
> > > Is there a need to allow execution from $XDG_RUNTIME_DIR? And how<br>
> > > should one configure its mount options?<br>
> ><br>
> > Yes, this is hardcoded in 211, that's true. We could make this<br>
> > configurable but I am not really convinced that we really want that?<br>
><br>
> I agree that a complete, fstab-like configuration may be too much.<br>
><br>
> ><br>
> > I mean, the XDG_RUNTIME_DIR spec says the dir "must be fully-featured by<br>
> > the standards of the operating system. More specifically, ... proper<br>
> > permissions ... must be supported". I'd read that as if the x bit should<br>
> > do what it is supposed to do. So, in order to stay compatible with the<br>
> > spec allowing to mount it with noexec sounds undesirable.<br>
><br>
> Well, regardless of what the XDG specification says, the fact is that currently<br>
> each user has 2 /home's: one under the admin control, another -- not.<br>
><br>
> Of course, one could hook into PAM and remount each user's XDG_RUNTIME_DIR<br>
> upon login, but this is hacking around the init system... What about making<br>
> XDG_RUNTIME_DIR inherit mount options from /home if the latter is a separate<br>
> partition and fall back to the current default otherwise?<br>
><br>
> ><br>
> > Moreover "noexec" is mostly snake-oil, isn't it? You can invoke the<br>
> > executables with an interpreter still, and you can copy the files<br>
> > elsewhere...<br>
><br>
> True for the interpreted code.</p>
<p dir="ltr">And compiled code. The linker is your ELF interpreter.</p>
<p dir="ltr">> However regarding other places, if an admin<br>
> cares about noexec at all, /var/tmp, /tmp and /dev/shm should be also<br>
> constrained (I am not saying that this should be the default, just<br>
> configurable).<br>
><br>
> Thanks,<br>
> Leonid.<br>
><br>
> ><br>
> > Note that setting "noexec" on an fs means you cannot maps its files<br>
> > PROT_EXEC anymore, which breaks a number of things. In the past people<br>
> > attempted to mount /dev/shm as noexec, and dosemu broke because it made<br>
> > use of this. Then people wanted to mount /dev as noexec, which broke X11<br>
> > which wanted to map some device nodes PROT_EXEC. Given that we consider<br>
> > XDG_RUNTIME_DIR as a private version of /dev/shm among other things it<br>
> > really sounds wrong to break this right from the start.<br>
><br>
> ><br>
> > So, I am not really convinced I must say...<br>
> ><br>
> > Lennart<br>
> ><br>
><br>
><br>
><br>
> --<br>
> Leonid Isaev<br>
> GPG key fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D<br>
><br>
> _______________________________________________<br>
> systemd-devel mailing list<br>
> <a href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
><br>
</p>