OSDN Git Service
Chih-Wei Huang [Fri, 12 May 2017 04:04:48 +0000 (12:04 +0800)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Chih-Wei Huang [Fri, 12 May 2017 04:03:38 +0000 (12:03 +0800)]
Revert "Set correct permission for pppd"
It causes mtpd can't run pppd.
This reverts commit
3ee3ce44411ace96f3bc9450318834a25a5869fb.
Reported-By: Xuefer H <xuefer@gmail.com>
Chih-Wei Huang [Thu, 27 Apr 2017 15:51:50 +0000 (23:51 +0800)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Chih-Wei Huang [Thu, 27 Apr 2017 15:51:15 +0000 (23:51 +0800)]
Merge remote-tracking branch 'LineageOS/cm-13.0' into cm-13.0-x86
Xuefer [Thu, 27 Apr 2017 15:37:06 +0000 (23:37 +0800)]
init sysclktz: fix clock without local hack
Change-Id: I96ce84a20c0ed3159acf7e141fa2e79f6860abf9
Signed-off-by: Xuefer <xuefer@gmail.com>
Chih-Wei Huang [Thu, 23 Mar 2017 15:07:51 +0000 (23:07 +0800)]
Merge tag 'android-6.0.1_r79' into marshmallow-x86
Android 6.0.1 release 79
Harry Youd [Sun, 5 Feb 2017 11:06:37 +0000 (11:06 +0000)]
debuggerd: Rebrand tombstone header to LineageOS
Change-Id: Idd08c2eb7e395b464b1510742bf52833f465db08
(cherry picked from commit
4a427dfce617e1c3cc8b85b7196be24b495d9f4e)
Chih-Wei Huang [Mon, 16 Jan 2017 15:30:16 +0000 (23:30 +0800)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Chih-Wei Huang [Mon, 16 Jan 2017 15:30:10 +0000 (23:30 +0800)]
Merge remote-tracking branch 'cm/cm-13.0' into cm-13.0-x86
Chih-Wei Huang [Tue, 10 Jan 2017 04:24:43 +0000 (12:24 +0800)]
Merge tag 'android-6.0.1_r74' into marshmallow-x86
Android 6.0.1 release 74
Tianjie Xu [Wed, 21 Sep 2016 21:58:11 +0000 (14:58 -0700)]
Fix out of bound access in libziparchive
The boundary check of an invalid EOCD record may succeed due to the
overflow of uint32_t. Fix the check.
Test: Open the crash.apk and libziparchive reports the offset error as expected.
CYNGNOS-3312
Bug:
31251826
Change-Id: I1d8092a19b73886a671bc9d291cfc27d65e3d236
(cherry picked from commit
ae8180c06dee228cd1378c56afa6020ae98d8a24)
(cherry picked from commit
1ee4892e66ba314131b7ecf17e98bb1762c4b84c)
(cherry picked from commit
7f246f7fdd2f003c6f3701f599052a2040af6bfb)
Michael W [Sun, 13 Nov 2016 12:03:50 +0000 (13:03 +0100)]
init: Fix possible open file pointer
In error case the file is not closed properly.
Add close() before return
Change-Id: Ie1755987859a576045c786105404957d94f0b39d
Jessica Wagantall [Tue, 8 Nov 2016 23:13:05 +0000 (15:13 -0800)]
Merge tag 'android-6.0.1_r74' into HEAD
CYNGNOS-3303
Android 6.0.1 release 74
Change-Id: I2dade45f30d4ca2fa8c6efa5c7242de1a02f5c15
Tianjie Xu [Wed, 21 Sep 2016 21:58:11 +0000 (14:58 -0700)]
Fix out of bound access in libziparchive
The boundary check of an invalid EOCD record may succeed due to the
overflow of uint32_t. Fix the check.
Test: Open the crash.apk and libziparchive reports the offset error as expected.
Bug:
31251826
Change-Id: I1d8092a19b73886a671bc9d291cfc27d65e3d236
(cherry picked from commit
ae8180c06dee228cd1378c56afa6020ae98d8a24)
(cherry picked from commit
1ee4892e66ba314131b7ecf17e98bb1762c4b84c)
Jessica Wagantall [Thu, 6 Oct 2016 18:50:35 +0000 (11:50 -0700)]
Merge tag 'android-6.0.1_r72' into HEAD
Android 6.0.1 Release 72 (M4B30X)
# gpg: Signature made Tue 04 Oct 2016 09:47:47 AM PDT using DSA key ID
9AB10E78
# gpg: Can't check signature: public key not found
Chih-Wei Huang [Thu, 29 Sep 2016 03:32:06 +0000 (11:32 +0800)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Conflicts:
init/devices.cpp
init/init.cpp
Chih-Wei Huang [Tue, 27 Sep 2016 11:14:12 +0000 (19:14 +0800)]
ueventd: defer modules loading if explicitly listed
The patch extends the syntax of /etc/modules.blacklist.
The modules marked as deferred in this file will be loaded
after all other modules are loaded at coldboot stage.
Mark Salyzyn [Tue, 23 Aug 2016 17:23:36 +0000 (10:23 -0700)]
liblog: add __android_log_close()
Bug:
30963384
(cherry picked from commit
df7a4c6bae5f85532d79a93b7d9197a2aab17825)
Change-Id: Ide70df3c04e29301649a1ca234b1b0af687bcbfb
(cherry picked from commit
b1b5d507cba4b37221016d308dbf9fdd39019108)
Mark Salyzyn [Tue, 23 Aug 2016 17:23:36 +0000 (10:23 -0700)]
liblog: add __android_log_close()
Bug:
30963384
(cherry picked from commit
df7a4c6bae5f85532d79a93b7d9197a2aab17825)
Change-Id: I2255486e84dd55af0f4e7fbbfb616c2deb1765d0
(cherry picked from commit
2d149691552676968b7de337f543463b920578b0)
Chih-Wei Huang [Tue, 27 Sep 2016 14:08:09 +0000 (22:08 +0800)]
Merge remote-tracking branch 'cm/cm-13.0' into cm-13.0-x86
Chih-Wei Huang [Fri, 23 Sep 2016 09:59:47 +0000 (17:59 +0800)]
init: set default value of ro.hardware to the target name
People usually forget to set the value of androidboot.hardware to
the target name in kernel cmdline which results in boot failure.
The change tries to reduce such an error in the future. The target
name is hardcoded to the image. This eliminates the necessity of
androidboot.hardware.
c457 [Thu, 22 Sep 2016 23:49:34 +0000 (18:49 -0500)]
fastboot: Add Alcatel's USB vendor id
Change-Id: Ic4f127c8dcd5db0c039491128862b791197f5c84
Chih-Wei Huang [Wed, 21 Sep 2016 05:45:29 +0000 (13:45 +0800)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Jaap Jan Meijer [Wed, 14 Sep 2016 19:23:21 +0000 (21:23 +0200)]
Merge remote-tracking branch 'cm/cm-13.0' into cm-13.0-x86
Conflicts:
adb/sockets.cpp
Jaap Jan Meijer [Wed, 14 Sep 2016 19:01:34 +0000 (21:01 +0200)]
init: revert using fsck -a for boot time optimisation
This is causing the data partition to get dirty / damaged very regularly
and make the data partition to be mounted ro.
This is a combination of 2 commits:
Revert "init: Allow devices to opt-out of fsck'ing on power off"
This reverts commit
516d6913dc5acd695581b3999fab0b5192353022.
Revert "Use fsck.f2fs -a instead of -f for faster boot"
This reverts commit
784c22c8388e50db243ac4ca3871747cd3eefadc.
Conflicts:
init/builtins.cpp
Jessica Wagantall [Wed, 7 Sep 2016 20:30:24 +0000 (13:30 -0700)]
Merge tag 'android-6.0.1_r66' into HEAD
Android 6.0.1 release 66
Change-Id: I5ccc6e68283e30b8d0419eb7512c7183e58ec5ed
Chih-Wei Huang [Wed, 7 Sep 2016 06:06:47 +0000 (14:06 +0800)]
Merge tag 'android-6.0.1_r66' into marshmallow-x86
Android 6.0.1 release 66
Chih-Wei Huang [Wed, 7 Sep 2016 06:06:40 +0000 (14:06 +0800)]
Revert "adb: sockets: fix race condition between input_thread and fdevent callback"
This reverts commit
3e872c4ce7d83fee2673694644559f6fa9bdcbe0.
Jaap Jan Meijer [Fri, 2 Sep 2016 12:08:02 +0000 (14:08 +0200)]
Merge remote-tracking branch 'cm/cm-13.0' into cm-13.0-x86
Scott Mertz [Mon, 29 Aug 2016 18:32:32 +0000 (11:32 -0700)]
libutils: fix deadlock in elapsedRealtimeNano
If n > 2 threads all lock the mutex awaiting the clock method to
be set, the 1st thread will first set the method and unlock. The
2nd thread will then take the mutex, but never unlock because the
clock_method has already been updated by the 1st thread. This causes
a deadlock for threads 3-n.
Solution is to ensure the calling thread always unlocks the mutex if
it has previously locked it.
Log:
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x733313b0 self=0xb4cf6500
| sysTid=12786 nice=0 cgrp=default sched=0/0 handle=0xb6f86b44
| state=S schedstat=(
41990410 32985836 80 ) utm=3 stm=1 core=2 HZ=100
| stack=0xbe5fb000-0xbe5fd000 stackSize=8MB
| held mutexes=
native: #00 pc
00017638 /system/lib/libc.so (syscall+28)
native: #01 pc
0003ffa5 /system/lib/libc.so (_ZL33__pthread_mutex_lock_with_timeoutP24pthread_mutex_internal_tPK8timespeci+504)
native: #02 pc
000400a9 /system/lib/libc.so (pthread_mutex_lock+26)
native: #03 pc
0000fa01 /system/lib/libutils.so (_ZN7android19elapsedRealtimeNanoEv+16)
native: #04 pc
0000fb1f /system/lib/libutils.so (_ZN7android15elapsedRealtimeEv+2)
native: #05 pc
00214d1d /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_os_SystemClock_elapsedRealtime__+72)
"Thread-6372" prio=5 tid=9 Native
| group="main" sCount=1 dsCount=0 obj=0x32c05120 self=0xacb58100
| sysTid=12829 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0xb38c3930
| state=S schedstat=( 869427
8219115 17 ) utm=0 stm=0 core=2 HZ=100
| stack=0xb37c1000-0xb37c3000 stackSize=1038KB
| held mutexes=
native: #00 pc
00017638 /system/lib/libc.so (syscall+28)
native: #01 pc
0003ffa5 /system/lib/libc.so (_ZL33__pthread_mutex_lock_with_timeoutP24pthread_mutex_internal_tPK8timespeci+504)
native: #02 pc
000400a9 /system/lib/libc.so (pthread_mutex_lock+26)
native: #03 pc
0000fa01 /system/lib/libutils.so (_ZN7android19elapsedRealtimeNanoEv+16)
native: #04 pc
0000fb1f /system/lib/libutils.so (_ZN7android15elapsedRealtimeEv+2)
native: #05 pc
00214d1d /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_os_SystemClock_elapsedRealtime__+72)
HAM-1470
Change-Id: I41874d2b0ea034a35a74da030398231089c15cde
Connor O'Brien [Fri, 12 Aug 2016 18:52:46 +0000 (11:52 -0700)]
Fix vold vulnerability in FrameworkListener
Modify FrameworkListener to ignore commands that exceed the maximum
buffer length and send an error message.
Bug:
29831647
Change-Id: I9e57d1648d55af2ca0191bb47868e375ecc26950
Signed-off-by: Connor O'Brien <connoro@google.com>
(cherry picked from commit
baa126dc158a40bc83c17c6d428c760e5b93fb1a)
(cherry picked from commit
470484d2a25ad432190a01d1c763b4b36db33c7e)
Connor O'Brien [Fri, 12 Aug 2016 18:52:46 +0000 (11:52 -0700)]
Fix vold vulnerability in FrameworkListener
Modify FrameworkListener to ignore commands that exceed the maximum
buffer length and send an error message.
Bug:
29831647
Change-Id: I9e57d1648d55af2ca0191bb47868e375ecc26950
Signed-off-by: Connor O'Brien <connoro@google.com>
(cherry picked from commit
baa126dc158a40bc83c17c6d428c760e5b93fb1a)
(cherry picked from commit
470484d2a25ad432190a01d1c763b4b36db33c7e)
Josh Gao [Tue, 9 Aug 2016 22:29:58 +0000 (15:29 -0700)]
debuggerd: fix missed use of ptrace(PTRACE_ATTACH).
Bug: http://b/
29555636
Change-Id: Ibd8a2e2b619b74aac667555b7085d6f28e367c07
Josh Gao [Thu, 14 Jul 2016 23:43:12 +0000 (16:43 -0700)]
DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
Fix two races in debuggerd's PTRACE_ATTACH logic:
1. The target thread in a crash dump request could exit between the
/proc/<pid>/task/<tid> check and the PTRACE_ATTACH.
2. Sibling threads could exit between listing /proc/<pid>/task and the
PTRACE_ATTACH.
Backport of NYC change I4dfe1ea30e2c211d2389321bd66e3684dd757591
Bug: http://b/
29555636
Change-Id: I6c6efcf82a49bca140d761b2d1de04215ba4d252
Josh Gao [Wed, 18 May 2016 17:39:48 +0000 (10:39 -0700)]
adb: use asocket's close function when closing.
close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.
Bug: http://b/
28347842
Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e
(cherry picked from commit
53eb31d87cb84a4212f4850bf745646e1fb12814)
(cherry picked from commit
014b01706cc64dc9c2ad94a96f62e07c058d0b5d)
Josh Gao [Wed, 18 May 2016 02:23:39 +0000 (19:23 -0700)]
adb: switch the socket list mutex to a recursive_mutex.
sockets.cpp was branching on whether a socket close function was
local_socket_close in order to avoid a potential deadlock if the socket
list lock was held while closing a peer socket.
Bug: http://b/
28347842
Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3
(functionally a cherrypick of
903b749f +
9b587dec, with windows disabled)
Sergio Giro [Tue, 28 Jun 2016 17:02:29 +0000 (18:02 +0100)]
libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.
Correcting the length computation and adding bound checks to the
conversion functions.
Test: ran libutils_tests
Bug:
29250543
Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb
(cherry picked from commit
c4966a363e46d2e1074d1a365e232af0dcedd6a1)
Jaap Jan Meijer [Mon, 15 Aug 2016 20:34:08 +0000 (22:34 +0200)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Conflicts:
init/init.cpp
Chih-Wei Huang [Sun, 14 Aug 2016 04:42:40 +0000 (12:42 +0800)]
ueventd: load all modules with the matched alias
Originally we only load the first module with the matched alias.
It causes some necessary modules are not loaded.
Chih-Wei Huang [Sun, 14 Aug 2016 03:23:20 +0000 (11:23 +0800)]
init: enlarge the time to wait coldboot done
We need more time to probe and load all modules.
If 10s is still not enough for you, let me know.
Josh Gao [Tue, 9 Aug 2016 22:29:58 +0000 (15:29 -0700)]
debuggerd: fix missed use of ptrace(PTRACE_ATTACH).
Bug: http://b/
29555636
Change-Id: Ibd8a2e2b619b74aac667555b7085d6f28e367c07
Jaap Jan Meijer [Mon, 8 Aug 2016 16:22:42 +0000 (18:22 +0200)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Conflicts:
adb/services.cpp
fs_mgr/fs_mgr.c
fs_mgr/fs_mgr_format.c
healthd/BatteryMonitor.cpp
init/devices.cpp
init/ueventd.cpp
Jaap Jan Meijer [Mon, 8 Aug 2016 10:47:09 +0000 (12:47 +0200)]
Merge remote-tracking branch 'cm/cm-13.0' into cm-13.0-x86
Conflicts:
toolbox/lsof.c
Chih-Wei Huang [Wed, 3 Aug 2016 07:19:26 +0000 (15:19 +0800)]
Merge tag 'android-6.0.1_r61' into marshmallow-x86
Android 6.0.1 Release 61 (MOB30Z)
Jessica Wagantall [Tue, 2 Aug 2016 18:12:41 +0000 (11:12 -0700)]
Merge tag 'android-6.0.1_r61' into HEAD
Android 6.0.1 Release 61 (MOB30Z)
Change-Id: I84413f1198957a53433955e617a7226639262f40
Chih-Wei Huang [Fri, 29 Jul 2016 12:54:42 +0000 (20:54 +0800)]
ueventd: refactory module and firmware loading mechanism
Currently each module and firmware loading event is forked to
a child process to handle. It may cause some race conditions.
Now we fork ueventd into two processes. The parent process handles
normal uevents including modules loading, while the child process
only handles firmware loading events. All events are handled
sequentially.
Chih-Wei Huang [Fri, 29 Jul 2016 11:49:58 +0000 (19:49 +0800)]
init.rc: symlink /lib to /system/lib
Currently more linux drivers use request_firmware_nowait() to load
firmwares. It requires the firmwares exist in the standard path.
Create the symlink before ueventd started to ensure firmwares
could be loaded correctly.
Biao Lu [Thu, 28 Jan 2016 08:10:54 +0000 (16:10 +0800)]
init: Fix load_firmware error
In function 'load_firmware', parameter 'buf' passed to 'write'
is wrong. To fix it, use android::base::WriteFully to replace.
Change-Id: I13f79bdc9be9e5eb669f6bd975535b1dce965ef0
Signed-off-by: Biao Lu <biao.lu@intel.com>
Steve Kondik [Thu, 28 Jul 2016 19:17:40 +0000 (12:17 -0700)]
healthd: Add DASH charger type
Change-Id: Ie1ca5018c465f6b2c15cbc00bdf3bb866d98ddef
Jaap Jan Meijer [Tue, 26 Jul 2016 19:05:14 +0000 (21:05 +0200)]
Merge remote-tracking branch 'x86/marshmallow-x86' into cm-13.0-x86
Conflicts:
init/builtins.cpp
init/devices.cpp
init/init.cpp
libcutils/fs_config.c
libdiskconfig/Android.mk
libpixelflinger/tests/codegen/Android.mk
toolbox/lsof.c
Chih-Wei Huang [Mon, 23 Nov 2015 09:57:37 +0000 (17:57 +0800)]
init: expand variables on mount_all command
This allows mount_all to handle fstab.${ro.hardware} instead
of hardcoding the file name.
Chih-Wei Huang [Mon, 28 Sep 2015 02:48:43 +0000 (10:48 +0800)]
android_filesystem: enable houdini executables
Mark Salyzyn [Wed, 16 Sep 2015 22:34:00 +0000 (15:34 -0700)]
logd: update region lock after entry has passed to reader socket
- The reader region level indicates the location to protect, but once
it has been passed to the calling reader, then allow us to go
one beyond so that a clear or prune thread can remove the entry.
Bug:
23711431
Change-Id: I0f2389858dd8c83366c034360f67d7c363625b56
Chih-Wei Huang [Thu, 10 Sep 2015 16:39:13 +0000 (00:39 +0800)]
libcutils: refine probe_module
Make the code be more elegant and fix the realloc bug.
Mark Salyzyn [Tue, 8 Sep 2015 18:24:07 +0000 (11:24 -0700)]
logd: increase dgram_max_qlen to 600
Seeing liblog messages on system_server runtime restart
(too much system_server spam, 566 messages in 72ms)
Bug:
23788621
Change-Id: I5171f2c19a3538da190fc6c2b40e978d89bf0e20
Mark Salyzyn [Tue, 8 Sep 2015 14:57:27 +0000 (07:57 -0700)]
liblog: logprint: printable nul
Change-Id: I57d1f86ce040ad196c558bb72ac0464af793c214
Chih-Wei Huang [Wed, 2 Sep 2015 17:33:26 +0000 (01:33 +0800)]
init: add modprobe to load kernel requested modules
Chih-Wei Huang [Fri, 3 Apr 2015 12:36:39 +0000 (20:36 +0800)]
init.rc: fix for "add_tid_to_cgroup failed to write" warnings
I still don't understand why only 0660 works.
Chih-Wei Huang [Thu, 14 Feb 2013 14:01:11 +0000 (22:01 +0800)]
ueventd: load modules in a forked process
Loading some modules (e.g., ath3k) will be blocked to wait for
firmware. The forking is necessary, otherwise ueventd has no
chance to load the firmware.
Chih-Wei Huang [Wed, 6 Feb 2013 12:52:34 +0000 (20:52 +0800)]
allow to load modules from standard module path
Chih-Wei Huang [Wed, 29 Oct 2014 15:25:57 +0000 (23:25 +0800)]
init.rc: let some services run as root
The surfaceflinger needs root permission to control vt.
Run the console shell as root to make debugging easier.
Chih-Wei Huang [Fri, 8 Aug 2014 10:17:04 +0000 (18:17 +0800)]
libutils: fix incorrect calculation in utf8_length() method
The first character of utf-8 could be larger than 128. If use signed char
variable to hold it, it would be treated as negative. That may result in
some unexpected errors.
For example, without this patch, suppose the code is 0xE88888, then
first_char is 0xE8 and converted to int32_t type (0xFFFFFFE8) and
masked with (~to_ignore_mask). The result utf32 is
FFF08208
which is incorrect.
Change-Id: I72b355f380865bc375251eb287fc225fd585a115
Chih-Wei Huang [Sun, 29 Apr 2012 07:04:55 +0000 (15:04 +0800)]
Set correct permission for pppd
The pppd needs setuid root to setup ppp interface.
Chih-Wei Huang [Sun, 1 Jan 2012 19:16:41 +0000 (03:16 +0800)]
init: avoid virtual console be set blanked
Chih-Wei Huang [Tue, 1 Feb 2011 07:47:03 +0000 (15:47 +0800)]
init: change firmware_dirs for Android-x86
Chih-Wei Huang [Sat, 15 Jan 2011 22:44:37 +0000 (06:44 +0800)]
ueventd.rc: remove redundant definitions
Change-Id: Icb4f051abf941052aca9752ca2949386738d94e5
Chih-Wei Huang [Sat, 15 Jan 2011 22:25:37 +0000 (06:25 +0800)]
init.rc: use relative path for symlink
Usually it's better to use relative path for symlink. For example,
to use Android in a chroot environment, the absolute symlink will
fail outside the chroot environment. Using relative path guarantees
the link will work both inside and outside chroot.
Change-Id: I2f654a05189b9a666aed1fc7bdfb5a50357aff78
Irina Patru [Fri, 22 Aug 2014 12:18:49 +0000 (15:18 +0300)]
UPSTREAM_PENDING newfs_msdos: Handle alignment failure
When trying to create a new FAT32 file system using alignment, the resulted
MBR structure is corrupted, because the total sectors reported does not
correspond to the actual available sectors. This is due to the reserved
sectors field which is updated during the alignment.
When fsck_msdos will try to check this file system, it will fail because it
cannot match the reported sectors with the actual available sectors.
Due to the failed check, the file system cannot be mounted by vold.
I/fsck_msdos( 2180): FAT size too small, 242822 entries won't fit into 1897 sectors
I/fsck_msdos( 2180): fsck_msdos terminated by exit(8)
E/Vold ( 2180): Filesystem check failed (unknown exit code 8)
E/Vold ( 2180): /dev/block/vold/179:49 failed FS checks (I/O error)
D/Vold ( 2180): Volume sdcard1 state changing 3 (Checking) -> 1 (Idle-Unmounted)
In order to fix this issue, we will save the initial bpb structure and restore
it if the alignment fails.
Change-Id: I58d5078551c689b28c9070585bb330c45bab9c62
Signed-off-by: Irina Patru <irina.patru@intel.com>
Reviewed-on: https://android.intel.com/256992
Reviewed-by: Dolca, Robert <robert.dolca@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Popa, Valentin <valentin.popa@intel.com>
Samuel Ortiz [Thu, 17 Jul 2014 23:35:29 +0000 (01:35 +0200)]
devices: Increase the uevent socket buffer size
Depending on the timing, hald may start while ueventd is not done yet
with its initial coldboot. As hald also independently starts its own
coldboot, ueventd netlink socket buffer could get filled quickly and
thus ueventd could lose some uevents.
This is fixed by increasing the ueventd netlink socket buffer size.
Change-Id: Ie92f77c14099421740b3984f1cc23f813287b78f
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Reviewed-on: https://android.intel.com/219843
Reviewed-by: Escande, Thierry <thierry.escande@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Ortiz, Samuel <samuel.ortiz@intel.com>
Tested-by: Ortiz, Samuel <samuel.ortiz@intel.com>
Tested-by: cactus <cactus@intel.com>
Reviewed-by: Porlan, Patrick <patrick.porlan@intel.com>
Reviewed-by: Bianti, Sebastien <sebastien.bianti@intel.com>
Reviewed-by: Mahalingam, Ganesh <ganesh.mahalingam@intel.com>
Tested-by: Mahalingam, Ganesh <ganesh.mahalingam@intel.com>
Andrew Boie [Fri, 12 Oct 2012 22:23:40 +0000 (15:23 -0700)]
init: Add 'readprops' command
This reads the contents of a text file and sets system properties
based on its contents.
Change-Id: Ic03de7ee9afb8a12439d0dff343560011e152beb
For: AXIA-102
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Andrew Boie [Thu, 12 Jul 2012 22:39:25 +0000 (15:39 -0700)]
adb: reserve a wakelock when clients are connected over socket
USB OTG connections already have a wakelock reserved, but if a network
socket connection is made, the device can unexpectedly suspend
in the middle of a session. The lock is released when the client
disconnects.
Change-Id: Id5ac01699fab9350955c9814042259542fc6a694
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Jianxun Zhang [Mon, 2 Jul 2012 18:32:30 +0000 (11:32 -0700)]
add modprobe-like capability and automatic ueventd loading
Author: Jianxun Zhang <jianxun.zhang@intel.com>
Author: Daniel Leung <daniel.leung@intel.com>
Author: Andrew Boie <andrew.p.boie@intel.com>
- insmod_by_dep() added to libcutils; loads a module into kernel.
Modules the target module depends on will be loaded first. Loading
will be stopped when an error occurs.
- rmmod_by_dep() added to libcutils; removes a module from kernel.
It also tries to remove other modules the target module depends
on until an error occurs.
- Implement wildcard matching for ueventd rules.
The PCI and USB addresses for devices can change from devices
from devices for a particular class of peripheral, for example,
bluetooth. The ueventd rules created with these addresses are
then device-specific.
This changes the way ueventd rules with wildcard are handled.
Instead of matching just the prefix with a trailing wildcard,
now these rules can have wildcard anywhere in the rule.
The wildcard matching is implemented using fnmatch(), where
its matching is simliar to shell pathname expansion. It suits
this particular usage model well.
For example, instead of creating a rule to match:
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/rfkill*
, this would suffice:
/sys/devices/*/bluetooth/hci0/rfkill*
- Let ueventd auto-load kernel modules. Implements the functionality
for ueventd to auto-load kernel modules when uevents are triggered.
Since /system may not be mounted when uevents are fired,
a deferred loading mechanism is implemented. Once mapping of
module and alias is available, these modules are then loaded.
Modules can also be blacklisted so they will not be loaded
automatically. One example would be the Wifi driver, as
Android's has to control its loading and unloading.
- add 'probemod' builtin command. This command accepts the name of a
kernel module plus a set of command line arguments. The module will
be loaded, along with all its dependencies, using the libcutils
insmod_by_dep() API.
- Drivers in kernel can request modules by launching a program in
user space, the program's path by default is "/sbin/modprobe".
Because Android system has no modprobe and ueventd is the only
program handling the module aliases so far, This patch provides a
cheap approach to handle kernel's requests in ueventd executable.
- Add new builtin init command "coldboot". The main purpose is to
provide an approach in init.*.rc files to fire uevents for devices
under the path which is passed as the the argument. This should be
called after /system is mounted so any queued events that need to
load a module can be fired.
Andrew P. Boie [Fri, 31 Aug 2012 19:05:55 +0000 (12:05 -0700)]
libdiskconfig: Enable Mac OS X host build
Change-Id: Iacc7d5463364d0cd15ca9fabaa58ad05857d9e78
Signed-off-by: Andrew P. Boie <andrew.p.boie@intel.com>
Andrew Boie [Fri, 11 Nov 2011 01:58:05 +0000 (17:58 -0800)]
diskconfig: Fix disk_layout.conf size parsing
If the user was appending 'K' to their lengths (which is valid
but redundant) it was being treated as megabytes instead of
kilobytes.
Change-Id: I979ec4d01f1342de1f3209b946201ca87bad32a7
Paul Drews [Mon, 20 Jun 2011 17:01:24 +0000 (10:01 -0700)]
Use progressive offset in buffer for successive writes
The code for copying from one raw file to another looped
back and tried again with a suitably smaller number of bytes
if the entire buffer was not written on the first try.
However, it failed to advance an offset in the buffer past
the bytes that were written. This could conceivably happen
under rare circumstances, leading to a corrupted disk image.
This fix defines an offset into the buffer, advancing it by
the number of bytes written on each successive retry.
Signed-off-by: Paul Drews <paul.drews@intel.com>
Change-Id: I76b8e0b3c0d3b0c32bd2114d0867ac7489808279
Andrew Boie [Wed, 11 Jul 2012 03:43:29 +0000 (20:43 -0700)]
libdiskconfig: HACK Don't do space checks on zero-size images
If an image file is of zero size, assume we just want to expand it
to fit the available images.
Change-Id: If8f22eb12d3a5179960d4359307bb177e3323e8a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Steve Kondik [Tue, 26 Jul 2016 10:03:06 +0000 (03:03 -0700)]
sdcard: Pass the umask to sdcardfs correctly
* Google version of the kernel code expects unsigned int rather than
octal. Don't confuse it.
Change-Id: I40f060dc5212ec587e612dc275001e1a660cce67
Zhao Wei Liew [Sun, 24 Jul 2016 07:45:31 +0000 (15:45 +0800)]
sdcard: Fix sdcardFS check
This check is inverted, breaking FUSE.
Change-Id: I81a710f464bce73f49fb1af6050a198b5f443f52
Steve Kondik [Sun, 24 Jul 2016 03:16:24 +0000 (20:16 -0700)]
sdcard: Add support for sdcardfs!
* sdcardfs is a kernel filesystem developed by Samsung and recently
seen in AOSP's common kernel branches. It entirely eliminates
the need to use FUSE for sdcard emulation and moves all the
wrapping logic to kernel. This vastly improves performance for
use cases which read/write to emulated as well as removable
cards.
Change-Id: I3e394a99e0a4b5beacaeddc0d4dd4855ff0cf082
Josh Gao [Thu, 14 Jul 2016 23:43:12 +0000 (16:43 -0700)]
DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
Fix two races in debuggerd's PTRACE_ATTACH logic:
1. The target thread in a crash dump request could exit between the
/proc/<pid>/task/<tid> check and the PTRACE_ATTACH.
2. Sibling threads could exit between listing /proc/<pid>/task and the
PTRACE_ATTACH.
Backport of NYC change I4dfe1ea30e2c211d2389321bd66e3684dd757591
Bug: http://b/
29555636
Change-Id: I6c6efcf82a49bca140d761b2d1de04215ba4d252
Josh Gao [Wed, 18 May 2016 17:39:48 +0000 (10:39 -0700)]
adb: use asocket's close function when closing.
close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.
Bug: http://b/
28347842
Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e
(cherry picked from commit
53eb31d87cb84a4212f4850bf745646e1fb12814)
(cherry picked from commit
014b01706cc64dc9c2ad94a96f62e07c058d0b5d)
Josh Gao [Wed, 18 May 2016 02:23:39 +0000 (19:23 -0700)]
adb: switch the socket list mutex to a recursive_mutex.
sockets.cpp was branching on whether a socket close function was
local_socket_close in order to avoid a potential deadlock if the socket
list lock was held while closing a peer socket.
Bug: http://b/
28347842
Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3
(functionally a cherrypick of
903b749f +
9b587dec, with windows disabled)
Sergio Giro [Tue, 28 Jun 2016 17:02:29 +0000 (18:02 +0100)]
libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.
Correcting the length computation and adding bound checks to the
conversion functions.
Test: ran libutils_tests
Bug:
29250543
Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb
(cherry picked from commit
c4966a363e46d2e1074d1a365e232af0dcedd6a1)
Chih-Wei Huang [Wed, 20 Jul 2016 09:02:24 +0000 (17:02 +0800)]
Merge branch 'android-ia' into marshmallow-x86
Jean-Christophe PINCE [Tue, 2 Feb 2016 15:12:38 +0000 (16:12 +0100)]
Fix adb protocol issue when missed a packet
When there is an issue, adb re-initializes the connection and if it
misses the first 24 bytes "CNXN" packet, it will read the 8 bytes "host::"
packet instead followed by the first 17 bytes of the "CNXN packet" leading
to a new connection error; it reinitializes then the connection but
reads again the "host::" packet sent by the host etc and infinitely.
The device is then show offline or not shown at all on the host.
Change-Id: I4720c9494c7bede79becd5e916de50ace2115021
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-19456
Signed-off-by: Jean-Christophe PINCE <jean-christophe.pince@intel.com>
Signed-off-by: Clement Calmels <clement.calmels@intel.com>
Reviewed-on: https://android.intel.com:443/468687
jgu21 [Mon, 14 Mar 2016 06:58:53 +0000 (02:58 -0400)]
Create mixins configuration for app compatibility
enhancement feature
This feature is created for some cerner cases of
app compatibility issue. It's disabled by default.
To enable it, please add below lines to mixins.spec.
Currently, it aims to handle below issues:
1. All native libraries are put under assets directory.
Some apps put their libraries under the assets directory
in their APKs, instead of lib directory. It's not a
problem if the ABI of app libs is matched with platform
default ABI. But for apps with other ABIs, this feature
must be enabled to call native bridge for help.
Change-Id: I98ec4d47bee4596bfe0e9efd4cd0b6fe0c90fdf7
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-24196
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/481103
Chuanxiao Dong [Tue, 8 Mar 2016 09:24:02 +0000 (17:24 +0800)]
fs_mgr: fix encryptable=footer support
If the userdata partition has the encryptable=footer fstab option,
fs_mgr must leave room for the crypt footer.
Upstream: https://android-review.googlesource.com/206992
Change-Id: Id07818c5d93aafc27577f72fb0a780f26db51b16
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-23540
Reviewed-on: https://android.intel.com:443/479471
Wu, Hao [Fri, 4 Mar 2016 09:28:01 +0000 (17:28 +0800)]
healthd: only kick animation once for charger unplug case
After animation done for charger unplug case, healthd may still
receive some uevent before the shutdown action. This change will
make sure battery animation will not be kicked for multiple times
Change-Id: I1e419b10b195d6919b5d5a83c87c334306896c2c
Signed-off-by: yangx.d.liu <yangx.d.liu@intel.com>
Signed-off-by: Wu, Hao <hao.wu@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-21840
Reviewed-on: https://android.intel.com:443/477709
Du, Changbin [Fri, 29 Jan 2016 08:07:07 +0000 (16:07 +0800)]
adb: fix klocwork isssue 'use of free memory possible'
Change-Id: I334076094c8bf9ab6c90bd170e141e190058ed72
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-18056
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/463913
Du, Changbin [Sat, 23 Jan 2016 09:54:30 +0000 (17:54 +0800)]
adb: sockets: fix race condition between input_thread and fdevent callback
The transport's input_thread clean up all of its sockets by
close_all_sockets function before it exit. All sockets's callback is
invoked by local_socket_event_func by fdevent thread(the main thread).
But there is no synchronization between these two thread. Missing
synchronization can cause crash or unexpected behaviour. So far has
observed two crash issue:
1. after close_all_sockets return, still has sockets pending. Then when
the pending sockets try to access the removed transport cause segment
fault.
2. calling the socket's close callback(local_socket_close) but a socket
has been destroied. This will access a freed memory.
Change-Id: I9787b9ca7949946e977e102812518799051b9c67
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12574
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/461670
Du, Changbin [Wed, 20 Jan 2016 11:27:24 +0000 (19:27 +0800)]
adb: fix a spurious fatal condition
The fde may be removed just after rutern from select in fdevent_process
fucntion. This is not a fatal error but normal. So just igore the event
for this fde.
Change-Id: I08fca0c6e539755fbc15c82d46c6b3f3855a2f41
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12574
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/460314
Du, Changbin [Wed, 20 Jan 2016 10:44:21 +0000 (18:44 +0800)]
adb: fdevent: add synchronization logic to avoid crash
The fdevent part didn't implemente any synchronization protection. This
could introduce race condition issues. Espacially when adb is used for
Android stress test, this will be a problem that can cause server side
crash.
Change-Id: I93c311ed62770afc3061ccb8b60a0abd09f7453d
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12574
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/460313
Du, Changbin [Wed, 20 Jan 2016 06:14:35 +0000 (14:14 +0800)]
adb: fix 'adb wait-for-device' thread leak issue
After the "adb wait-for-device" command is killed, the thread created in
adb server doesn't exit and keep it there to monitor device. If keep
doing this(like a automation test tool), hundreds of threads will be
crated and make adb server crash with running out of resource.
Steps to reproduce the problem.
- run "adb -s xxxxx wait-for-device"
- use "pstree -p <pid-of-adb-server>" to check count of threads
- kill it by ctrl+C.
- use pstree check threads info.
Change-Id: I96599c7b43df1f5c92edd7065d562a1bb6bacb19
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12574
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/460212
Leo Sartre [Fri, 27 Nov 2015 17:56:48 +0000 (18:56 +0100)]
adb host: add device state in "adb wait-for-*"
The current implementation of the host commands "adb wait-for-*" allows
to specify only the transport layer (local, usb or any).
This patch allows the specification of the expected device state
(bootloader, recovery, device or sideload), this is usefull for
scripting purposes.
Use case:
$ adb reboot sideload-auto-reboot
$ adb wait-for-usb-sideload && adb sideload package.zip
This is a port of: https://android-review.googlesource.com/#/c/184290
Change-Id: I56a64b2d0f089cf1eb77424956296d660132b629
Signed-off-by: Leo Sartre <leox.sartre@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-15622
Reviewed-on: https://android.intel.com:443/450503
jgu21 [Thu, 2 Apr 2015 08:24:55 +0000 (04:24 -0400)]
core: Enable houdini to Support the apps which put all libs under assets dir.
1. Many apps in PRC market put all arm native libs under assets/ dir in
their APK, instead of lib/ dir.
Since Lollipop, PakcageManager needs clear ABI info during app
installation.
If the ABI is not supported, houdini has not chance to involve in.
For above kind of apps, houdini will not be loaded to help arm libs.
To support such kind of apps, we have to enable houdini even without
clear ABI info only for PRC market
2. Fix GTS case failure caused by above modification,
which enforce to set arm ABI for all pure java
NOTE: Must merged together with https://android.intel.com/449222
Change-Id: I6d8cd263e3463f8e938b30f27e5db414eb2c96e9
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12442
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Signed-off-by: Zhou,KaiX K <kaix.k.zhou@intel.com>
Reviewed-on: https://android.intel.com:443/449223
Pavan Kumar S [Thu, 21 May 2015 08:55:56 +0000 (14:25 +0530)]
healthd: Add USB_TYPEC to power-supply type list
A new power-supply type is added in power-supply framework to
support USB_TYPEC. healthd needs to be updated to accomodate this type.
Change-Id: Ib69d82c3460433161e2955d50765caf18538bed1
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-6732
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Reviewed-on: https://android.intel.com:443/374693
(cherry picked from commit
601a4014f44e581832cad2e8f49051c9a6b33e75)
Reviewed-on: https://android.intel.com:443/429348
taozha2x [Thu, 22 Oct 2015 01:21:25 +0000 (09:21 +0800)]
Package Manager : optimization for ZipFileRO->NextEntry
In functions like findSurpportedAbi and CopyNativeLibraries, it using
ZipFileRO->NextEntry to get FileName of each file in package, and then find a
best ABI or do CRC checking for native libraries.
But in current implementation, NextEntry will read info from both CentralDirectoryRecord
and LocalFileHeader, to compare the filename, signature and so on to check the integrity.
But on platform that has bad "read" performance like Sofia 3GR, it cost too much
time reading infor from LocalFileHeader in each NextEntry, lead to so much time
scanning one package that contains dozens of binaries.
So add the NextEntryNoIntegrity API for such processing that just need a filename, like
use case mentioned above. But it might not trustable if package damaged or changed
unpredictable.
Together with patch in frameworks/base/
Change-Id: I915b60c4b3cfa9c17929b207149a03b73a197147
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-5845
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Johnson Z Wu <johnson.z.wu@intel.com>
Signed-off-by: taozha2x <taox.z.zhang@intel.com>
Reviewed-on: https://android.intel.com:443/427235
William Roberts [Thu, 1 Oct 2015 23:03:47 +0000 (16:03 -0700)]
property_service: log pid,uid and gid of setprop client
When auditing setprop denials, it is often unclear of who the process is
in a multi-process domain. To help identify the invoker, log the pid, uid,
and gid of the caller.
Before:
avc: denied { set } for property=wifi.xxx ...
After:
avc: denied { set } for property=wifi.xxx pid=30691 uid=123 gid=345 ...
Upstreamed: https://android-review.googlesource.com/174062
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-4996
Change-Id: I5cdcb3d18fbd52e0987b5e1497b9f6620c6c742a
Signed-off-by: William Roberts <william.c.roberts@intel.com>
Reviewed-on: https://android.intel.com:443/423303
jgu21 [Thu, 2 Jul 2015 04:02:11 +0000 (12:02 +0800)]
Allow native bridge to work without a code cache
In isolatedProcess, the app_code_cache_dir is not needed
for native bridge. This commit allows native bridge to work
without a code cache in isolatedProcess.
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-1596
Change-Id: I8580268d5ec6ca8d44e4500c3fafe10408e1e0d3
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/406649
Mark Salyzyn [Tue, 2 Feb 2016 17:20:31 +0000 (09:20 -0800)]
libcutils: abort for invalid fd
If ashmem accessors are being called with a file descriptor that
belongs to anything other than ashmem, we need to stop it right
now so that they can fix the caller.
Bug:
26871259
Change-Id: Icf9aafc3631a80b9af6fe0fea03599d61e285d21