Commit Graph

13206 Commits

Author SHA1 Message Date
Adam Lesinski 87b02f23c0 am 4e830641: am 1def25a2: Merge commit \'7ac60686\' into manualmerge
* commit '4e8306419073c93f07c7ac69955d990ffa315d96':
  Prevent integer overflow when allocating native_handle_t
2015-05-28 01:23:09 +00:00
Adam Lesinski 4e83064190 am 1def25a2: Merge commit \'7ac60686\' into manualmerge
* commit '1def25a210ca502a97020efb732775d5c2df2d9a':
  Prevent integer overflow when allocating native_handle_t
2015-05-28 01:03:55 +00:00
Adam Lesinski 1def25a210 Merge commit '7ac60686' into manualmerge
Change-Id: I671a57d906ca6826722fb892627d235b14b822eb
2015-05-27 17:09:14 -07:00
Adam Lesinski 7ac6068636 am 058ad0b6: am e8582d65: am 9bd7afc0: Prevent integer overflow when allocating native_handle_t
* commit '058ad0b6612457c54c7ad6e3b5d5a618d94ae966':
  Prevent integer overflow when allocating native_handle_t
2015-05-27 23:40:35 +00:00
Adam Lesinski 058ad0b661 am e8582d65: am 9bd7afc0: Prevent integer overflow when allocating native_handle_t
* commit 'e8582d65ea03a91b5cdc2c374ec9a420f809138f':
  Prevent integer overflow when allocating native_handle_t
2015-05-27 23:23:19 +00:00
Adam Lesinski e8582d65ea am 9bd7afc0: Prevent integer overflow when allocating native_handle_t
* commit '9bd7afc0a1de9589c13355178b6edc709bd0bddf':
  Prevent integer overflow when allocating native_handle_t
2015-05-27 23:13:06 +00:00
Adam Lesinski 9bd7afc0a1 Prevent integer overflow when allocating native_handle_t
User specified values of numInts and numFds can overflow
and cause malloc to allocate less than we expect, causing
heap corruption in subsequent operations on the allocation.

Bug: 19334482
Change-Id: I43c75f536ea4c08f14ca12ca6288660fd2d1ec55
2015-05-27 10:20:03 -07:00
Iliyan Malchev 2557cd21f0 am 8b448629: am 16092b7a: Merge "fs_mgr: allow for zramsize to be specified as percentage of total memory" into lmp-mr1-dev
* commit '8b4486294053ea96ac50d8c07d4fc23729ef7c52':
  fs_mgr: allow for zramsize to be specified as percentage of total memory
2015-05-12 23:55:40 +00:00
Iliyan Malchev 8b44862940 am 16092b7a: Merge "fs_mgr: allow for zramsize to be specified as percentage of total memory" into lmp-mr1-dev
* commit '16092b7a48e8426515f67206be2f0aee92fd6006':
  fs_mgr: allow for zramsize to be specified as percentage of total memory
2015-05-12 23:41:37 +00:00
Iliyan Malchev 16092b7a48 Merge "fs_mgr: allow for zramsize to be specified as percentage of total memory" into lmp-mr1-dev 2015-05-12 23:25:51 +00:00
Christopher Ferris 6269a95a8f resolved conflicts for merge of b67b92f2 to lmp-mr1-ub-dev
Change-Id: I6aa2ee2c4bf1802e5aa814374f9842a34179ffea
2015-05-07 11:33:55 -07:00
Christopher Ferris b67b92f279 Do not dump maps/memory/code of sibling threads. DO NOT MERGE
Modifies the code so that if the unwind fails, the code still prints
as much data as possible.

Also, for sibling threads, skip printing the maps and memory/code
since it's not likely to be very relevant.

Fix a few cases where extra space is at the end of lines.

Fix an inverted if statement that was checking the wrong condition.

Bug: 18816322
Bug: 20829534

(cherry picked from ab9e7dcef6)

Change-Id: If2d3a734724c23df4192f4dfc6bd69d6729fbc8d
2015-05-07 00:45:55 -07:00
Iliyan Malchev 3ea902f252 fs_mgr: allow for zramsize to be specified as percentage of total memory
If the zramsize entry has a % size at the end, as in the following example:

	/dev/block/zram0 none swap defaults zramsize=25%

then we will set the value as that percentage of total RAM, as read by scanning
/proc/meminfo.

b/20760266 Seed common build allocated too much for zRAM-backed swap

Change-Id: I17c91d311ba99ae7adae112bfe1b38542ea69b80
Signed-off-by: Iliyan Malchev <malchev@google.com>
2015-05-01 23:04:04 -07:00
Nick Kralevich ada332e4a0 am ecf184c9: am 9c9280d8: Merge "init: get rid of the remaining double mounts"
* commit 'ecf184c901b78994773d687763c1478752e9375e':
  init: get rid of the remaining double mounts
2015-04-26 02:11:28 +00:00
Nick Kralevich ecf184c901 am 9c9280d8: Merge "init: get rid of the remaining double mounts"
* commit '9c9280d863d7377858af6e1543ea4ada7af3b0ec':
  init: get rid of the remaining double mounts
2015-04-26 02:00:51 +00:00
Nick Kralevich 9c9280d863 Merge "init: get rid of the remaining double mounts" 2015-04-26 01:51:04 +00:00
Nick Kralevich ec9bd166cc am 45a49d0e: am ccac2be8: Merge "init: use SELinux /dev/null if available"
* commit '45a49d0eb7e2e9fc3d2c48884c84f6a6c7397720':
  init: use SELinux /dev/null if available
2015-04-26 01:39:13 +00:00
Nick Kralevich 45a49d0eb7 am ccac2be8: Merge "init: use SELinux /dev/null if available"
* commit 'ccac2be8a6269469087a7978e1a6db62ef4618c6':
  init: use SELinux /dev/null if available
2015-04-26 01:30:43 +00:00
Nick Kralevich f667a3247a init: get rid of the remaining double mounts
Don't double mount /dev and its subdirectories anymore. Instead, the
first stage init is solely responsible for mounting it.

Don't have init prepare the property space. This is the responsibility
of the second stage init.

Don't have SELinux use the property space to determine how we should
be running. Instead, create a new function and extract the data we
need directly from /proc/cmdline. SELinux needs this information in
the first stage init process where the property service isn't available.

Change-Id: I5b4f3bec79463a7381a68f30bdda78b5cc122a96
2015-04-25 18:29:26 -07:00
Nick Kralevich ccac2be8a6 Merge "init: use SELinux /dev/null if available" 2015-04-26 00:59:01 +00:00
Nick Kralevich e34577ce1b init: use SELinux /dev/null if available
SELinux provides it's own /dev/null character device at
/sys/fs/selinux/null. This character device is exactly the same
as /dev/null, including the same major/minor numbers, and can
be used wherever /dev/null is used.

Use /sys/fs/selinux/null instead of trying to create our own
/dev/__null__ device. This moves us one step closer to eliminating
all uses of mknod() by init.

/sys/fs/selinux/null is only available once the /sys/fs/selinux filesystem
is mounted. It's not available to the first stage init, so we
still have to fall back to mknod then.

Change-Id: Ic733767ea6220a130537de33cc478ae79578ce20
2015-04-25 16:48:23 -07:00
Nick Kralevich 1c2457ffda am b31c3a5a: am 178299fd: Merge "init: don\'t double mount /proc and /sys"
* commit 'b31c3a5a453cd9f472698068af9909e80a96ab2c':
  init: don't double mount /proc and /sys
2015-04-25 23:28:45 +00:00
Nick Kralevich 2ae7d4eefd am 6b6df173: am f8b0743e: Merge "init: fix write_file checkreqprot logic error"
* commit '6b6df1733711ace006e0f4f9d44c718f85d2f70d':
  init: fix write_file checkreqprot logic error
2015-04-25 23:28:44 +00:00
Elliott Hughes 4f790e3714 am ecd6e36d: am 47a9ef2f: Merge "Improve logging of USBDEVFS_CLAIMINTERFACE failures."
* commit 'ecd6e36d37d2e1fcc021762baaff417c94920dd4':
  Improve logging of USBDEVFS_CLAIMINTERFACE failures.
2015-04-25 23:28:43 +00:00
Nick Kralevich b31c3a5a45 am 178299fd: Merge "init: don\'t double mount /proc and /sys"
* commit '178299fd459b7622e9e3de05a48d6ba050f92bec':
  init: don't double mount /proc and /sys
2015-04-25 23:16:49 +00:00
Nick Kralevich 6b6df17337 am f8b0743e: Merge "init: fix write_file checkreqprot logic error"
* commit 'f8b0743ef418c15fe622143a6b4b42b102a07803':
  init: fix write_file checkreqprot logic error
2015-04-25 23:16:48 +00:00
Elliott Hughes ecd6e36d37 am 47a9ef2f: Merge "Improve logging of USBDEVFS_CLAIMINTERFACE failures."
* commit '47a9ef2f116fd885a3ba0e9027a45b2a68cc5b3f':
  Improve logging of USBDEVFS_CLAIMINTERFACE failures.
2015-04-25 23:16:46 +00:00
Nick Kralevich 178299fd45 Merge "init: don't double mount /proc and /sys" 2015-04-25 23:11:27 +00:00
Nick Kralevich f8b0743ef4 Merge "init: fix write_file checkreqprot logic error" 2015-04-25 23:09:08 +00:00
Elliott Hughes 47a9ef2f11 Merge "Improve logging of USBDEVFS_CLAIMINTERFACE failures." 2015-04-25 23:05:28 +00:00
Nick Kralevich 9dec93bfeb init: don't double mount /proc and /sys
The first stage init mounts /proc and /sys, and then the second
stage init also mounts /proc and /sys on top of the existing mount.
Only mount these two directories once, in the first stage init.

Not yet fixed: the double mounting of /dev. Removing the double
mounting doesn't work right now because both init stages are trying
to create a property space, and if the double mount of /dev goes away,
the property service in the second stage init fails to work.

Change-Id: I13719027a47526d074390c2b1a605ad99fb43a8f
2015-04-25 15:50:03 -07:00
Nick Kralevich eedbe81f75 init: fix write_file checkreqprot logic error
write_file() returned -errno on error, not -1. Callers who check for
-1 would falsely believe that the write was successful when it wasn't.
Fixup write_file so that it return -1 on error consistent
with other functions.

Change-Id: Ic51aaf8678d8d97b2606bd171f11b3b11f642e39
2015-04-25 15:36:13 -07:00
Elliott Hughes ce6363bbbc Improve logging of USBDEVFS_CLAIMINTERFACE failures.
Bug: https://code.google.com/p/android/issues/detail?id=170054
Change-Id: I9b11eb019093e3322da0a8e70d6e17de4c25ab75
2015-04-25 14:44:23 -07:00
Nick Kralevich 04faed7aba am ecfb3664: am 8929c77a: Merge "init: remove mkdir /dev /proc /sys"
* commit 'ecfb3664fea6cbe39d94459ceb06a91f57006820':
  init: remove mkdir /dev /proc /sys
2015-04-25 21:30:45 +00:00
Nick Kralevich ecfb3664fe am 8929c77a: Merge "init: remove mkdir /dev /proc /sys"
* commit '8929c77ab9aa9be612291809669e9162837c54ae':
  init: remove mkdir /dev /proc /sys
2015-04-25 21:19:17 +00:00
Nick Kralevich 8929c77ab9 Merge "init: remove mkdir /dev /proc /sys" 2015-04-25 21:08:12 +00:00
Nick Kralevich a1f6a4b139 init: remove mkdir /dev /proc /sys
These directories are already present in the initial ramdisk, and
these mkdir calls are no-ops.

Change-Id: I528f9e96a3471de904845a2f9e09c1b6ff83a708
2015-04-25 13:48:26 -07:00
Elliott Hughes 893981c977 am cd58f488: am 6ce5625d: Merge "Improve toolbox SIGPIPE behavior."
* commit 'cd58f488c263f5a1db9f7491d2aa062240765a6c':
  Improve toolbox SIGPIPE behavior.
2015-04-25 19:37:19 +00:00
Elliott Hughes cd58f488c2 am 6ce5625d: Merge "Improve toolbox SIGPIPE behavior."
* commit '6ce5625d58c2376b719802a0ae0b56bcd3afcdc8':
  Improve toolbox SIGPIPE behavior.
2015-04-25 19:26:23 +00:00
Elliott Hughes 6ce5625d58 Merge "Improve toolbox SIGPIPE behavior." 2015-04-25 19:14:54 +00:00
Elliott Hughes 5976018b4a Improve toolbox SIGPIPE behavior.
None of our tools -- except for top, which I'd fixed previously --
handles SIGPIE correctly. Let's just handle SIGPIPE in the driver.

Bug: https://code.google.com/p/android/issues/detail?id=157920
Change-Id: I322ea411f53c71585a64118c217d54389f675d4e
2015-04-25 12:03:41 -07:00
Elliott Hughes 75e18f3bce am 5281a2a8: am 9798023e: Merge "Add ReadFully and WriteFully to libbase."
* commit '5281a2a8e9df51cc7c5c17400dbeae6983818a38':
  Add ReadFully and WriteFully to libbase.
2015-04-25 05:21:45 +00:00
Elliott Hughes 2b57981b05 am ae3154e3: am 2899c94b: Merge "Switch init to epoll."
* commit 'ae3154e3968e991fb1e9a6b47bedd1e0819f7925':
  Switch init to epoll.
2015-04-25 05:21:43 +00:00
Elliott Hughes 5281a2a8e9 am 9798023e: Merge "Add ReadFully and WriteFully to libbase."
* commit '9798023e9f646a51222b5fd4683c91bfbfc5167f':
  Add ReadFully and WriteFully to libbase.
2015-04-25 05:11:00 +00:00
Elliott Hughes ae3154e396 am 2899c94b: Merge "Switch init to epoll."
* commit '2899c94b9d962c308ef71ee10809c61ac39e0ce5':
  Switch init to epoll.
2015-04-25 05:10:59 +00:00
Elliott Hughes 9798023e9f Merge "Add ReadFully and WriteFully to libbase." 2015-04-25 05:01:21 +00:00
Elliott Hughes 2899c94b9d Merge "Switch init to epoll." 2015-04-25 05:01:03 +00:00
Elliott Hughes 56085edbf8 Add ReadFully and WriteFully to libbase.
Change-Id: I6b7aa2a93398e7acdd1d74c71d9abed08a72b3c4
2015-04-24 21:57:16 -07:00
Elliott Hughes 929f407076 Switch init to epoll.
Not just because it's what the cool kids are doing --- it also lets us
simplify the inner loop and decouple it from whatever systems want to
be woken to perform some activity if there's data to be read on some fd.

Currently this is just used to clean up the existing signal handling,
keychord, and property service code.

Change-Id: I4d7541a2c4386957ad877df69e3be08b96a7dec5
2015-04-24 21:13:44 -07:00
Elliott Hughes 52e5e55cac am 0a4f0be2: am df5d4482: Merge "Clean up property service initialization."
* commit '0a4f0be2aaf697ca4b0938b31fc19bb007e87d0d':
  Clean up property service initialization.
2015-04-25 02:57:36 +00:00