Commit Graph

6310 Commits

Author SHA1 Message Date
Alex Klyubin 18860c5249 Enable run-as to read packages.list now owned by package_info.
The group ownership of the package database
/data/system/packages.list read by run-as was changed in
977a9f3b1a from "system" to
"package_info". run-as currently changes its effective group to
"system" and is thus unable to read the database.

This CL fixes the issue by making run-as change its effective group
to "package_info" for reading the package database.

Bug: 10411916
Change-Id: Id23059bfb5b43264824917873a31c287f057ce4e
2013-08-20 15:16:31 -07:00
Andrew Boie 3899f522f1 init: load factory properties
These properties are typically set at device provisioning time
or in the factory. They contain unit-specific data that isn't
touched by software updates or factory data reset. Only
read-only properties can be read by this mechanism.

Change-Id: Ifff9184f039072c3c0ce99f825c3075afb524514
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2013-08-20 11:47:55 -07:00
Alex Klyubin f2904a7b63 Fix run-as which was broken in Android 4.3
In Android 4.3 the run-as binary no longer has the SUID/SGID bits
set. Instead, it requires to be installed with setuid and setgid
file-based capabilities. As a result of the above two changes, the
binary no longer executes as root when invoked by the "shell" user
but can still change its UID/GID to that of the target package.

Unfortunately, run-as attempts to chdir into the target package's
data directory before changing its effective UID/GID. As a result,
when run-as is invoked by the "shell" user, the chdir operation
fails.

The fix is for run-as to chdir after changing the effective UID/GID
to those of the target package.

Bug: 10154652
Change-Id: I48ecfeab7cd36991968d49e2382ceb4110694709
2013-08-19 18:27:53 -07:00
Alex Klyubin 1ca0168238 am 0d872d8b: Seed Linux RNG from Hardware RNG at boot during init.
* commit '0d872d8bb4f5371200601b7615ea48993383befb':
  Seed Linux RNG from Hardware RNG at boot during init.
2013-08-19 18:03:57 -07:00
Jeff Brown bd442a74ec am c7a4f74d: Merge "Add helpers for audio remote submix devices." into klp-dev
* commit 'c7a4f74dad2b91bebad608618f3fda434563be74':
  Add helpers for audio remote submix devices.
2013-08-19 17:01:27 -07:00
Alex Klyubin 0d872d8bb4 Seed Linux RNG from Hardware RNG at boot during init.
The Linux RNG may have little entropy during boot. As more and more
devices have a Hardware RNG, we mix in 512 bytes from Hardware RNG
(if present) into Linux RNG early during boot (after
wait_for_coldboot_done and before property_service_init actions in
init).

To avoid having to trust the output of Hardware RNG, we do not mix it
into the Linux RNG's primary pool or increase the Linux RNG's entropy
estimates.

Bug: 10362513
Change-Id: I80617f21710400747f5e7533e518d90ea74e2f11
2013-08-19 16:58:28 -07:00
Jeff Brown c7a4f74dad Merge "Add helpers for audio remote submix devices." into klp-dev 2013-08-19 23:56:44 +00:00
Michael Wright 3c0eef67f7 am 9f50abde: Add basic readlink command
* commit '9f50abdee00a9571393ce4a589080b4d6129aaf3':
  Add basic readlink command
2013-08-19 16:41:04 -07:00
Michael Wright 9f50abdee0 Add basic readlink command
Change-Id: I693c1098e6c6d107a9e97285bf826ab153a1c8f0
2013-08-19 16:31:35 -07:00
Jeff Brown 8ecc7afca4 Add helpers for audio remote submix devices.
Bug: 10265163
Change-Id: Iea7ecab4f2a655b719ff14b04c757d6dbd7a7ef3
2013-08-16 20:21:10 -07:00
Elliott Hughes 88ea2f669f am 3042c265: am b3644d8f: Merge "Add USB Vendor ID for WACOM"
* commit '3042c265bf3123426e99fed856c9d3b7fa3b3ad6':
  Add USB Vendor ID for WACOM
2013-08-16 15:37:43 -07:00
Elliott Hughes 3042c265bf am b3644d8f: Merge "Add USB Vendor ID for WACOM"
* commit 'b3644d8f6b6485769c7712aaf7749d042aacbc09':
  Add USB Vendor ID for WACOM
2013-08-16 15:35:05 -07:00
Elliott Hughes b3644d8f6b Merge "Add USB Vendor ID for WACOM" 2013-08-16 22:32:20 +00:00
Jesse Hall 699249f9e4 am 08380deb: Merge "Replace sRGB_888 with sRGB_X_8888" into klp-dev
* commit '08380deb247865b862f7f284c80eeea4f5ec38f6':
  Replace sRGB_888 with sRGB_X_8888
2013-08-16 14:53:50 -07:00
Jesse Hall 08380deb24 Merge "Replace sRGB_888 with sRGB_X_8888" into klp-dev 2013-08-16 21:50:21 +00:00
Lorenzo Colitti dbf6de9064 am 3984276c: Get rid of an infinite loop in NetlinkEvent.cpp.
* commit '3984276ce47c965ad02a522280a139e0a0c7e5cf':
  Get rid of an infinite loop in NetlinkEvent.cpp.
2013-08-16 12:13:44 -07:00
Lorenzo Colitti 3984276ce4 Get rid of an infinite loop in NetlinkEvent.cpp.
Bug: 10358527
Bug: 10263310
Bug: 10232006
Change-Id: I750e4bdf2000040adf214d6a772591d7bd25b350
2013-08-17 04:02:14 +09:00
Jesse Hall 1e26356da1 Replace sRGB_888 with sRGB_X_8888
Bug: 10357459
Change-Id: I23a3eca77acd8b4b40b1a67e7c050a7245b1821a
2013-08-16 08:40:52 -07:00
Lorenzo Colitti c9a4c55c91 am 341ed242: Merge "Parse IP address changes in NetlinkEvent." into klp-dev
* commit '341ed242d400951dd8436cbc988e64c1c075df41':
  Parse IP address changes in NetlinkEvent.
2013-08-15 19:26:15 -07:00
Lorenzo Colitti 341ed242d4 Merge "Parse IP address changes in NetlinkEvent." into klp-dev 2013-08-16 02:24:12 +00:00
Ken Sumrall 516836d471 am 57d4b4ea: Merge "Fix handle_opendir() in the sdcard daemon" into klp-dev
* commit '57d4b4ea6fc7d8014ebdf691ae8fbe204c67881b':
  Fix handle_opendir() in the sdcard daemon
2013-08-14 20:32:07 -07:00
Ken Sumrall 57d4b4ea6f Merge "Fix handle_opendir() in the sdcard daemon" into klp-dev 2013-08-15 03:28:31 +00:00
Ken Sumrall 3a8768804c Fix handle_opendir() in the sdcard daemon
The fuse_open_out structure returned to the kernel by handle_opendir()
was not properly initializing all the fields.  The symptom was recursive
ls (ls -R) failing on the emulated sdcard filesystem, because rewinddir(3)
was failing with ESPIPE.

Bug: 7168594
Change-Id: I56ddfd3453e6aac34fe6e001e88c4c46fb2eb271
2013-08-14 20:02:13 -07:00
Wing Tseng 64a602942e Add USB Vendor ID for WACOM
Change-Id: I3deee6d5bdfb9c5bbc0fddcfa39814d27ee281c2
Signed-off-by: Wing Tseng <Wing_Tseng@pegatroncorp.com>
2013-08-15 09:33:59 +08:00
Jeff Sharkey 01f7cf79e5 am 7e64c143: Merge "Add legacy layout support to FUSE, enforce write." into klp-dev
* commit '7e64c1436b7693d94d22e45add85c74284c88273':
  Add legacy layout support to FUSE, enforce write.
2013-08-14 13:10:33 -07:00
Jeff Sharkey 7e64c1436b Merge "Add legacy layout support to FUSE, enforce write." into klp-dev 2013-08-14 20:08:34 +00:00
Jeff Sharkey 977a9f3b1a Add legacy layout support to FUSE, enforce write.
The legacy internal layout places users at the top-level of the
filesystem, so handle with new PERM_LEGACY_PRE_ROOT when requested.

Mirror single OBB directory between all users without requiring fancy
bind mounts by letting a nodes graft in another part of the
underlying tree.

Move to everything having "sdcard_r" GID by default, and verify that
calling apps hold "sdcard_rw" when performing mutations. Determines
app group membership from new packages.list column.

Flag to optionally enable sdcard_pics/sdcard_av permissions
splitting. Flag to supply a default GID for all files. Ignore
attempts to access security sensitive files. Fix run-as to check for
new "package_info" GID.

Change-Id: Id5f3680779109141c65fb8fa1daf56597f49ea0d
2013-08-14 12:01:38 -07:00
Lorenzo Colitti a4b4e9ad8e Parse IP address changes in NetlinkEvent.
This adds support for parsing RTM_NEWADDR and RTM_DELADDR
netlink messages received on netd's netlink socket and
formatting them them so NetlinkHandler can process them.

Address changes are notified in subsystem "address". Interface
changes, which used to be notified in subsystem "net", are now
notified in subsystem "interface" to avoid confusion.

Bug: 10232006
Change-Id: I93a50e8de17014e118a42f5cc0eb90a0cbfa73cc
2013-08-14 19:50:22 +09:00
Todd Poynor ceaf05faf0 am f5d3012d: healthd: Move power_supply attribute paths to healthd_config
* commit 'f5d3012d2c6ac343a0b8bcc95b9cd5137d9ef02f':
  healthd: Move power_supply attribute paths to healthd_config
2013-08-13 19:31:25 -07:00
Todd Poynor f5d3012d2c healthd: Move power_supply attribute paths to healthd_config
Allow health HAL to select specific paths to be used, overriding
default search for arbitrary power supplies with the named paths.

Change-Id: I5f724739f58ef56087ab592b7403fc083db8f173
2013-08-14 02:27:54 +00:00
Todd Poynor a52ea1c48e am d65104ca: healthd: switch to HAL static libraries
* commit 'd65104ca31766922537c79ec2d7647584723407c':
  healthd: switch to HAL static libraries
2013-08-13 16:21:47 -07:00
Todd Poynor d65104ca31 healthd: switch to HAL static libraries
Change-Id: I5a802f9b9a8ad4782c4d0c6376a068aef32a70cb
2013-08-13 16:09:12 -07:00
Todd Poynor 3f17bda894 am a41611f6: healthd: fix botched logging call
* commit 'a41611f638f82cb8066f83b32f2610f0d00dafc6':
  healthd: fix botched logging call
2013-08-12 12:22:07 -07:00
Todd Poynor a41611f638 healthd: fix botched logging call
Change-Id: Ibf5e28c657e0d9d193b266acd7b2912bebc3e71f
2013-08-12 12:18:36 -07:00
Elliott Hughes 49f2e1cedf am cc39d421: am 936032b4: Merge "Add USB Vendor ID for MSI"
* commit 'cc39d421ea5f449d5e201dd1ada7b2a12acf5ad9':
  Add USB Vendor ID for MSI
2013-08-12 10:34:58 -07:00
Elliott Hughes cc39d421ea am 936032b4: Merge "Add USB Vendor ID for MSI"
* commit '936032b46be4fbf8a62fbaf7e4ab4cfa863fef90':
  Add USB Vendor ID for MSI
2013-08-12 10:33:13 -07:00
Elliott Hughes 936032b46b Merge "Add USB Vendor ID for MSI" 2013-08-12 17:31:41 +00:00
Todd Poynor 57fd0989cb healthd: preserve uA and uAh units for current_now and charge_counter
Change-Id: I20b3f47c541c4321b0593e504090ad6573b9cb01
2013-08-09 21:52:25 +00:00
Jeff Sharkey dfe0cbab3f Richer SD card permissions through FUSE.
Changes the FUSE daemon to synthesize an Android-specific set of
filesystem permissions, even when the underlying media storage is
permissionless.  This is designed to support several features:

First, apps can access their own files in /Android/data/com.example/
without requiring any external storage permissions.  This is enabled
by allowing o+x on parent directories, and assigning the UID owner
based on the directory name (package name).  The mapping from package
to appId is parsed from packages.list, which is updated when apps are
added/removed.  Changes are observed through inotify.  It creates
missing package name directories when requested and valid.

Second, support for separate permissions for photos and audio/video
content on the device through new GIDs which are assigned based on
top-level directory names.

Finally, support for multi-user separation on the same physical media
through new /Android/user/ directory, which will be bind-mounted
into place.  It recursively applies the above rules to each secondary
user.

rwxrwx--x root:sdcard_rw     /
rwxrwx--- root:sdcard_pics   /Pictures
rwxrwx--- root:sdcard_av     /Music

rwxrwx--x root:sdcard_rw     /Android
rwxrwx--x root:sdcard_rw     /Android/data
rwxrwx--- u0_a12:sdcard_rw   /Android/data/com.example
rwxrwx--x root:sdcard_rw     /Android/obb/
rwxrwx--- u0_a12:sdcard_rw   /Android/obb/com.example

rwxrwx--- root:sdcard_all    /Android/user
rwxrwx--x root:sdcard_rw     /Android/user/10
rwxrwx--- u10_a12:sdcard_rw  /Android/user/10/Android/data/com.example

These derived permissions are disabled by default.  Switched option
parsing to getopt().

Change-Id: I21bf5d79d13f0f07a6a116122b16395f4f97505b
2013-08-08 17:26:41 -07:00
Todd Poynor 9face5cad5 healthd: create healthd_board_init()
Subsume healthd_board_poll_intervals, make clear the call is for init-time
actions.

Change-Id: I9267e4ce7c62b78d2997a43822f20bfa13b54cd8
2013-08-08 12:26:36 -07:00
Todd Poynor 10b235e743 healthd: add health HAL support
Adds board-specific battery monitoring capabilities:

* processing of battery property values and additional charging logic.
* adjusted (or removed) polling intervals.
* replaced (or removed) battery status heartbeat in kernel log.

Change-Id: Ia77bca8dc92c6c2a51afa65d516cacca08da73ac
2013-08-07 18:57:37 -07:00
Todd Poynor b45f1f5bd0 healthd: add optional current_now and charge_counter to tracked state
uA and uAh units are converted to mA and mAh.

If current_now is present, add it to the heartbeat log (c=nnn).

Change-Id: I2b5fe7b4505c98ca2d11c3f94564c1c38493c8b9
2013-08-07 18:34:34 +00:00
Geremy Condra d893e39d4f Merge "Add basic verity support to fs_mgr." 2013-08-07 18:20:33 +00:00
Geremy Condra 3ad3d1c4b5 Add basic verity support to fs_mgr.
This change adds a "verify" fs_mgr flag specifying that
the device in question should be verified.

Devices marked with this flag are expected to have a
footer immediately after their data containing all
the information needed to set up a verity instance.

Change-Id: I10101f2c3240228ee0932e3767fe35e673d2e720
2013-08-06 22:15:58 -07:00
Pavel Chupin 856b6cbd9b Fix build with gcc-4.8 and array boundaries issue
Remove unused parameters of static functions to avoid warning with 4.8.
Fix array index out of bounds issue when register number exceeds limit.
It shouldn't occur in real world, but static verifiers can detect it.

Change-Id: Id237df905b40bad02fc8cbbeac31084040f58076
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-08-06 17:00:11 +04:00
Glenn Kasten 9de3fd115a Merge "Add audio_input_flags_t" 2013-08-05 19:11:34 +00:00
Alex Ray d98e07fdf9 move libs/utils to libutils
Change-Id: I6cf4268599460791414882f91eeb88a992fbd29d
2013-08-02 14:40:08 -07:00
Dmitry Shmidt be06210c50 libnetutils: Get mtu together with dhcp session results
Change-Id: I517fd1f62d451b07466a21a2b770d9ce389dac19
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-08-02 14:09:09 -07:00
Glenn Kasten c051ffd7c2 Add audio_input_flags_t
Change-Id: Ie65398cc67218cc63be4baa8a2a61d0ea591a2a3
2013-08-02 10:30:42 -07:00
Eino-Ville Talvala b4802413a7 Merge "Window: Add query for consumer usage bits." 2013-08-02 00:23:02 +00:00