<feed xmlns='http://www.w3.org/2005/Atom'>
<title>replicant/core/init/descriptors.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: cleanup environment handling</title>
<updated>2017-08-23T17:09:21+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-08-22T22:41:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=6de21f11125941ea1b94fdeec754bacea3916fd5'/>
<id>6de21f11125941ea1b94fdeec754bacea3916fd5</id>
<content type='text'>
Init keep its own copy of the environment that it uses for execve when
starting services.  This is unnecessary however as libc already has
functions that mutate the environment and the environment that init
uses is clean for starting services.  This change removes init's copy
of the environment and uses the libc functions instead.

This also makes small clean-up to the way the Service class stores
service specific environment variables.

Test: boot bullhead
Change-Id: I7c98a0b7aac9fa8f195ae33bd6a7515bb56faf78
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Init keep its own copy of the environment that it uses for execve when
starting services.  This is unnecessary however as libc already has
functions that mutate the environment and the environment that init
uses is clean for starting services.  This change removes init's copy
of the environment and uses the libc functions instead.

This also makes small clean-up to the way the Service class stores
service specific environment variables.

Test: boot bullhead
Change-Id: I7c98a0b7aac9fa8f195ae33bd6a7515bb56faf78
</pre>
</div>
</content>
</entry>
<entry>
<title>init: split security functions out of init.cpp</title>
<updated>2017-08-14T18:07:27+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-08-10T19:22:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=c317009410b9db48366d3eb85a5a18f0d1831048'/>
<id>c317009410b9db48366d3eb85a5a18f0d1831048</id>
<content type='text'>
This change splits out the selinux initialization and supporting
functionality into selinux.cpp and splits the security related
initialization of the rng, etc to security.cpp.  It also provides
additional documentation for SEPolicy loading as this has been
requested by some teams.

It additionally cleans up sehandle and sehandle_prop.  The former is
static within selinux.cpp and new wrapper functions are created around
selabel_lookup*() to better serve the users.  The latter is moved to
property_service.cpp as it is isolated to that file for its usage.

Test: boot bullhead
Merged-In: Idc95d493cebc681fbe686b5160502f36af149f60
Change-Id: Idc95d493cebc681fbe686b5160502f36af149f60
(cherry picked from commit 9afb86b25d8675927cb37c86119a7ecf19f74819)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change splits out the selinux initialization and supporting
functionality into selinux.cpp and splits the security related
initialization of the rng, etc to security.cpp.  It also provides
additional documentation for SEPolicy loading as this has been
requested by some teams.

It additionally cleans up sehandle and sehandle_prop.  The former is
static within selinux.cpp and new wrapper functions are created around
selabel_lookup*() to better serve the users.  The latter is moved to
property_service.cpp as it is isolated to that file for its usage.

Test: boot bullhead
Merged-In: Idc95d493cebc681fbe686b5160502f36af149f60
Change-Id: Idc95d493cebc681fbe686b5160502f36af149f60
(cherry picked from commit 9afb86b25d8675927cb37c86119a7ecf19f74819)
</pre>
</div>
</content>
</entry>
<entry>
<title>init: create android::init:: namespace</title>
<updated>2017-06-23T20:21:20+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-06-22T19:53:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=81f5d3ebef2c3789737bf718fc2a2cdd7b9e8b33'/>
<id>81f5d3ebef2c3789737bf718fc2a2cdd7b9e8b33</id>
<content type='text'>
With some small fixups along the way

Test: Boot bullhead
Test: init unit tests
Change-Id: I7beaa473cfa9397f845f810557d1631b4a462d6a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With some small fixups along the way

Test: Boot bullhead
Test: init unit tests
Change-Id: I7beaa473cfa9397f845f810557d1631b4a462d6a
</pre>
</div>
</content>
</entry>
<entry>
<title>init: cleanup some string usage</title>
<updated>2017-06-23T00:24:22+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-06-22T23:50:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=1c3a53f03ca3c2c647f83cd8b8ae7e18c5c7bc69'/>
<id>1c3a53f03ca3c2c647f83cd8b8ae7e18c5c7bc69</id>
<content type='text'>
1) property_set() takes const std::string&amp; for both of its arguments,
   so stop using .c_str() with its parameters
2) Simplify a few places where StringPrintf() is used to concatenate strings
3) Use std::to_string() instead of StringPrintf() where it's better suited

Test: Boot bullhead
Test: init unit tests
Change-Id: I68ebda0e469f6230c8f9ad3c8d5f9444e0c4fdfd
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1) property_set() takes const std::string&amp; for both of its arguments,
   so stop using .c_str() with its parameters
2) Simplify a few places where StringPrintf() is used to concatenate strings
3) Use std::to_string() instead of StringPrintf() where it's better suited

Test: Boot bullhead
Test: init unit tests
Change-Id: I68ebda0e469f6230c8f9ad3c8d5f9444e0c4fdfd
</pre>
</div>
</content>
</entry>
<entry>
<title>init: add "+passcred" for socket to set SO_PASSCRED</title>
<updated>2017-05-08T21:04:13+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2017-05-05T21:44:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=b066fccc5c977f3e464676d58a7fa550d368f426'/>
<id>b066fccc5c977f3e464676d58a7fa550d368f426</id>
<content type='text'>
In the init scripts for socket, the type can have a suffix of
"+passcred" to request that the socket be bound to report SO_PASSCRED
credentials as part of socket transactions.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics right after boot
      (fails without logd.rc change)
Bug: 37985222
Change-Id: Ie5b50e99fb92fa9bec9a32463a0e6df26a968bfd
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the init scripts for socket, the type can have a suffix of
"+passcred" to request that the socket be bound to report SO_PASSCRED
credentials as part of socket transactions.

Test: gTest logd-unit-tests --gtest_filter=logd.statistics right after boot
      (fails without logd.rc change)
Bug: 37985222
Change-Id: Ie5b50e99fb92fa9bec9a32463a0e6df26a968bfd
</pre>
</div>
</content>
</entry>
<entry>
<title>ueventd: do not reference init's sehandle</title>
<updated>2017-05-02T00:22:49+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-05-02T00:10:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=e7656b7200d934d6f77df422d6d3dee469230dea'/>
<id>e7656b7200d934d6f77df422d6d3dee469230dea</id>
<content type='text'>
Init exposes a global 'sehandle' that ueventd references as part of
devices.cpp and util.cpp.  This is particularly dangerous in
device_init() in which both uevent and init write to this global.

This change creates a separate local copy for devices.cpp and puts
restrictions on where init.h can be included to make sure the global
used by init is not reference by non-init code.  Future changes to
init should remove this global.

Test: Boot bullhead

Change-Id: Ifefa9e1932e9d647d06cca2618f5c8e5a7a85460
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Init exposes a global 'sehandle' that ueventd references as part of
devices.cpp and util.cpp.  This is particularly dangerous in
device_init() in which both uevent and init write to this global.

This change creates a separate local copy for devices.cpp and puts
restrictions on where init.h can be included to make sure the global
used by init is not reference by non-init code.  Future changes to
init should remove this global.

Test: Boot bullhead

Change-Id: Ifefa9e1932e9d647d06cca2618f5c8e5a7a85460
</pre>
</div>
</content>
</entry>
<entry>
<title>init: more header cleanup</title>
<updated>2017-04-07T01:06:34+00:00</updated>
<author>
<name>Tom Cherry</name>
<email>tomcherry@google.com</email>
</author>
<published>2017-04-06T23:30:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=3f5eaae526413a29de899270714469c76dc91ec8'/>
<id>3f5eaae526413a29de899270714469c76dc91ec8</id>
<content type='text'>
Remove includes of "log.h" that really want &lt;android-base/logging.h&gt;
Fix header include order
Remove headers included in .cpp files that their associated .h already includes
Remove some unused headers

Test: boot bullhead
Change-Id: I2b415adfe86a5c8bbe4fb1ebc53c7b0ee2253824
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove includes of "log.h" that really want &lt;android-base/logging.h&gt;
Fix header include order
Remove headers included in .cpp files that their associated .h already includes
Remove some unused headers

Test: boot bullhead
Change-Id: I2b415adfe86a5c8bbe4fb1ebc53c7b0ee2253824
</pre>
</div>
</content>
</entry>
<entry>
<title>init: service file command only opens existing files</title>
<updated>2016-12-05T19:26:39+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2016-12-02T16:05:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=978fd0ea254f11f84e38b41a74bbe70c81edc197'/>
<id>978fd0ea254f11f84e38b41a74bbe70c81edc197</id>
<content type='text'>
Mixing open or create, along with attribute(MAC) and permissions(DAC)
is a security and confusion issue.

Fix an issue where fcntl F_SETFD was called to clear O_NONBLOCK, when
it should have been F_SETFL.  Did not present a problem because the
current user of this feature does writes and control messages only.

Test: gTest logd-unit-tests and check dmesg for logd content.
Bug: 32450474
Bug: 33242020
Change-Id: I23cb9a9be5ddb7e8e9c58c79838bc07536e766e6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mixing open or create, along with attribute(MAC) and permissions(DAC)
is a security and confusion issue.

Fix an issue where fcntl F_SETFD was called to clear O_NONBLOCK, when
it should have been F_SETFL.  Did not present a problem because the
current user of this feature does writes and control messages only.

Test: gTest logd-unit-tests and check dmesg for logd content.
Bug: 32450474
Bug: 33242020
Change-Id: I23cb9a9be5ddb7e8e9c58c79838bc07536e766e6
</pre>
</div>
</content>
</entry>
<entry>
<title>libcutils: move cutils/files.h to cutils/android_get_control_file.h</title>
<updated>2016-11-16T23:56:56+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2016-11-07T17:39:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=52bd37e63373b410c009e8611508191dfbf31d30'/>
<id>52bd37e63373b410c009e8611508191dfbf31d30</id>
<content type='text'>
files.[h|cpp] is bound to be abused with junk, replace with
android_get_control_file.[h|cpp]. Plus some sundry cleanup.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests and init_tests
Bug: 32450474
Change-Id: Ibd4a7aa4624ea19a43d1f98a3c71ac37805d36b5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
files.[h|cpp] is bound to be abused with junk, replace with
android_get_control_file.[h|cpp]. Plus some sundry cleanup.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests and init_tests
Bug: 32450474
Change-Id: Ibd4a7aa4624ea19a43d1f98a3c71ac37805d36b5
</pre>
</div>
</content>
</entry>
<entry>
<title>init: service file keyword</title>
<updated>2016-11-03T20:34:26+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2016-10-27T14:45:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=62767fe29f8aaf62470781a3cf419ba11187d178'/>
<id>62767fe29f8aaf62470781a3cf419ba11187d178</id>
<content type='text'>
Solve one more issue where privilege is required to open a file and
we do not want to grant such to the service. This is the service side
of the picture, android_get_control_file() in libcutils is the client.
The file's descriptor is placed into the environment as
"ANDROID_FILE_&lt;path&gt;".  For socket and files where non-alpha and
non-numeric characters in the &lt;name/path&gt; are replaced with _.  There
was an accompanying change in android_get_control_socket() to match
in commit 'libcutils: add android_get_control_socket() test'

Add a gTest unit test for this that tests create_file and
android_get_control_file().

Test: gTest init_tests --gtest_filter=util.create_file
Bug: 32450474
Change-Id: I96eb970c707db6d51a9885873329ba1cb1f23140
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Solve one more issue where privilege is required to open a file and
we do not want to grant such to the service. This is the service side
of the picture, android_get_control_file() in libcutils is the client.
The file's descriptor is placed into the environment as
"ANDROID_FILE_&lt;path&gt;".  For socket and files where non-alpha and
non-numeric characters in the &lt;name/path&gt; are replaced with _.  There
was an accompanying change in android_get_control_socket() to match
in commit 'libcutils: add android_get_control_socket() test'

Add a gTest unit test for this that tests create_file and
android_get_control_file().

Test: gTest init_tests --gtest_filter=util.create_file
Bug: 32450474
Change-Id: I96eb970c707db6d51a9885873329ba1cb1f23140
</pre>
</div>
</content>
</entry>
</feed>
