Commit Graph

330 Commits

Author SHA1 Message Date
Xin Ouyang
2fb68f414c psmisc: inherit enable-selinux and backport to fix build issue
(From meta-selinux master rev: 3fee4a09cc)

Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-13 10:00:51 -06:00
Xin Ouyang
5a0e768af2 audit: the ldap option should be "--without-ldap"
(From meta-selinux master rev: 5671f38227)

Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-13 10:00:35 -06:00
Wenzong Fan
3f6573f773 refpolicy: fix real path for udevd
In Yocto the real path for udevd is /lib/udev/udevd, this patch fixes
the init issues like:

udevd[87]: setfilecon /dev/vcsa2 failed: Operation not permitted
udevd[89]: setfilecon /dev/fb0 failed: Operation not permitted

(From meta-selinux master rev: d226887b90)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:55:41 -06:00
Wenzong Fan
725dcddfc2 policycoreutils: fix QA issues
ERROR: QA Issue: policycoreutils: Files/directories were installed \
but not shipped
  /usr/share/icons/hicolor/24x24/apps/system-config-selinux.png
  /usr/share/bash-completion/completions/setsebool
  /usr/share/bash-completion/completions/sepolicy
  /usr/share/bash-completion/completions/semanage
  /usr/share/dbus-1/system-services/org.selinux.service
  /usr/share/polkit-1/actions/org.selinux.config.policy
  /usr/share/polkit-1/actions/org.selinux.policy

(From meta-selinux master rev: 9dafd6cb30)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:55:24 -06:00
Wenzong Fan
146bd8c6bc libsemanage: add audit dependency
Building libsemanage 2.2 need the header libaudit.h.

(From meta-selinux master rev: d297ea1fb1)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:55:10 -06:00
Wenzong Fan
9cdd0a9727 sepolgen: migrate SRC_URI to 1.2.1
(From meta-selinux master rev: a4fb1cec4d)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:54:56 -06:00
Wenzong Fan
50ae9d2527 policycoreutils: migrate SRC_URI and patches to 2.2.5
This patch is removed since it is merged by new version:
 - policycoreutils-fix-strict-prototypes.patch

These two patches are updated:
 - policycoreutils-fix-sepolicy-install-path.patch
 - policycoreutils-make-O_CLOEXEC-optional.patch

(From meta-selinux master rev: e19c88195b)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:54:40 -06:00
Wenzong Fan
a536b4b603 libsepol: migrate SRC_URI to 2.2
Removed patch and ported changes to 2.2 bbfile:
 - libsepol-Change-ranlib-for-cross-compiling.patch

(From meta-selinux master rev: fd8729d82d)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:54:25 -06:00
Wenzong Fan
2464c3c9ea libsemanage: migrate SRC_URI to 2.2
Updated patch:
 - libsemanage-fix-path-nologin.patch

(From meta-selinux master rev: 9bd03e1bdd)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:54:09 -06:00
Wenzong Fan
5f8eb4f68e libselinux: migrate SRC_URI and patches to 2.2
These two patches are removed since they are merged by new version:
 - libselinux-fix-init-load-policy.patch
 - libselinux-pcre-link-order.patch

(From meta-selinux master rev: f04f030a1d)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:53:50 -06:00
Wenzong Fan
7281cd0bef checkpolicy: migrate SRC_URI to 2.2
(From meta-selinux master rev: a4b25c05a1)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:53:33 -06:00
Wenzong Fan
65723adfa0 selinux userspace: uprev packages to release 20131030
Upreved packages:
 - checkpolicy to 2.2
 - libselinux to 2.2
 - libsemanage to 2.2
 - libsepol to 2.2
 - policycoreutils to 2.2.5
 - sepolgen to 1.2.1

Migrate patches in next commits.

(From meta-selinux master rev: dc3cd6149c)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:53:17 -06:00
Philip Tricca
6ba7ead70b policycoreutils: Patch Makefile to get load_policy symlink right.
Setting DESTDIR in the policycoreutils do_install creates a bad
symlink for load_policy. This patch fixes up the Makefile to
create the symlink relative to DESTDIR.

(From meta-selinux master rev: f5e042c80a)

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:53:02 -06:00
Joe MacDonald
1390116ce9 policy: Create compressed_policy distro feature
There is a small cost to having compressed policy files on the final
image both in terms of memory requirements and load times.  In nearly all
circumstances this is negligible, but this adds a DISTRO_FEATURE that
can be used to enable it, if desired.

The default selinux distros will enable the feature by default.

(From meta-selinux master rev: 2209cb5fc2)

Signed-off-by: Joe MacDonald <joe@deserted.net>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:52:46 -06:00
Philip Tricca
765c66a23e bzip SELinux policy modules in ${datadir}
The 'semodule' utility can operate on compresed modules so the only
cost of this change is a slower module load time when invoking
'semodule -i' on a running system (increased CPU load due to bzip2).
That said my tests show more than 100M reduction in ext3 image size
of core-image-selinux. This last metric is a bit skewed as the image
includes two policies. Still, a reduction in the size of the refpolicy
package by 1/2 is significant.

(From meta-selinux master rev: d549fef3f4)

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2014-01-10 14:52:11 -06:00
Mark Hatle
baa3df0b71 Revert "glib-2.0: upgrade from version 2.36.4 to 2.38.0"
This reverts commit ec09d839f9.

This version is not in dora.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-11-14 19:30:29 +00:00
Joe MacDonald
0e405f9826 libselinux / libsemanage: work around FD_CLOEXEC and SOCK_CLOEXEC absence
[ CQID: WIND00438478 ]
[ CQID: WIND00439485 ]

Turns out some of the truly old hosts don't even really recognize
FD_CLOEXEC and most of the older ones don't know about SOCK_CLOEXEC.  Work
around each (define FD_CLOEXEC to something sensible, simply don't use
SOCK_CLOEXEC, produce warnings in either event).

Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-11-14 19:28:12 +00:00
Joe MacDonald
7b14231741 libselinux / policycoreutils: optional O_CLOEXEC
[ CQID: WIND00438478 ]

We still have hosts that pre-date the inclusion of O_CLOEXEC (Linux
2.6.23) so compile the flag out when building on classic distros.

Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2013-11-14 19:24:06 +00:00
Philip Tricca
523931e2b9 refpolicy-standard: Use default variables from refpolicy_common.inc
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-11-06 09:13:59 -05:00
Philip Tricca
36dc971f72 refpolicy-mls: Use default variables from refpolicy_common.inc
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-11-06 09:13:59 -05:00
Philip Tricca
f52a9dbf22 refpolicy-mcs: Use default variables from refpolicy_common.inc
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-11-06 09:13:58 -05:00
Philip Tricca
b3ac5fb39f Move common POLICY_* variables to refpolicy_common.inc
Use default assignment to allow variables to be overriden by recipes
that include refpolicy_common.inc

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-11-06 09:13:52 -05:00
Philip Tricca
52e1393075 Add recipe to build the MCS refpolicy.
This is the default policy type used by most (all?) distros that
support SELinux.

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-30 10:05:18 -04:00
Joe MacDonald
dfdf551481 audit: address x-compile issues
The previous approach works well for modern hosts but older ones still
require the pre-gen'd header files to behave nicely in a x-compile
environment.  So we generate them, patch them in and remove the bits of
the Makefile that may take it upon itself to re-gen them again.

Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-23 21:25:03 -04: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
Philip Tricca
a99b419439 Add packagegroup for policycoreutils packages.
The policycoreutils package previously included most everything in
the base package. This packagegroup is intended to fill the role
of the old policycoreutils package and pull in all packages from the
policycoreutils recipe.

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-15 14:31:17 -04:00
Philip Tricca
8c2e551a7c Add packagegroup and image recipe for minimal SELinux image.
This is intended to demonstrate the minimal set packages necessary
to boot and load a system with SELinux enabled. Specifically we
don't need any of the packages that depend on python.

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-15 14:31:17 -04:00
Philip Tricca
0e35edc4ee Remove runtime dependency on policycoreutils from the reference policy.
The only thing refpol needs to depend on at runtime are the things
necessary to load the policy.  If sysvinit is patched to load the
policy (which it is) then we only need the config.

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-15 14:31:17 -04:00
Philip Tricca
f3b81f49fa Remove unnecessary RDEPENDS_${BPN}.
Now that the policycoreutuils package is empty no need for RDEPENDS.
Doing this in the commit that broke up the policycoreutuils package
made the diff hard to read. Figured it best to break it out for
readability.

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-15 14:31:17 -04:00
Philip Tricca
2da0c93c65 Break policycoreutils out into separate packages for the various utilities.
The driver beind this is to allow images to be built with the minimal
tools necessary to load a policy.  Breaking all of the stuff that's
dependent on python out from the core utils allows us to make much
smaller images.

Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-15 14:31:15 -04:00
Mark Hatle
392a44eeb6 policycoreutils: avoid shell for checking target-special actions
do_install was modified to only do the special actions in the target case,
instead of using shell to check what mode we were running in.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:46 -04:00
Mark Hatle
212b3d0822 setools: Uprev setools
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:46 -04:00
Mark Hatle
19dfedb322 README: Update status
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:46 -04:00
Mark Hatle
9e2214078f libcap-ng: Uprev libcap-ng
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:46 -04:00
Mark Hatle
6c77455bdb audit: Uprev to audit 2.3.2
Refactor the audit cross compiling patch.  The new patch might have some minor
host dependencies.  If so, let me know!

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:46 -04:00
Mark Hatle
2ed614a153 swig: Update to latest swig from meta-openembedded
Updated from:
 git://git.openembedded.org/meta-openembedded/meta-oe/recipes-devtools/swig

 As of commit 1d536390dcafe4d539335dec2173aa9ddc3d8b51

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
Mark Hatle
407e6a7fe0 python-ipy: Uprev to latest 0.81 version
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
Mark Hatle
03a52a7f12 distro/*: Update the distro files
Make the oe-selinux.conf the base configuration file.

Ensure that we enable acl and xattr support as well.

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
Christopher Larson
637094b9f9 layer.conf: avoid unnecessary early expansion with :=
bitbake handles immediate expansions of LAYERDIR for us automatically.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:45 -04:00
Qiang Chen
2e7fb736e1 selinux: remove reference to locale env files from login
[ CQID: WIND00425413 ]

pam.d/login refered to the /etc/default/locale env file.

This file is not used in oe-core/Poky.

Remove the this reference to avoid error messages in auth.log.

Signed-off-by: Qiang Chen <qiang.chen@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
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
Mark Hatle
479c9803f0 linux-yocto: Add support for the 3.10 kernel
Also update the selinux.cfg file to add ext4, jfs, and jffs2 support.

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
3342d1edcf kernel: add BBAPPEND for linux 3.10
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
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
Xin Ouyang
20153c8810 refpolicy*: remove old version recipes and patches.
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
Xin Ouyang
292e6f4ac6 refpolicy*: add new version 2.20130424
These patches are removed because new version merged:
 - poky-fc-update-alternatives_tinylogin.patch
 - poky-fc-fix-prefix-path_rpc.patch
 - poky-fc-fix-portmap.patch
 - poky-fc-cgroup.patch
 - poky-fc-networkmanager.patch
 - poky-policy-allow-dbusd-to-setrlimit-itself.patch
 - poky-policy-allow-dbusd-to-exec-shell-commands.patch
 - poky-policy-allow-nfsd-to-bind-nfs-port.patch

Add two new patches:
 + poky-policy-fix-setfiles-statvfs-get-file-count.patch
 + poky-policy-fix-dmesg-to-use-dev-kmsg.patch

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
1f548372c5 policycoreutils: fix wrong newrole/run_init pam config
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
01e187215c sepolgen: migrate SRC_URI to 1.1.9
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