Commit Graph

63 Commits

Author SHA1 Message Date
Wenzong Fan
073ce40add initscripts/devpts.sh: fix context for /dev/pts
devpts use file_use_trans to allocate security contexts. As there are no
range_trans rules for initrc_t mounting devpts, the security level of
mountpoint will be derived from the initrc process, to be systemhigh
(s15:c0.c1023), instead of expected systemlow(s0).

This will block login shells to search PTYs, so use restorecon to fix
this.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-06-23 11:48:36 +08:00
Wenzong Fan
f48a8184d0 initscripts: add a local copy of devpts.sh
Start point to make SELinux specific changes in devpts.sh, copied from
oe-core layer.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-06-23 11:48:16 +08:00
Xin Ouyang
4d27a65186 util-linux: Use wildcard for version number in bbappend.
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-05-16 18:02:20 +08:00
Xin Ouyang
b18a8332b6 glib-2.0: Use wildcard for version number in bbappend.
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-05-16 18:01:58 +08:00
Xin Ouyang
cd7a45f733 dbus: Use wildcard for version number in bbappend.
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-05-16 18:01:33 +08:00
Jackie Huang
368f65a475 initscripts/checkroot.sh: restore file contexts for /run
The file contexts for /run is incorrect while running checkroot.sh
in boot time which causes mount fail to create new dir and file
in /run, so restore the security contexts in it.

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-05-09 08:59:54 -04:00
Wenzong Fan
bd3fb8a5cd udev init: restorecon for /dev/shm, /dev/pts
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-04-24 19:53:52 -04:00
Wenzong Fan
5596ca6e0e initscripts: always force to restore file contexts for /var/lib
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-04-24 19:53:41 -04:00
Philip Tricca
05a0c6c2d1 libcgroup: Use wildcard for version number in libcgroup bbappend.
Signed-off-by: Philip Tricca <flihp@twobit.us>

 create mode 100644 recipes-core/libcgroup/libcgroup_%.bbappend
 delete mode 100644 recipes-core/libcgroup/libcgroup_0.38.bbappend
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-02-12 19:15:32 -05:00
Philip Tricca
0e1d77dcc3 busybox: Use wildcard for version number in busybox bbappend.
Signed-off-by: Philip Tricca <flihp@twobit.us>

 create mode 100644 recipes-core/busybox/busybox_%.bbappend
 delete mode 100644 recipes-core/busybox/busybox_1.21.1.bbappend
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-02-12 19:15:31 -05:00
Wenzong Fan
3dc49f04c0 udev/init: sync to latest poky version ae819671
Sync with the latest init file from poky as of 01262014:

    oe-core commit: ae819671489a22bfdda11210ff620f564aa9b24b

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
2014-01-26 17:43:13 +08:00
Jackie Huang
5a36af9f91 udev: remove explicit path to udevadm
Oe-core has chnaged the udevadm path, current path will causes failure:
udevd[102]: starting version 182
/etc/rcS.d/S04udev: line 106: /usr/bin/udevadm: No such file or directory

Fix as oe-core commit: cc0f22cd1e93cc25647add1a3339e150572e4fce

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-01-23 18:00:08 +08:00
Mark Hatle
7cc4ee6c83 Resync to oe-core master Jan 10, 2014
Rename most recipes

Update a few recipes as needed:
* tar: Newer version has xattr and selinux support

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 13:55:59 -06:00
Philip Tricca
83081d1fdc glib-2.0: rename bbappend from 2.38.0 to 2.38.1
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-12-04 10:16:51 -05:00
Philip Tricca
ec09d839f9 glib-2.0: upgrade from version 2.36.4 to 2.38.0
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-21 15:43:34 -04:00
Xin Ouyang
521ca9c9cf busybox: alternatives link to sh wrappers for commands
While directly using busybox[.[no]suid] as the alternatives'
targets, commands could not get correct security labels.

 ~# ls -l /sbin/getty
 ..... /sbin/getty -> /bin/busybox.nosuid
 ~# ls -Z /bin/busybox.nosuid
 system_u:object_r:bin_t:s0 /bin/busybox.nosuid

Add sh wrappers for commands so selinux could work fine.

 ~# ls -l /sbin/getty
 ..... /sbin/getty -> /usr/lib/busybox/sbin/getty
 ~# ls -Z /usr/lib/busybox/sbin/getty
 system_u:object_r:getty_exec_t:s0 /usr/lib/busybox/sbin/getty
 ~# cat /usr/lib/busybox/sbin/getty
 #!/bin/busybox.nosuid

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:45 -04:00
Joe MacDonald
c7fc09794c udev/init: work around dev-cache restore problems
Restoring from the dev-cache with selinux enforcing causes various
failures as devices are lacking, at a minimum, reasonable types and
attributes.  If, on the other hand, we at least create the cache with
selinux and xattrs preserved and restored, we get significantly fewer
errors and warnings on boot and we can successfully restore the context
further down in init anyway.  It still leaves some devices mislabeled,
though, and still produces warnings on boot.

Previous versions of the initscript removed all use of the dev-cache,
if need be, we fall back to that.  It is possible to get the middle-ground
behaviour by defining use_udev_cache at the top of the udev initscript.

Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:45 -04:00
Mark Hatle
a43e03a87c udev/init: sync to latest poky version
[ CQID: WIND00424385 ]

Sync with the latest init file from poky as of 09172013.  Changes include:

	- adding /sbin/restorecon on start
	- specifying full path for /sbin/udevadm

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:45 -04:00
Xin Ouyang
c1dc285800 always force to restore file contexts in initscripts
In policycoreutils-2.13+, restorecon changes its default behaviour,
and does not restore context if the file' type is correct, even its
mcs/mls level is incorrect.
We should force it always to restore file contexts in initscripts to
avoid issues.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:44 -04:00
Xin Ouyang
c12d8f5c52 util-linux: uprev to oe-core version 2.23.2
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-08-22 13:00:26 +08:00
Xin Ouyang
4e84186b90 glib-2.0: uprev to oe-core version 2.36.4
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-08-22 12:59:06 +08:00
Mark Hatle
a530caf828 dbus/glib-2.0/augeas/mesa: Rebase bbappends to oe-core 20130801
Rebase the bbappends to match the current oe-core versions.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-08-02 00:08:14 +00:00
Mark Hatle
d5ea288351 tinylogin: No longer in oe-core, remove bbappend
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-08-01 15:54:23 -05:00
Xin Ouyang
d2ec36d9ac util-linux: uprev to 2.23.1 to fit oe-core
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-06-17 18:05:24 +08:00
Xin Ouyang
8d9b63e260 glib-2.0: uprev to 2.36.2 to fit oe-core
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-06-17 18:04:34 +08:00
Xin Ouyang
29659c19d7 glib-2.0: uprev to 2.36.1 to fit oe-core
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-05-13 10:50:59 +08:00
Xin Ouyang
0dfeb9260d coreutils: uprev to 8.21 to fit oe-core
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-04-01 11:04:19 +08:00
Xin Ouyang
439f31c81e initscript: append restorecon lines instead of a final script
Current meta-selinux provides a populate-volatile.sh for adding
restorecon lines to the oe-core script.

If other meta layers would add a new populate-volatile.sh, it will
override the oe-core and meta-selinux ones and cause selinux issues.
So append restorecon lines to the original script instead of a
final script.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-03-05 09:52:08 +08:00
Xin Ouyang
e558dba5db packages: uprev bbappends to fit oe-core
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-02-22 18:13:27 +08:00
Xin Ouyang
0f2d1bcd4d coreutils: inherit with-selinux
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-01-31 13:42:35 +08:00
Xin Ouyang
f11604ac92 glib-2.0: config option should be --enable-selinux
--with-selinux is consided as unrecognized option while
do_configure, so change it to --enable-selinux,

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-01-18 15:01:04 +08:00
Xin Ouyang
c6c13c4aa2 tinylogin: add passwd alternative
In meta-selinux layer, tinylogin links are installed as script
wrappers instead of symlinks to get their security labels.
So, they should use alternatives if there are same commands provided
by other packages.

passwd -> passwd.tinylogin
       -> passwd.shadow

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-01-07 18:07:00 +08:00
Xin Ouyang
44f43e02bd packages: inherit selinux
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-01-05 14:00:29 +08:00
Xin Ouyang
d95d951a0e packages: inherit with-selinux
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-01-05 14:00:24 +08:00
Xin Ouyang
5abfe148ef packages: inherit enable-selinux
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-01-05 13:42:22 +08:00
Xin Ouyang
1372e7b7d2 util-linux: fix build failures for version 2.22.1.
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-12-12 18:18:00 +08:00
Xin Ouyang
1c285bd0e7 libcgroup: remove the SRC_URI to fit oe-core
oe-core has fixed this by commit
    9a97367038a1e2431bf94211dabbc5aedbbee3bb

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-12-11 14:49:47 +08:00
Xin Ouyang
cd321edab3 glib-2.0,util-linux: uprev to oe-core version.
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-12-05 11:17:46 +08:00
Xin Ouyang
8fc66056eb libcgroup: fix hard coded /lib to ${base_libdir}
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-12-05 10:45:05 +08:00
Xin Ouyang
71bed4c424 glib-2.0/psmisc: uprev to oe-core version
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-11-27 10:20:14 +08:00
Xin Ouyang
731966a462 udev: uprev to oe-core version 182.
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-11-07 14:22:00 +08:00
Xin Ouyang
130f05b4e5 libcgroup: add bbappend and remove bb files
libcgroup is placed in oe-core now.
http://git.openembedded.org/openembedded-core/commit/?id=6ef8e6f2f9b0583fa0881e0dfc52462405b21ede

So remove bb files from meta-selinux and add bbappend.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-11-07 10:12:25 +08:00
Xin Ouyang
c8b060cb5d tinylogin: create script wrappers for selinux
Symlink can not execute will security contexts, so create script
wrappers for tinylogin commands instead of symlinks.

Also add tinylogin's login command as a alternative.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-10-18 11:07:44 +08:00
Xin Ouyang
6845442c3c udev: initscript restore security context for /dev
Poky/oe-core has set CONFIG_DEVTMPFS_MOUNT=y for kernel to mount
/dev with devtmpfs itself.

With MLS policy, kernel is running in s15:c0.c1023 level, so /dev
will be relabeled to this high level too.
This will cause processes running with low levels can not visit
/dev directory.

So, we just run restorecon /dev to fix this.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-10-18 11:07:44 +08:00
Xin Ouyang
0674df16fb initscripts: restorecon after populate-volatile
populate-volatile.sh creates new directories in /var/volatile/ while
booting, so we should restore the security contexts in it.
Also touch /var/log/lastlog to set correct security contexts.

populate-volatile.sh is imported for oe-core, and add these two
lines at the end.

touch /var/log/lastlog
test ! -x /sbin/restorecon || /sbin/restorecon -R /var/volatile/

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-10-18 11:07:44 +08:00
Xin Ouyang
3467300a26 glib-2.0: new version 2.32.4
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-07-19 15:04:54 +08:00
Xin Ouyang
d874dfce04 util-linux: uprev to 2.21.2
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-06-28 16:32:42 +08:00
Xiaofeng Yan
da160ef910 util-linux: Support selinux
Add the selinux support for util-linux.

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-06-25 10:18:34 +08:00
Xiaofeng Yan
df354a213e dbus:Support selinux
Add the selinux support for dbus.

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-06-25 10:18:03 +08:00
Xin Ouyang
5d0ff4989e udev: Build with selinux support.
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-06-20 17:47:23 +08:00