<p dir="ltr"><br>
On Nov 12, 2013 6:16 AM, "Karel Zak" <<a href="mailto:kzak@redhat.com">kzak@redhat.com</a>> wrote:<br>
><br>
> On Fri, Nov 01, 2013 at 09:19:27AM -0700, Kok, Auke-jan H wrote:<br>
> > On Fri, Nov 1, 2013 at 12:57 AM, Karel Zak <<a href="mailto:kzak@redhat.com">kzak@redhat.com</a>> wrote:<br>
> > > On Thu, Oct 31, 2013 at 01:20:18PM -0700, Kok, Auke-jan H wrote:<br>
> > >> > BTW, for SELinux we remove selinux specific mount options in<br>
> > >> > userspace (in mount(8)) if the kernel does not support selinux.<br>
> > >> ><br>
> > >> > It help us to make command line or fstab setting independent on the<br>
> > >> > current kernel features.<br>
> > >> ><br>
> > >> > Maybe we can use the same for SMACK, is there any way how to<br>
> > >> > determine that the system uses SMACK? (/proc/<something> or so...).<br>
> > >> > -- for selinux we check for /sys/fs/selinux or /selinux.<br>
> > >><br>
> > >> Ohh yes that would be so nice.<br>
> > >><br>
> > >> You've got your choice for detecting smack, but I like<br>
> > >> stat(/sys/fs/smackfs) == 0 the best so far. You can parse<br>
> > >> /proc/filesystems for smackfs too, but that's obviously more complex.<br>
> > >> This method works with 3.9 and above, as that's when we made sysfs<br>
> > >> hold the mount point for smackfs.<br>
> > >><br>
> > >> I assume we're talking about this code here:<br>
> > >><br>
> > >> <a href="https://github.com/karelzak/util-linux/blob/master/libmount/src/context_mount.c#L181">https://github.com/karelzak/util-linux/blob/master/libmount/src/context_mount.c#L181</a><br>
> > ><br>
> > > Yes, the "se_rem" code (with SELinux is it tricky, because old<br>
> > > kernels don't support selinux options remount, options duplication is<br>
> > > problem etc.. I guess that for SMACK it will be less complex :-).<br>
> > ><br>
> > > Do you have somewhere list of the smack mount options? I'll prepare<br>
> > > the patch.<br>
> ><br>
> > Yes, the authoritative documentation is the code:<br>
> ><br>
> > <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/security/smack/smack.h#n143">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/security/smack/smack.h#n143</a><br>
><br>
><br>
> OK, implemented:<br>
> <a href="https://github.com/karelzak/util-linux/commit/b8095d25bae0588dfce8a62169f6db5496cf45c5">https://github.com/karelzak/util-linux/commit/b8095d25bae0588dfce8a62169f6db5496cf45c5</a><br>
><br>
> You have to compile util-linux with --with-smack.<br>
><br>
> It's trivial change, so I can backport it to the next stable release<br>
> v2.24.1 (at the end of this year). OK?</p>
<p dir="ltr">Awesome - looks good (with the typo fix) and we'll get this tested.</p>
<p dir="ltr">Thanks again!<br></p>
<p dir="ltr">Auke</p>