core/mount-setup.c: also relabel /dev/shm for selinux (#3039)

daemons, which wish to transition state from the initramfs to the real
root, might use /dev/shm for their state.

As /dev is not relabeled across mount points, /dev/shm has to be
relabled explicitly.
This commit is contained in:
Harald Hoyer 2016-04-15 01:14:29 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent d57a7ed5ea
commit cacf980ed4

View file

@ -375,6 +375,7 @@ int mount_setup(bool loaded_policy) {
before_relabel = now(CLOCK_MONOTONIC);
nftw("/dev", nftw_cb, 64, FTW_MOUNT|FTW_PHYS|FTW_ACTIONRETVAL);
nftw("/dev/shm", nftw_cb, 64, FTW_MOUNT|FTW_PHYS|FTW_ACTIONRETVAL);
nftw("/run", nftw_cb, 64, FTW_MOUNT|FTW_PHYS|FTW_ACTIONRETVAL);
after_relabel = now(CLOCK_MONOTONIC);