[systemd-devel] [PATCH] Do not cache use_smack() value unless /sys is mounted
Lennart Poettering
lennart at poettering.net
Mon Mar 24 13:07:23 PDT 2014
On Fri, 14.03.14 09:35, Łukasz Stelmach (l.stelmach at samsung.com) wrote:
> It was <2014-03-11 wto 05:12>, when Lennart Poettering wrote:
> > On Fri, 28.02.14 17:09, Łukasz Stelmach (l.stelmach at samsung.com) wrote:
> >
> >> use_smack() is called very early via mkdir_p_label(). This happens
> >> before /sys is mounted and hence before the authoritative information
> >> about smack is even available. To prevent caching of the invalid value
> >> check whether /sys/fs exists.
> >
> > Hmm, it appears to me that we probably shouldn't invoke mkdir_p_label()
> > that early? Do you know which invocation this is?
>
> mount_one() called from mount_setup_early() at src/core/mount-setup.c
>
> > It sounds really wrong trying to relabel a dir before the policy is
> > actually loaded...
>
> mount_one() is used for both mount_setup() and mount_setup_early() and
> distinguishing them would look odd.
We already pass the bool for that around anyway... I have now made a
change to use either mkdir_p or mkdir_p_label() depending on that
flag. Can you check if this fixes the issue for you?
Thanks,
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list