Commit graph

6273 commits

Author SHA1 Message Date
Ben Cheng
5cd118178e Disable timestamp logging.
The kernel problem has been fixed long time ago and the ad-hoc logging
mechanism is not thread safe and can flood the log with spurious
messages.

BUG: 10899829
Change-Id: I63278db51295e744eed3e47dc8d4cfe621c0d8f7
2013-09-23 22:39:15 -07:00
Ken Sumrall
6b1a027239 Merge "Create a separate copy of the fsck logs" into klp-dev 2013-09-23 20:06:57 +00:00
Ken Sumrall
777a00e3d1 Merge "New fstab flags to support more expressive SD card permissions" into klp-dev 2013-09-23 20:06:41 +00:00
Jeff Sharkey
0ee7d8c68b Fix Mac builds, for realz.
Change-Id: I63e21b90e5b8a8f016dd04ceca4354793faa5e37
2013-09-20 18:00:15 -07:00
Ken Sumrall
4eaf905858 Create a separate copy of the fsck logs
The log_target parameter of android_fork_execvp_ext() is now a
bit field, and multiple targets can be set to log to multiple
places at the same time.

The new target LOG_FILE will log to a file specified by the new
parameter file_path.

Set LOG_FILE and log to a file in /dev (the only writable filesystem
avilable when e2fsck runs) when invoking e2fsck in fs_mgr.

Bug: 10021342

Change-Id: I63baf644cc8c3afccc8345df27a74203b44d0400
2013-09-20 17:44:33 -07:00
Ken Sumrall
887f289206 New fstab flags to support more expressive SD card permissions
Bug: 10330128

Change-Id: I41fb178b839487b604762fbc1ccba097d25c7aa0
2013-09-20 17:43:52 -07:00
Jeff Sharkey
4481c325b1 Fix Mac builds.
Change-Id: I0eb029395a3afd2f93a7632d7d3d20d28c2ab189
2013-09-20 17:35:15 -07:00
Jeff Sharkey
44d6342caa Remove mkdir() side effect, add .nomedia, utils.
Before this change, FUSE lookup() would have the side effect of
creating the directory on behalf of apps.  This resulted in most
directories being created just by Settings trying to measure disk
space.  Instead, we're switching to have vold do directory creation
when an app doesn't have enough permissions.

Create fs_mkdirs() utility to create all parent directories in a
path as needed.  Allow traversal (+x) into /storage directories.

Fix FUSE derived permissions to be case insensitive.  Mark well-known
directories as .nomedia when created.

Bug: 10577808, 10330221
Change-Id: I53114f2e63ffbe6de4ba6a72d94a232523231cad
2013-09-20 14:21:09 -07:00
Mathias Agopian
7b445a8e3a Merge "Fix rotation in camera2 API" into klp-dev 2013-09-18 22:31:28 +00:00
Nick Kralevich
4f18183bd6 Merge "Initialize /dev/urandom earlier in boot." into klp-dev 2013-09-18 19:46:54 +00:00
Jamie Gennis
9d773b978b Merge "trace: Add support for tracing 64-bit ints." into klp-dev 2013-09-18 19:17:58 +00:00
Jamie Gennis
f1921c7949 trace: Add support for tracing 64-bit ints.
Bug: 10624956
Change-Id: Ie1d7c8ac16b5a5ec1e63e4fb1863f5b1ab2b59e8
2013-09-18 19:03:45 +00:00
Nick Kralevich
b410eb1913 Initialize /dev/urandom earlier in boot.
It's a security best practice to carry entropy across reboots.
(see "man 4 random"). Currently, entropy saving and mixing occur
in the system_server, via the EntropyMixer code. Unfortunately, the
EntropyMixer code runs fairly late in the boot process, which means
early boot doesn't have high quality entropy. This has caused security
problems in the past.

Load entropy data as soon as we can in the early boot process, so that
we can get /dev/random / /dev/urandom into a "random" state earlier.

Bug: 9983133
Change-Id: Id4a6f39e9060f30fe7497bd8f8085a9bec851e80
2013-09-18 07:53:51 -07:00
Mathias Agopian
96675ed91f Fix rotation in camera2 API
Bug: 10804238
Change-Id: I093945789d9c6d373392fc9dfd18ec2c6058d3b9
2013-09-17 23:48:54 -07:00
Nick Kralevich
5535b05120 write_file: introduce O_NOFOLLOW, use sane mask
Don't follow symlinks when writing to a file.
Don't create world-writable files.

Bug: 10802869
Change-Id: Ifb55600d574307a535df878acb3347e02028cd30
2013-09-17 14:46:00 -07:00
Nick Kralevich
3a0d4b3481 Merge "property_service: better validate property names" into klp-dev 2013-09-16 17:27:43 +00:00
Nick Kralevich
6946361421 property_service: better validate property names
Don't allow unexpected characters in property names.
Don't allow double dots in property names.

Bug: 10733330
Change-Id: I8d69740d697efb791f2f201f90989576e13bac81
2013-09-16 09:05:29 -07:00
Rom Lemarchand
c0ce002ae5 Merge "Initial libmemtrack" into klp-dev 2013-09-13 18:24:42 +00:00
Eric Laurent
53dc297dd6 Merge "Add HOTWORD audio source to audio.h" into klp-dev 2013-09-12 00:14:37 +00:00
Rom Lemarchand
67b00d8b2d init.rc: change mem cgroups permissions
Changing mem cgroups permissions to only be accessible by root and system.

Bug: 10210529
Bug: 10210900
Change-Id: Ib4fff6f49b33013b3629d40ae98a5e2464571b2d
2013-09-10 17:41:21 -07:00
Eric Laurent
04c12ca061 Add HOTWORD audio source to audio.h
- This is a complimentary change to the one adding this new source to
  MediaRecorder.java

Bug: 10640877.

Change-Id: Ie213e82b5a60dad2a277cef367c2f5e4df70df06
2013-09-09 15:42:31 -07:00
Todd Poynor
ff9ec2d999 healthd: perform periodic chores when awake and on battery power
Monitor battery/charging status at normal awake rate when on battery
power.

Bug: 10650797
Change-Id: I914d24af4963ab9d52b03c0a2615ad653ced9b12
2013-09-09 14:49:53 -07:00
Colin Cross
fc600e49bf Initial libmemtrack
libmemtrack is an interface to a device-specific Memory Tracker HAL
to account for memory that may not show up in the normal memory
usage tools that walk /proc/pid/maps.

Bug: 10294768
Change-Id: I436f6799898df0bf8bf29747be3bc9dea5721185
2013-09-06 18:18:35 -07:00
Lorenzo Colitti
f34861346d Switch back to subsystem "net" for netlink events.
The change to enable address tracking via netlink incorrectly
changed the subsystem of rtnetlink events from "net" to
"interface". This broke interface add/delete notifications,
which come from the kernel with subsystem "net".

Switch back to "net" and deal with address tracking via new
action codes instead of a new subsystem.

Bug: 10433320
Change-Id: Ibf30efb426949dfd02304cc1d9adb1c005a539a6
2013-09-03 00:25:14 +09:00
Jeff Sharkey
5835ac9e31 Merge "Only check caller when deriving permissions." into klp-dev 2013-08-30 21:03:41 +00:00
Jeff Sharkey
39ff0ae0f6 Only check caller when deriving permissions.
Bug: 10547597
Change-Id: Ied909f9047c2567e93dde0f4658d6e4b9ff161ab
2013-08-30 13:58:13 -07:00
Jeff Sharkey
5856fd8935 Merge "Fix recursive locking bug." into klp-dev 2013-08-30 20:03:19 +00:00
Jeff Sharkey
aa04e818a4 Fix recursive locking bug.
handle_rename() would end up acquiring the lock twice.  Change to
always derive has_rw inside earlier locks (instead of acquiring a
second time), and pass the value into check_caller_access_to_name().

Bug: 10547597
Change-Id: If5744d6d226a4785676c19d0f7fdf1c05060ed76
2013-08-30 10:28:21 -07:00
Alex Klyubin
5f39562466 am aed27f80: am b0739c66: Fix run-as which was broken in Android 4.3
* commit 'aed27f8018e4365aa52a5dd8e89c4db2df0273c5':
  Fix run-as which was broken in Android 4.3
2013-08-28 13:11:00 -07:00
Alex Klyubin
aed27f8018 am b0739c66: Fix run-as which was broken in Android 4.3
* commit 'b0739c662db6a19b49c0912b865edb2853156bda':
  Fix run-as which was broken in Android 4.3
2013-08-28 13:07:48 -07:00
Benoit Goby
7e18e45617 Merge "libusbhost: It's no longer assumed that "bus/usb" exists once "bus" was created" into klp-dev 2013-08-26 21:58:04 +00:00
Michael Wright
2f9c5fd4b9 Merge "Add standard options to readlink" into klp-dev 2013-08-23 23:19:56 +00:00
Jeff Brown
46a24db563 Remove input flinger stubs. (DO NOT MERGE)
Bug: 10446930
Change-Id: I88b926380dbe1e866c0b87ec95b3489d87c5907b
2013-08-22 18:38:35 -07:00
Michael Wright
1e1d29133f Add standard options to readlink
Change-Id: I4c2624d22ce879a3578d5b17440a9895b19e2f1f
2013-08-22 16:38:08 -07:00
Alex Klyubin
b0739c662d 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

(cherry picked from commit f2904a7b63)

Change-Id: I0f6cb9efd49f5c2c491f7aa1d614d700a5ec2304
2013-08-21 12:15:27 -07:00
Ziv Hendel
a306ced1ac libusbhost: It's no longer assumed that "bus/usb" exists once "bus" was created
On some devices there is a slight delay between the creation of "/dev/bus"
and "/dev/bus/usb". Previously, the code assumed that both are created in the
same time which caused "watch_existing_subdirs" to fail and libusbhost to stop
working until the device is rebooted. The fix will setup an inotify event on the
creation of the "bus/usb" so it will not be missed once it's created.

Change-Id: I17f06dd167e61573307425e48898e12ebc954093
2013-08-20 17:51:13 -07:00
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
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
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
Jesse Hall
08380deb24 Merge "Replace sRGB_888 with sRGB_X_8888" into klp-dev 2013-08-16 21:50:21 +00: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
341ed242d4 Merge "Parse IP address changes in NetlinkEvent." into klp-dev 2013-08-16 02:24:12 +00: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
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