<feed xmlns='http://www.w3.org/2005/Atom'>
<title>replicant/core/init/subcontext.cpp, branch master</title>
<subtitle>Patches not merged yet, used for building and testing them
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/'/>
<entry>
<title>init: Use sepolicy version instead</title>
<updated>2018-05-04T07:21:14+00:00</updated>
<author>
<name>Logan Chien</name>
<email>loganchien@google.com</email>
</author>
<published>2018-05-03T06:33:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=c50144ef1d7ddebed3f765f176fa3a03d3d5f521'/>
<id>c50144ef1d7ddebed3f765f176fa3a03d3d5f521</id>
<content type='text'>
This commit uses vendor sepolicy file version (defined in
`/vendor/etc/selinux/plat_sepolicy_vers.txt`) to determine whether the
source context should be set as `u:r:vendor_init:s0`.

Before this commit, the criterion was `ro.vndk.version` &gt;= 28.  However,
the check in `property_service.cpp` will always be true because
`ro.vndk.version` hasn't been loaded from `/vendor/default.prop`.

Furthermore, under some circumstances, `ro.vndk.version` may be
different from `plat_sepolicy_vers.txt` (e.g. O-MR1 vendor does not
define `ro.vndk.version`).

Bug: 78605339  # high-level bug to combine O-MR1 and P GSI
Bug: 79135481  # the usage of `ro.vndk.version` in init
Test: vts-tradefed run vts -m VtsTrebleVintfTest  # tetheroffload
Change-Id: Ied46e9346b4ca7931aa4dcf1c9dbc11de0e12d93
Merged-In: Ied46e9346b4ca7931aa4dcf1c9dbc11de0e12d93
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit uses vendor sepolicy file version (defined in
`/vendor/etc/selinux/plat_sepolicy_vers.txt`) to determine whether the
source context should be set as `u:r:vendor_init:s0`.

Before this commit, the criterion was `ro.vndk.version` &gt;= 28.  However,
the check in `property_service.cpp` will always be true because
`ro.vndk.version` hasn't been loaded from `/vendor/default.prop`.

Furthermore, under some circumstances, `ro.vndk.version` may be
different from `plat_sepolicy_vers.txt` (e.g. O-MR1 vendor does not
define `ro.vndk.version`).

Bug: 78605339  # high-level bug to combine O-MR1 and P GSI
Bug: 79135481  # the usage of `ro.vndk.version` in init
Test: vts-tradefed run vts -m VtsTrebleVintfTest  # tetheroffload
Change-Id: Ied46e9346b4ca7931aa4dcf1c9dbc11de0e12d93
Merged-In: Ied46e9346b4ca7931aa4dcf1c9dbc11de0e12d93
</pre>
</div>
</content>
</entry>
<entry>
<title>init: do not impose vendor_init restrictions on old vendor images</title>
<updated>2018-04-12T22:33:15+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2018-04-11T22:50:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=125781255e34f0dd0973f22e30399ef0956d0e8b'/>
<id>125781255e34f0dd0973f22e30399ef0956d0e8b</id>
<content type='text'>
Do not restrict vendor_init restrictions on vendor images that were
built before P, as they will not have the correct permissions.

Bug: 77732028
Test: test new devices and see vendor_init still works
Merged-In: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
Change-Id: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
(cherry picked from commit a1dbeb8d338017715ae7747e5a7a3999a54e7213)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not restrict vendor_init restrictions on vendor images that were
built before P, as they will not have the correct permissions.

Bug: 77732028
Test: test new devices and see vendor_init still works
Merged-In: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
Change-Id: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
(cherry picked from commit a1dbeb8d338017715ae7747e5a7a3999a54e7213)
</pre>
</div>
</content>
</entry>
<entry>
<title>Restrict setting platform properties from vendor .prop files</title>
<updated>2018-03-01T19:17:07+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2018-02-28T18:39:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=dc375869abb56a0ef8ee1299443866da1e76abb6'/>
<id>dc375869abb56a0ef8ee1299443866da1e76abb6</id>
<content type='text'>
We should only allow vendor-init-settable properties to be set from
.prop files on /vendor and /odm.

Bug: 73905119
Test: test on walleye that disallowed properties are rejected
Change-Id: I2a5d244fdc71060ddda3e3d87442e831e6b97831
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We should only allow vendor-init-settable properties to be set from
.prop files on /vendor and /odm.

Bug: 73905119
Test: test on walleye that disallowed properties are rejected
Change-Id: I2a5d244fdc71060ddda3e3d87442e831e6b97831
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up property set error handling</title>
<updated>2018-03-01T19:14:02+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2018-03-01T19:00:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=69d47aa829fa5a48baeadeff0e04d03e58f147b7'/>
<id>69d47aa829fa5a48baeadeff0e04d03e58f147b7</id>
<content type='text'>
Currently we only report why a property set call has failed but drop
the context of what was trying to set the property.  This change
adds information about why a property was trying to be set when it
fails.

It also unifies property_set() within init to go through the same
HandlePropertySet() function as normal processes do, removing unneeded
special cases.

Test: boot bullhead
Test: attempt to set invalid properties and see better error messages
Change-Id: I5cd3a40086fd3b226e9c8a5e3a84cb3b31399c0d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently we only report why a property set call has failed but drop
the context of what was trying to set the property.  This change
adds information about why a property was trying to be set when it
fails.

It also unifies property_set() within init to go through the same
HandlePropertySet() function as normal processes do, removing unneeded
special cases.

Test: boot bullhead
Test: attempt to set invalid properties and see better error messages
Change-Id: I5cd3a40086fd3b226e9c8a5e3a84cb3b31399c0d
</pre>
</div>
</content>
</entry>
<entry>
<title>init: add host side parser for init</title>
<updated>2018-02-28T18:45:45+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2018-02-14T00:50:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=de6bd50d4238d19ec401127bcf2321dc679d908d'/>
<id>de6bd50d4238d19ec401127bcf2321dc679d908d</id>
<content type='text'>
Create a host side parser for init such that init rc files can be
verified for syntax correctness before being used on the device.

Bug: 36970783
Test: run the parser on init files on host

Change-Id: I7e8772e278ebaff727057308596ebacf28b6fdda
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Create a host side parser for init such that init rc files can be
verified for syntax correctness before being used on the device.

Bug: 36970783
Test: run the parser on init files on host

Change-Id: I7e8772e278ebaff727057308596ebacf28b6fdda
</pre>
</div>
</content>
</entry>
<entry>
<title>Make vendor_init check SELinux before setting properties</title>
<updated>2018-01-22T18:20:56+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2018-01-19T00:14:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=32228485ffac6ff0b674210be448b121bbd6427c'/>
<id>32228485ffac6ff0b674210be448b121bbd6427c</id>
<content type='text'>
Finishing a TODO from vendor_init, check SELinux permissions before
setting properties in vendor_init.

Bug: 62875318
Test: N/A
Change-Id: I3cb6abadd2613ae083705cc6b9c970587b6c6b19
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Finishing a TODO from vendor_init, check SELinux permissions before
setting properties in vendor_init.

Bug: 62875318
Test: N/A
Change-Id: I3cb6abadd2613ae083705cc6b9c970587b6c6b19
</pre>
</div>
</content>
</entry>
<entry>
<title>init: always expand args in subcontext</title>
<updated>2018-01-12T18:35:26+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2018-01-10T19:04:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=c49719fc5d2cf3817f6997ce40fc2dac7d411efa'/>
<id>c49719fc5d2cf3817f6997ce40fc2dac7d411efa</id>
<content type='text'>
Currently init expands properties in arguments only when those
commands are run in a subcontext.  This creates a hole where
properties that should not be accessible from a given subcontext of
init can be accessed when running a command in the main init
executable (for example `start`).

This change creates a callback in subcontext init that simply expands
and returns arguments back to the main init process, to ensure that
only those properties that a subcontext can access get expanded.

Bug: 62875318
Test: boot bullhead, new unit tests
Change-Id: I2850009e70da877c08e4cc83350c727b0ea98796
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently init expands properties in arguments only when those
commands are run in a subcontext.  This creates a hole where
properties that should not be accessible from a given subcontext of
init can be accessed when running a command in the main init
executable (for example `start`).

This change creates a callback in subcontext init that simply expands
and returns arguments back to the main init process, to ensure that
only those properties that a subcontext can access get expanded.

Bug: 62875318
Test: boot bullhead, new unit tests
Change-Id: I2850009e70da877c08e4cc83350c727b0ea98796
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "init: use ro.init.subcontexts_enabled to enable subcontexts"</title>
<updated>2017-11-27T17:03:28+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-11-27T17:02:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=193e43494f8afffaa1098690f1d249a3e61f2d43'/>
<id>193e43494f8afffaa1098690f1d249a3e61f2d43</id>
<content type='text'>
This reverts commit 79193a42e7aa5760a6f98c0718e3d70c560d0e8e.

Bug: 62875318
Test: boot walleye, sailfish without SELinux audits
Change-Id: I019b66a3130acba2c07e984e4bc352228f09d7f5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 79193a42e7aa5760a6f98c0718e3d70c560d0e8e.

Bug: 62875318
Test: boot walleye, sailfish without SELinux audits
Change-Id: I019b66a3130acba2c07e984e4bc352228f09d7f5
</pre>
</div>
</content>
</entry>
<entry>
<title>init: add SelabelInitialize() for subcontext</title>
<updated>2017-10-19T23:25:45+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-10-19T21:39:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=0d1452ee1b2fb137e175064f4b84b1db8dde6487'/>
<id>0d1452ee1b2fb137e175064f4b84b1db8dde6487</id>
<content type='text'>
Children of init that use any of the SELinux wrapper functions,
including make_dir(), mkdir_recursive(), and plenty others, need to
first initialize the sehandle with SelabelInitialize().

I wish there were a better solution, but early init doesn't actually
want this handle initialized, so that is a valid use case.  Ueventd
needs to initialize this before fork()'ing, so lazy initialization is
not universally acceptable either.  Likely we won't have other
children that fork() then exec() init again, so this should be okay.

Bug: 62875318

Test: init unit tests
Test: sailfish creates directories with correct SELabel after wipe
Change-Id: I6de937604a060e18945427418f15b90e0b9d5c37
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Children of init that use any of the SELinux wrapper functions,
including make_dir(), mkdir_recursive(), and plenty others, need to
first initialize the sehandle with SelabelInitialize().

I wish there were a better solution, but early init doesn't actually
want this handle initialized, so that is a valid use case.  Ueventd
needs to initialize this before fork()'ing, so lazy initialization is
not universally acceptable either.  Likely we won't have other
children that fork() then exec() init again, so this should be okay.

Bug: 62875318

Test: init unit tests
Test: sailfish creates directories with correct SELabel after wipe
Change-Id: I6de937604a060e18945427418f15b90e0b9d5c37
</pre>
</div>
</content>
</entry>
<entry>
<title>init: use ro.init.subcontexts_enabled to enable subcontexts</title>
<updated>2017-10-06T17:37:09+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-10-06T17:36:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=79193a42e7aa5760a6f98c0718e3d70c560d0e8e'/>
<id>79193a42e7aa5760a6f98c0718e3d70c560d0e8e</id>
<content type='text'>
As SEPolicy is developed, use this property to enable/disable
subcontexts.

Bug: 62875318
Test: boot device with/without subcontexts
Change-Id: Ieb879836a71c72d4de1bb16514d083d52480bf9a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As SEPolicy is developed, use this property to enable/disable
subcontexts.

Bug: 62875318
Test: boot device with/without subcontexts
Change-Id: Ieb879836a71c72d4de1bb16514d083d52480bf9a
</pre>
</div>
</content>
</entry>
</feed>
