Commit graph

1041 commits

Author SHA1 Message Date
Daniel Micay
2b22a66382 add a property for controlling perf_event_paranoid
This adds a system property for controlling unprivileged access to
perf_event_paranoid. It depends on adding kernel support for
perf_event_paranoid=3 based on grsecurity's PERF_HARDEN feature to
completely disable unprivileged access to perf. A minimal port of this
feature is used in the vanilla Debian kernel by default.

It hides the non-hardened value as an implementation detail, since while
it is currently 1, it will probably become 2 in the future.

Bug: 29054680

Change-Id: I6e3ae3cf18d8c76df94f879c34fb6fde519b89a9
2016-05-31 17:45:05 -04:00
Badhri Jagan Sridharan
2a26c2a836 Merge "init: usb: disable usb function switch until adbd is ready" 2016-05-16 19:34:51 +00:00
Irina Patru
c560c6310f init.rc: Remove cpu weight set on the root cgroup
It isn't allowed to change the cpu.share value for the root cgroup.
See kernel commit:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ec7dc8ac73e4a56ed03b673f026f08c0d547f597

This fixes the following error seen in dmesg:
init: write_file: Unable to write to '/dev/cpuctl/cpu.shares': Invalid argument

BUG: 28735908

Change-Id: I5ef359fb275792f99d13d35c62499026d354f6af
Signed-off-by: Irina Patru <irina.patru@intel.com>
2016-05-12 14:57:31 +03:00
Winter Wang
46c313b694 init: usb: disable usb function switch until adbd is ready
In the case of adb enabled, When a usb function switch happens
e.g mtp,adb -> ptp,adb, framework will set sys.usb.config from
"mtp,adb" to "none" and stop adbd first.
At this time, the property "sys.usb.ffs.ready", which is set after
the ready of the perious start adbd, is still "1".
So , when framework goes on setting the sys.usb.config to "ptp,adb",
init.usb.configfs.rc will trigger actions to bind() f_fs without
waiting for adbd is actually ready.

This will produce some error messages:
------------
configfs-gadget ci_hdrc.0: failed to start g1: -19
init: write_file: Unable to write to '/config/usb_gadget/g1/UDC': No such device
------------
this error msg is caused by configFS start binding f_fs before adbd is ready.

Add setting the "sys.usb.ffs.ready" to "0" will help clear this error msg,
as the bind process in kernel gadget driver will wait for the set of
this property, which is the sign of adbd is ready.

Signed-off-by: Winter Wang <wente.wang@nxp.com>
2016-04-08 19:23:00 +08:00
Dimitry Ivanov
d1fdb98830 Move list of public libraries to a config file
This list contains libraries that should directly or indirectly
be accessible to apps for the platform. Note that this list is
not device specific but rather device class specific.

For now we have 2 separate lists; one for Android Phones and Tablets,
and another one for Android Wear devices.

Bug: http://b/27546414
Bug: http://b/22548808
Change-Id: I83de5e3cf67392d0e9af66f70123898bd5997146
(cherry picked from commit 4b0e963872)
2016-03-17 10:54:19 -07:00
Elliott Hughes
bf6c67f234 Merge "init-debug.rc: mount debugfs" 2016-03-14 17:57:16 +00:00
Janis Danisevskis
3d1dff2231 Leftovers of the SELinux policy update mechanism
Remove references to SELinux policy files in /data/security
from libselinux/android.c. In the process all code that is
apparently related to handling an alternate policy and/or
reloading the policy has been removed.

Bug: 26544104
Change-Id: I47bf76ac3c26c5d71f92a21ffac2b17ba14262ea
2016-03-11 17:47:30 +00:00
Mihai Serban
afebc25bdd init-debug.rc: mount debugfs
Enable debugfs on non "user" builds.

BUG=27520850
Change-Id: I2bcc72b686d0477b553c0605adfd4c023e72cbfb
Signed-off-by: Mihai Serban <mihai.serban@intel.com>
2016-03-07 16:56:06 +02:00
Alex Deymo
e2ad3cfae4 Merge "Add /postinstall partition when using the A/B updater."
am: 700b15dacf

* commit '700b15dacfa42bcc5c4d768b92530e9f20f0211b':
  Add /postinstall partition when using the A/B updater.
2016-03-04 08:01:40 +00:00
Alex Deymo
bb968fb04d Add /postinstall partition when using the A/B updater.
The new top level directory /postinstall is used by the A/B updater to
mount the new partition and run a post-install program before rebooting
into that new system.

init.rc was extended to label this new directory since the initrd has
no extended attributes.

Bug: 27177071
TEST=`ls -laZ /` shows the /postinstall directory on edison-eng

Change-Id: I6cdee7eb1d61ac7d447528962a4fad1a7bbf138d
2016-03-02 14:17:42 -08:00
Chien-Yu Chen
0836c9e386 Sync internal<->AOSP user list.
Bug: 27299198

Cherry-picked from:

Restart cameraserver

Bug: 24511454
Change-Id: Ia27f4ef0eb71f891c789f637a21b04afe0b1c4e9
2016-02-23 15:56:55 -08:00
Bill Yi
4409f1446c Merge commit '4352ee87fd74b931d4b58192fb8974e91aa899d0' into HEAD 2016-02-17 11:37:00 -08:00
Mark Salyzyn
7864e36751 init-debug.rc: add runtime mmc max speed property actors
persist.mmc.max_read_speed  - KB/s speed cap
persist.mmc.max_write_speed - KB/s speed cap
persist.mmc.cache_size      - MB of high-speed on-device write cache

device default directly to associated /sys/block/mmcblk0/ attributes,
not delivered on "user" builds.

Bug: 26976972
Change-Id: Ic82b9614489b6406ce830d127c85affc9095e256
2016-02-04 13:10:19 -08:00
Mark Salyzyn
0604f6fbae init.rc: too many start logd
Bug: 26934873
Change-Id: Ia00da6253a50bedc8ba825df1cf641b86cdebeed
2016-02-02 16:01:17 -08:00
Elliott Hughes
2f74a5dae5 Start debuggerd as soon as logd is up.
Makes debugging early boot crashes easier.

Bug: http://b/26918597
Change-Id: I5bb883f1350ea5f7a545cb0e9f1034ecfcf47cdb
2016-02-02 13:03:41 -08:00
Greg Hackmann
40a96e4ba0 init.rc: add missing /dev/fd symlink
The Linux kernel implicitly expects /dev/fd to symlink to /proc/self/fd.

This change fixes the exec/execveat.c kernel selftest.

Change-Id: Ia08d50023336fdbfc098527299c326d9d59039a9
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-02-01 10:02:19 -08:00
Kevin Cernekee
fa432b0e2f Merge "ueventd.rc: Document the different rule formats for /dev and /sys nodes" 2016-01-26 23:44:56 +00:00
Nick Kralevich
27cb410352 init.rc: mix device-specific data into the Linux RNG
Mix the contents of /proc/cmdline and /default.prop
into /dev/urandom. /proc/cmdline often contains
androidboot.serialno, a device-specific unique
identifier. Similarly, /default.prop contains the
build fingerprint and timestamp, which vary between
device families.

Change-Id: I8803b38c7089b2a1217b99a7c1808b29a3b138cf
2016-01-22 19:58:21 -08:00
Elliott Hughes
e8b97fc0b0 Merge "init.rc: Reland "mkdir /data/misc/vold""
am: 19616ce100

* commit '19616ce100771d0f570bc9cf19d08fbbe8feec0f':
  init.rc: Reland "mkdir /data/misc/vold"
2016-01-08 17:16:34 +00:00
Yu Ning
c1149ff0c3 init.rc: Reland "mkdir /data/misc/vold"
Creation of /data/misc/vold was first introduced by commit 25775e8. It
then got reverted, probably inadvertently, by:

 commit 2e24bcfdce
 Author: Paul Lawrence <paullawrence@google.com>
 Date:   Fri May 22 18:31:55 2015 +0000

     Revert "Set up crypto for user directories in init."

This folder is required by vold. In its absence, if one tries to format
an SD card as internal storage, an error will occur, with the following
message printed to logcat:

 01-08 06:31:48.389  1002  1069 E vold    : Failed to persist key

Restoring /data/misc/vold fixes this bug.

This fix has been verified on the emulator, which currently does not
allow its virtual SD card to be adopted, but another CL will be uploaded
to enable that.

Change-Id: Ibb87ee821630a038a6f9b7b6a9da50fe03ca690d
Signed-off-by: Yu Ning <yu.ning@intel.com>
2016-01-08 14:51:32 +08:00
Pavlin Radoslavov
7705e0384e Merge "Use GID "wakelock" to control access to kernel wakelock"
am: 0f0498ad50

* commit '0f0498ad508e6747dc7b72a6e63de2f2befa2e1c':
  Use GID "wakelock" to control access to kernel wakelock
2015-12-29 01:28:48 +00:00
Pavlin Radoslavov
17d80c84e1 Use GID "wakelock" to control access to kernel wakelock
* Added new kernel GID named "wakelock" (AID_WAKELOCK = 3010)
* Changed the group access for /sys/power/wake_lock and
  /sys/power/wake_unlock from "system" to "wakelock"
* Added "wakelock" to the list of groups for the healthd process/service

Bug: 25864142
Change-Id: Ieabee9964cccec3107971a361a43aa9805164aa9
2015-12-28 14:57:28 -08:00
Tao Bao
8ca8664956 Merge "rootdir: Execute update_verifier for A/B update."
am: df13f60ce0

* commit 'df13f60ce0152bc9a38e18fcb9c7c839d8eba5e3':
  rootdir: Execute update_verifier for A/B update.
2015-12-09 19:55:09 +00:00
Tao Bao
df13f60ce0 Merge "rootdir: Execute update_verifier for A/B update." 2015-12-09 19:50:31 +00:00
Nick Kralevich
baaeddfa23 Merge "init.rc: restorecon_recursive /sys/kernel/debug" am: 6d85c06aa1
am: 070288241d

* commit '070288241d5c3d1a169e21ba4439a5943ce476d8':
  init.rc: restorecon_recursive /sys/kernel/debug
2015-12-08 04:50:55 +00:00
Nick Kralevich
070288241d Merge "init.rc: restorecon_recursive /sys/kernel/debug"
am: 6d85c06aa1

* commit '6d85c06aa1600e905cf3e0b093e939fa3866ee59':
  init.rc: restorecon_recursive /sys/kernel/debug
2015-12-08 04:48:06 +00:00
Nick Kralevich
715c4dc3f9 init.rc: restorecon_recursive /sys/kernel/debug
If /sys/kernel/debug is present, make sure it has all the appropriate
SELinux labels.

Labeling of /sys/kernel/debug depends on kernel support
added in commit https://android-review.googlesource.com/122130

This patch depends on an external/sepolicy change with the
same Change-Id as this patch.

Change-Id: Id1d6a9ad6d0759d6de839458890e8cb24685db6d
2015-12-07 17:00:40 -08:00
Tao Bao
97df395683 rootdir: Execute update_verifier for A/B update.
update_verifier verifies the updated partitions and marks the current
slot as having booted successfully. It needs to be triggered prior to
the start of the framework, otherwise it won't be able to fall back to
the old system without a data wipe.

Bug: 26039641
Change-Id: I6fd183cdd3dfcc72feff2a896368158875b28591
2015-12-07 16:23:13 -08:00
Daniel Rosenberg
5c331c5be8 Remove creation of root directory folders
am: c97e1cb39d

* commit 'c97e1cb39d9ba129d8326605d121a10c9ae491e7':
  Remove creation of root directory folders
2015-11-18 21:39:01 +00:00
Todd Kjos
88b5892d74 resolve merge conflicts of ed60788968 to mnc-dr2-dev-plus-aosp.
Change-Id: I9b07dd8dcb8fc74b658466b8dd47546cefffab1d
2015-11-18 08:31:03 -08:00
Junichi Uekawa
ef7197eefa Merge "Fix non-vendor.img configuration."
am: 1337349ea1

* commit '1337349ea11a6bb5c44ba5c5bb064c750bd626c5':
  Fix non-vendor.img configuration.
2015-11-17 03:36:23 +00:00
Junichi Uekawa
07b69961f2 Fix non-vendor.img configuration.
If / is not write-able and system.img contains system/vendor, symlink
for `/vendor/ -> /system/vendor/` that is otherwise done in init.rc
should be done at build time.

BUG=b:25512724

Change-Id: Iaa63d6440373a4fd754a933c9f1960b3787a6d98
2015-11-17 11:20:21 +09:00
Daniel Rosenberg
c97e1cb39d Remove creation of root directory folders
Folders in the root directory are now created during the build,
as we may be building without a ramdisk, and when we do that,
the root directory will be read-only.  With those changes,
these mkdirs will never need to run.

Change-Id: I49c63e8bfc71d28e3f938ed41f81d108359fa57a
2015-11-16 08:53:04 -08:00
Todd Kjos
ed60788968 Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 08:53:04 -08:00
Daniel Rosenberg
4c9c516d20 rootdir: Create cache folder in Android.mk
system.img may contain the root directory as well. In that case, we
need to create some folders init.rc would during the build.

Change-Id: I312104ff926fb08d98ac8256b76d01b0a90ea5e5
2015-11-16 08:53:04 -08:00
Daniel Rosenberg
9262546184 rootdir: Create folders in Android.mk
system.img may contain the root directory as well. In that case, we
need to create some folders init.rc would during the build.

Change-Id: I157ccbebf36bee9916f3f584551704ec481ae1d1
2015-11-16 08:53:04 -08:00
Calin Juravle
2a095e186b Merge "Don\'t create profiles directory under dalvik-cache."
am: 942f8ea84f

* commit '942f8ea84f3f96c2e2556fe90ebba0ec76730553':
  Don't create profiles directory under dalvik-cache.
2015-11-16 11:21:48 +00:00
Calin Juravle
942f8ea84f Merge "Don't create profiles directory under dalvik-cache." 2015-11-16 11:08:46 +00:00
Calin Juravle
5d1a9688b8 Merge "Create a folder to store method traces activated with -Xmethod-trace"
am: 7605a56fbc

* commit '7605a56fbcf5706b6e2892da9d9dc0fd20efb395':
  Create a folder to store method traces activated with -Xmethod-trace
2015-11-11 18:12:03 +00:00
Calin Juravle
9b3e5d59fe Create a folder to store method traces activated with -Xmethod-trace
Bug: 25612377
Change-Id: I370b858594ccc88c12099b23a0d1aac22acd4969
2015-11-10 21:26:40 +00:00
Nick Kralevich
ea8452cc72 Merge "Enable hidepid=2 on /proc"
am: 2d8f1d4c47

* commit '2d8f1d4c478b9d921730d3fc9b290315e2ff9f04':
  Enable hidepid=2 on /proc
2015-11-09 20:29:44 +00:00
Nick Kralevich
c39ba5ae32 Enable hidepid=2 on /proc
Add the following mount options to the /proc filesystem:

  hidepid=2,gid=3009

This change blocks /proc access unless you're in group 3009
(aka AID_READPROC).

Please see
  https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt
for documentation on the hidepid option.

hidepid=2 is preferred over hidepid=1 since it leaks less information
and doesn't generate SELinux ptrace denials when trying to access
/proc without being in the proper group.

Add AID_READPROC to processes which need to access /proc entries for
other UIDs.

Bug: 23310674
Change-Id: I22bb55ff7b80ff722945e224845215196f09dafa
2015-11-09 09:08:46 -08:00
Calin Juravle
933bc0a3d1 Don't create profiles directory under dalvik-cache.
Bug: 24698874
Bug: 17173268
Change-Id: Ic81258a8df90818fa6b4ee64fd1507ac18fe3f04
2015-11-04 14:59:41 +00:00
Bill Yi
1ec36aaeb0 Merge commit 'f85d6cd8045ce933dfdc19bc888228cd9382e48c' into HEAD 2015-11-03 14:30:40 -08:00
Daniel Rosenberg
64ea814c31 Merge "rootdir: Allow board specific folders and symlinks in root directory"
am: 6e699df21e

* commit '6e699df21e1b08aa2e9eb18ef1c44788549ae8ed':
  rootdir: Allow board specific folders and symlinks in root directory
2015-11-02 21:58:22 +00:00
Daniel Rosenberg
52b5915945 rootdir: Allow board specific folders and symlinks in root directory
Building without ramdisk requires a way to specify board specific
directoryies and symlinks in the root directory at build time.

Change-Id: I11301e98228bc4761f3aee177a546146651b9f25
(cherry picked from commit d7549c9a65cad886f672af41f5fca6f0bd0c12fa)
2015-11-02 12:47:46 -08:00
Evgenii Stepanov
ec6ff936b0 Merge "Disable container overflow detect on target." am: 151e49726b
am: 5562351b50

* commit '5562351b50fbbcda030ddfffcb3b2dbef82bcdc9':
  Disable container overflow detect on target.
2015-10-23 22:14:52 +00:00
Evgenii Stepanov
5562351b50 Merge "Disable container overflow detect on target."
am: 151e49726b

* commit '151e49726bf743bfbd7e44695f9d673735e62119':
  Disable container overflow detect on target.
2015-10-23 22:10:27 +00:00
Evgenii Stepanov
151e49726b Merge "Disable container overflow detect on target." 2015-10-23 22:03:52 +00:00
Evgenii Stepanov
f3009f21d5 Disable container overflow detect on target.
Container overflow annotations may cause false positives in partially
instrumented binaries.

Bug: 25228125, 25212198
Change-Id: Ic587d41698c02e306dece4ad7c6a2a8810c52dbd
2015-10-23 14:57:47 -07:00