Commit graph

2974 commits

Author SHA1 Message Date
Jeff Vander Stoep
a7a85d9cda resolve merge conflicts of 7e29d177 to stage-aosp-master am: fe47ca9315 -s ours
am: 0569e8cfd6

Change-Id: I6d3b620725f0ab59cbb0ebcf085b87a0163a1f03
2017-07-10 04:48:06 +00:00
Jeff Vander Stoep
0569e8cfd6 resolve merge conflicts of 7e29d177 to stage-aosp-master
am: fe47ca9315  -s ours

Change-Id: I452d9cbd611332d8f9c2d4dc2ff3724197551b0c
2017-07-10 04:44:06 +00:00
Jeff Vander Stoep
fe47ca9315 resolve merge conflicts of 7e29d177 to stage-aosp-master
Test: build
Merged-In: If42b6cb1bf9ffb3dd04f557279efdc37e1ac259a
Change-Id: Ic30cc01f0abc26347d3747b51d1998f7815fea99
2017-07-10 00:17:43 +00:00
Jeff Vander Stoep
ebea86baf7 Merge changes from topic 'selinux-stage-merge' into stage-aosp-master am: e820c804c5 -s ours
am: 805ccb5cee  -s ours

Change-Id: Ifbfab8a4bc26e3e1aaf9d75c9766046c50051d9a
2017-07-08 04:58:29 +00:00
Jeff Vander Stoep
805ccb5cee Merge changes from topic 'selinux-stage-merge' into stage-aosp-master
am: e820c804c5  -s ours

Change-Id: Iba457d3e87ab1d6c7a55a1ed173f4b87bc002226
2017-07-08 04:55:59 +00:00
TreeHugger Robot
e820c804c5 Merge changes from topic 'selinux-stage-merge' into stage-aosp-master
* changes:
  sefcontext_compile: migrate to soong
  move file_context APIs out of libselinux_vendor
  Do not use PCRE2 in libselinux_vendor
  move selinux policy loading APIs to platform libselinux
  refactor: move common parts of libselinux builds into defaults
  Add libselinux_vendor
2017-07-08 04:52:32 +00:00
Jeff Vander Stoep
170cc72748 sefcontext_compile: migrate to soong
Bug: 37512442
Test: build and boot Marlin.
Test: "bpfmt -w Android.bp"

(cherry-pick from commit 16e4a8dab3)

Change-Id: I0c7b31ad55a89b5d94b0b9a76eacdf5c99869561
Merged-In: Ib5a0aa8eb29457e3191bad12229a0a4171daa6b6
2017-07-07 18:13:03 -07:00
Sandeep Patil
3a5f579d2d move file_context APIs out of libselinux_vendor
Also make sure label_file.c is compiled in all targets that libselinux
is built for.

Bug: 37343404
Bug: 37919668
Test: Build and boot

(cherry-pick from commit 554b7e4e82)

Change-Id: I19183fa192afb29ea75f40c0abf1e684b5550d2a
Merged-In: I49259c6cd6543329fe399fc92e07f16dc54c6395
2017-07-07 18:13:03 -07:00
Sandeep Patil
f1c7dca201 Do not use PCRE2 in libselinux_vendor
Also make sure regex.c is compiled for all targets that libselinux is
built for.

Bug: 37919668
Bug: 37343404
Test: Build and boot

(cherry-pick from commit a1b5897b8b)

Change-Id: I7eaf2733cdc0f8c72239fa6186e21bacc18b6d2f
Merged-In: Ie73cf85aeffcccb1a8bd1fcfafdd555678f9badc
2017-07-07 18:13:03 -07:00
Sandeep Patil
c102ca6452 move selinux policy loading APIs to platform libselinux
Bug: 37919668
Bug: 37343404
Test: build and boot

(cherry-pick from commit 43d548e365)

Change-Id: I43779180fdd00f430de0557860c6264543b018d6
Merged-In: If0de84db4052c86350001de11fc804d9daca1630
2017-07-07 18:13:03 -07:00
Sandeep Patil
64f6e81078 refactor: move common parts of libselinux builds into defaults
Bug: 37343404
Bug: 37919668
Test: Build and boot

(cherry-picked from commit 51428ba055)

Change-Id: I5e94788cac0c1574a74d75d9bd10589a760c4782
Merged-In: If42d24d381839c2a39f8cff3fc82ce5d3073eeb7
2017-07-07 18:13:02 -07:00
Vijay Venkatraman
96f9b254cd Add libselinux_vendor
Removed dependency on libpackageparser
Retained dependency on libpcre2

android_seapp.c = non-vendor functions
android.c = functions common to vendor and non-vendor

exported_vendor.map contains map for libselinux_vendor

(cherry-picked from commit cc1666de05)

Bug: 37343404
Test: Build vndservicemanager, libselinux.so and libselinux_vendor.so
Verify normal boot on sailfish and pass CTS Security

Change-Id: I3421d73b0f51bd714b5889fc3eef5b161dea9bac
Merged-In: I0ffc621ceb53b3531df458611f1322ebecd2da20
2017-07-07 18:12:36 -07:00
Martijn Coenen
f837f975d2 Add a method to load vendor_service_context only. am: 4b5cfdcd0a -s ours am: 5bea192056 -s ours
am: 6eb87ccb1b  -s ours

Change-Id: I665c8b831196b7c7c95329f1ccef13d91e0d316f
2017-07-07 19:27:13 +00:00
Sandeep Patil
7336e8b9df Do not use PCRE2 in libselinux_vendor am: 1006dc84a0 -s ours am: a721a7bb66
am: 9f49ef5f93  -s ours

Change-Id: I03cadd51acffe319efac36fa1cc242c7d0dd6d47
2017-07-07 19:27:09 +00:00
Sandeep Patil
9c0db45c29 move file_context APIs out of libselinux_vendor am: 73c8059639 -s ours am: 89f111d56a
am: fb296af0a3  -s ours

Change-Id: I75cf2e7b21be4265022e257f58bee8b471d6faad
2017-07-07 19:27:06 +00:00
Sandeep Patil
fd25739cd8 move selinux policy loading APIs to platform libselinux am: 5ec3b433ee -s ours am: 9e7258c260
am: 6bff5339bd  -s ours

Change-Id: I913a5cf624bd4841a40d84e44009c7dca0e7c063
2017-07-07 19:27:03 +00:00
Sandeep Patil
3e2db8f9d0 refactor: move common parts of libselinux builds into defaults am: f5addf2232 -s ours am: 0ccaf5bdd8
am: 16e62c8c2d  -s ours

Change-Id: Ibba5f40f7e90b30f7cc11d677a3b997b9d0c2834
2017-07-07 19:27:00 +00:00
Vijay Venkatraman
9309a5d323 Add libselinux_vendor am: 1c8c58625d -s ours am: 63bc32b848
am: ac68326ff0  -s ours

Change-Id: I63e46082c03071a049900ca155aea594061c7b93
2017-07-07 19:26:56 +00:00
Martijn Coenen
6eb87ccb1b Add a method to load vendor_service_context only. am: 4b5cfdcd0a -s ours
am: 5bea192056  -s ours

Change-Id: Ie2e4c56c0ea869b4c9e9cc052013c45d8f631ba4
2017-07-07 19:24:57 +00:00
Sandeep Patil
9f49ef5f93 Do not use PCRE2 in libselinux_vendor am: 1006dc84a0 -s ours
am: a721a7bb66

Change-Id: I38d65bcad2c6d4e051b7b50994ddef51c7886edd
2017-07-07 19:24:54 +00:00
Sandeep Patil
fb296af0a3 move file_context APIs out of libselinux_vendor am: 73c8059639 -s ours
am: 89f111d56a

Change-Id: I67516f552b2cf6a6ef23434ccffb11514718ec20
2017-07-07 19:24:51 +00:00
Sandeep Patil
6bff5339bd move selinux policy loading APIs to platform libselinux am: 5ec3b433ee -s ours
am: 9e7258c260

Change-Id: I0e6d6102d9c18069c74f171ebfa79b8923df9278
2017-07-07 19:24:48 +00:00
Sandeep Patil
16e62c8c2d refactor: move common parts of libselinux builds into defaults am: f5addf2232 -s ours
am: 0ccaf5bdd8

Change-Id: I7ebf23d8405622360beff2b473cef3237ed1dafa
2017-07-07 19:24:45 +00:00
Vijay Venkatraman
ac68326ff0 Add libselinux_vendor am: 1c8c58625d -s ours
am: 63bc32b848

Change-Id: I215479eba95b0a4a6e0190a1972ebf45b8e1c612
2017-07-07 19:24:41 +00:00
Martijn Coenen
5bea192056 Add a method to load vendor_service_context only.
am: 4b5cfdcd0a  -s ours

Change-Id: I1209f3c12a032f3ca259cdc60828a704dbeb4816
2017-07-07 19:22:56 +00:00
Sandeep Patil
a721a7bb66 Do not use PCRE2 in libselinux_vendor
am: 1006dc84a0  -s ours

Change-Id: I616162bc16774bf00118e3cf9be6b036430c01db
2017-07-07 19:22:53 +00:00
Sandeep Patil
89f111d56a move file_context APIs out of libselinux_vendor
am: 73c8059639  -s ours

Change-Id: Ia83495e606f4b0f7bd376bd6f9e9b58edfa63c1f
2017-07-07 19:22:50 +00:00
Sandeep Patil
9e7258c260 move selinux policy loading APIs to platform libselinux
am: 5ec3b433ee  -s ours

Change-Id: Iacbf110c95c84bbc51b4835639dd8ec29722c461
2017-07-07 19:22:47 +00:00
Sandeep Patil
0ccaf5bdd8 refactor: move common parts of libselinux builds into defaults
am: f5addf2232  -s ours

Change-Id: I491aac4504a825924ce1f8c047a3c2dd05c610fa
2017-07-07 19:22:43 +00:00
Vijay Venkatraman
63bc32b848 Add libselinux_vendor
am: 1c8c58625d  -s ours

Change-Id: I24c31918e48f68178762220d85bf3418480550b1
2017-07-07 19:22:40 +00:00
Yifan Hong
7e29d17754 Export dummy functions for libselinux_vendor
The following functions are exported in libselinux_vendor, but
simply returns an error:

selinux_android_prop_context_handle
selinux_android_restorecon

Bug: 62886649
Test: BOARD_VNDK_VERSION=current m libselinux_vendor -j
Test: m libselinux_vendor -j
Test: device boots
Change-Id: If42b6cb1bf9ffb3dd04f557279efdc37e1ac259a
Merged-In: If42b6cb1bf9ffb3dd04f557279efdc37e1ac259a
(cherry picked from commit 1e8760189d)
2017-07-07 17:22:11 +00:00
Martijn Coenen
4b5cfdcd0a Add a method to load vendor_service_context only.
This is used by vndservicemanager, which will only
have access to the vndservice_contexts on the vendor
partition.

Bug: 36052864
Test: vndservicemanager can load the context

(cherry-pick from commit 69e45cdfee)

Change-Id: I26ebf40906d6c56a3cfa4a20b731e101614fe6e6
Merged-In: Ifd5caa4f74236184ef970ce39a8be227c50b48d4
2017-07-06 14:56:19 -07:00
Sandeep Patil
1006dc84a0 Do not use PCRE2 in libselinux_vendor
Also make sure regex.c is compiled for all targets that libselinux is
built for.

Bug: 37919668
Bug: 37343404
Test: Build and boot

(cherry-pick from commit a1b5897b8b)

Change-Id: Ie73cf85aeffcccb1a8bd1fcfafdd555678f9badc
Merged-In: I6bcced2d3675899cf976ad3cd30e591539d2aaa1
2017-07-06 14:56:18 -07:00
Sandeep Patil
73c8059639 move file_context APIs out of libselinux_vendor
Also make sure label_file.c is compiled in all targets that libselinux
is built for.

Bug: 37343404
Bug: 37919668
Test: Build and boot

(cherry-pick from commit 554b7e4e82)

Change-Id: I49259c6cd6543329fe399fc92e07f16dc54c6395
Merged-In: I7e06ad6cad13d157ba1fb6bfd23ce9ceddf3ba79
2017-07-06 14:55:39 -07:00
Sandeep Patil
5ec3b433ee move selinux policy loading APIs to platform libselinux
Bug: 37919668
Bug: 37343404
Test: build and boot

(cherry-pick from commit 43d548e365)

Change-Id: If0de84db4052c86350001de11fc804d9daca1630
Merged-In: I3dd56e786ca25c314b5c6880587445e496db39a9
2017-07-06 14:55:39 -07:00
Sandeep Patil
f5addf2232 refactor: move common parts of libselinux builds into defaults
Bug: 37343404
Bug: 37919668
Test: Build and boot

(cherry-picked from commit 51428ba055)

Change-Id: If42d24d381839c2a39f8cff3fc82ce5d3073eeb7
Merged-In: I375a4a2926326a5f733f4a49348e1ffae086ffd6
2017-07-06 14:55:29 -07:00
Vijay Venkatraman
1c8c58625d Add libselinux_vendor
Removed dependency on libpackageparser
Retained dependency on libpcre2

android_seapp.c = non-vendor functions
android.c = functions common to vendor and non-vendor

exported_vendor.map contains map for libselinux_vendor

(cherry-picked from commit cc1666de05)

Bug: 37343404
Test: Build vndservicemanager, libselinux.so and libselinux_vendor.so
Verify normal boot on sailfish and pass CTS Security
Merged-In: I020b1333ad4628b831c94a27f07d880f73dbde7a

Change-Id: I0ffc621ceb53b3531df458611f1322ebecd2da20
2017-07-06 09:31:54 -07:00
Stephen Smalley
83fbc0979d Update VERSION files for 2.7-rc4 release.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-06-30 13:41:33 -04:00
Laurent Bigonville
57ac60769c Fix consistency of PYTHONLIBDIR variable across modules
PYTHONLIBDIR is currently also used in sepolgen but has a different
behaviour regarding DESTDIR. Let's try to make this consistant.

Signed-off-by: Laurent Bigonville <bigon@bigon.be>
2017-06-30 12:54:43 -04:00
Nicolas Iooss
1edb93c0ba Travis-CI: test defining CFLAGS, LDFLAGS, etc. on make command line
Some Makefiles rely on adding values to variables like CFLAGS,
LDFLAGS, etc. For example doing "LDFLAGS += -L../src" does not work fine
when LDFLAGS is defined on the command line of "make".

Commits 297877ab88 ("libselinux utils: override LD{FLAGS, LIBS} for
libselinux.so in Makefile") and 15f2740733 ("Makefiles: override
*FLAGS and *LIBS") recently fixed such issues, by introducing keyword
"override" in the relevant Makefile statements.

In order to prevent the fixed issues from appearing again, add a test
case in Travis-CI configuration file. This case adds on make's command
line minimal definitions for CFLAGS and LDFLAGS and empty definitions
for CPPFLAGS and LDLIBS.

An example of build failure due to a missing override in a required
CPPFLAGS addition is provided on
https://travis-ci.org/fishilico/selinux/builds/245107609

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2017-06-30 08:56:43 -04:00
Nicolas Iooss
6b9035ddc6 libsepol/tests: override CPPFLAGS too
A build toolchain may override CPPFLAGS on the command line of "make".
Doing so currently breaks libsepol/tests compilation, as it requires
"-I../include/ -I$(CHECKPOLICY)" to be provided in gcc's arguments.

This completes commit 15f2740733 ("Makefiles: override *FLAGS and
*LIBS").

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2017-06-30 08:56:43 -04:00
Nicolas Iooss
9a0279e9e9 Travis-CI: update the list of Ruby's and Python's versions
Travis-CI no longer provides Ruby 2.0 in its Trusty environment (it has
been updated according to
https://blog.travis-ci.com/2017-06-21-trusty-updates-2017-Q2-launch).
Remove this version from .travis.yml.

Moreover Python 3.6 and Ruby 3.4 are available. Test building with them.

Last by not least, pypy virtual environment directory has been renamed
pypy2 (/home/travis/virtualenv/pypy2 is a symbolic link to pypy2-5.6.0).

The updated .travis.yml file has been tested on
https://travis-ci.org/fishilico/selinux/builds/248126824

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2017-06-30 08:56:43 -04:00
Stephen Smalley
2d1a6c63c6 libselinux,libsemanage: fix RUBYLIBS definition
The RUBYLIBS definition introduced by commit f5b9bc2a06
("libselinux,libsemanage: link Ruby wrappers with -lruby") did
not work on Debian.  Fix it based on a patch by Nicolas Iooss.

Reported-by: Laurent Bigonville <bigon@debian.org>
Suggested-by: Nicolas Iooss <nicolas.iooss@m4x.org>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-06-28 09:35:57 -04:00
Brian Murray
004d5eb744 Improve selinux utils wrappers am: d72d78d969 am: 6ff047f744
am: bda8c317b2

Change-Id: I69c17fa27fd7e576217916d79695da5726242095
2017-06-26 22:12:25 +00:00
Brian Murray
bda8c317b2 Improve selinux utils wrappers am: d72d78d969
am: 6ff047f744

Change-Id: I2bdf37080f14684eff19d25a278410509626dcdb
2017-06-26 22:02:49 +00:00
Brian Murray
6ff047f744 Improve selinux utils wrappers
am: d72d78d969

Change-Id: I3beba3e041932d0e49b4261a689332c519d4e79b
2017-06-26 21:58:08 +00:00
Stephen Smalley
6fab7923ce Update VERSION files for 2.7-rc3 release.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-06-23 13:01:45 -04:00
Brian Murray
d72d78d969 Improve selinux utils wrappers
Added checks to wrapper scripts for selinux utils. Before running
commands, verify enviromental variables are set and that required files
exists. Return an error code in the event of failure.

Test: Verify audit2allow, audit2why, sediff, seinfo commands still run.
Test: Verify failure if prerequisites are not satisfied.

Change-Id: I3705a90e0a81704829aa5a5feedbfe22aec5fa55
Signed-off-by: Brian Murray <Brian@Clover.com>
2017-06-23 09:08:33 -07:00
Petr Lautrbach
43c0d1f889 mcstrans: Allow overriding libsepol.a location during build
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
2017-06-23 08:15:40 -04:00
Chih-Hung Hsieh
6b205d43e8 Add OWNERS in external/selinux am: e1ef2190d5 am: 2062c81d9f
am: 616bd37b00

Change-Id: I74f253b9f189d038c59d76d80ec0b23748112fd1
2017-06-22 21:15:18 +00:00