No description
Find a file
David Pursell 2ebce7384b Flattenable: switch from assignment to memcpy().
FlattenableUtils read() and write() currently use assignment to copy
bytes. However, by casting the void* buffer to type T, the compiler is
allowed to assume that buffer obeys the alignment requirements of T,
which is not necessarily the case during serialization. On some
architectures, we can get SIGBUS when this alignment is violated.

We don't want the users of these routines to have to worry about
alignment when packing structures, so use memcpy() instead which should
always be safe since the compiler won't assume any alignment for the
void* buffer.

On architectures that can handle unaligned direct read/write of type T,
the compiler should be smart enough to optimize this code back to a
direct read/write anyway, but architectures that can't handle it will
fall back to memcpy; this means that this change shouldn't have any
impact on current Android devices. See the linked bug for more details.

Bug: http://b/31671510
Test: libgui Sensor serialization no longer gives SIGBUS.
Test: libgui.so unchanged on Shamu before and after this CL.
Change-Id: I2197127e8cbfb43f4f553bda6464f6ebe087febd
2016-09-23 13:56:40 -07:00
adb Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT" 2016-09-19 20:35:11 +00:00
adf Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
base Remove mutex.h and its uses. 2016-09-16 15:58:00 -07:00
bootstat Convert to Android.bp 2016-08-26 16:19:21 -07:00
cpio fs_config: replace getenv('OUT') by new fs_config parameter 2015-07-09 21:47:07 -07:00
debuggerd Fix debuggerd argument parsing. 2016-09-15 17:08:33 -07:00
fastboot Add android::base::GetExecutablePath, switch adb and fastboot over. 2016-09-01 09:24:24 -07:00
fingerprintd Merge "Fix google-explicit-constructor warnings." am: 7bdd6a8b5a 2016-04-30 05:16:35 +00:00
fs_mgr Split fstab mount into 2 phases 2016-09-06 11:39:05 -07:00
gatekeeperd Merge "Fix google-explicit-constructor warnings." am: 7bdd6a8b5a 2016-04-30 05:16:35 +00:00
healthd Merge \"Fix clang-tidy performance warnings in healthd.\" 2016-07-28 06:24:24 +00:00
include Flattenable: switch from assignment to memcpy(). 2016-09-23 13:56:40 -07:00
init Split fstab mount into 2 phases 2016-09-06 11:39:05 -07:00
libbacktrace Replace libziparchive-host with libziparchive 2016-08-26 11:12:38 -07:00
libbinderwrapper Move libbinderwrapper's headers into libbinderwrapper. 2016-09-16 09:02:47 -07:00
libcrypto_utils libcrypto_utils: convert to Soong. 2016-08-05 18:07:36 -07:00
libcutils Tag hostapd binary with CAP_NET_ADMIN | CAP_NET_RAW 2016-09-07 13:30:23 -07:00
libdiskconfig Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
libion Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
liblog liblog: don't bother keeping FD around once it's mapped. 2016-09-01 19:31:08 +01:00
libmemtrack Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
libmemunreachable Convert to Android.bp 2016-08-26 16:19:21 -07:00
libnativebridge Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
libnativeloader Merge \"libnativeloader: convert Android.mk to Android.bp\" 2016-07-28 10:53:40 +00:00
libnetutils Remove deprecated libnetutils DHCPv4 code 2016-09-10 09:14:51 +09:00
libpackagelistparser Convert libpackagelistparser to Android.bp 2016-07-19 22:19:37 -07:00
libpixelflinger Fix reference counting for Assembly 2016-08-16 10:12:43 -07:00
libprocessgroup resolve merge conflicts of ed3596a to stage-aosp-master 2016-08-03 13:29:04 -07:00
libsparse Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
libsuspend Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
libsync Merge "Convert to Android.bp" 2016-08-29 20:32:12 +00:00
libsysutils Merge "Most accept/accept4 calls in system/core don't actually want the remote address." 2016-08-23 23:03:20 +00:00
libusbhost Move libusbhost's headers into libusbhost. 2016-09-16 10:43:56 -07:00
libutils libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 2016-08-25 20:07:51 +00:00
libziparchive Fix warnings in libziparchive 2016-09-20 09:23:47 -07:00
lmkd Merge "Most accept/accept4 calls in system/core don't actually want the remote address." 2016-08-23 23:03:20 +00:00
logcat logcat: -d, -t or -L, along with -f, do not background 2016-08-08 10:20:22 -07:00
logd logd: clear all from non system user status request 2016-09-02 07:41:27 -07:00
logwrapper Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
mkbootimg mkbootimg: use int for os_version and os_patch_level 2016-03-29 16:06:37 -07:00
reboot Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
rootdir Allow bluetooth service to access bluetooth directory and add /logs (1/6) 2016-09-19 17:50:56 +00:00
run-as run-as: Use Minijail for privilege dropping. 2016-07-19 11:03:52 -04:00
sdcard sdcard: Fix bad merge 2016-08-31 00:04:22 +00:00
toolbox Lose sendevent to toybox. 2016-07-15 14:17:28 -07:00
trusty Merge "Fix google-explicit-constructor warnings in system/core." 2016-07-29 16:57:17 +00:00
tzdatacheck Convert more Android.mk files to Android.bp 2016-07-13 17:41:45 -07:00
.gitignore Ignore adb/*.pyc files 2015-08-11 12:59:58 -07:00
Android.mk Remove the simulator target from all makefiles. 2011-07-11 22:12:32 -07:00
CleanSpec.mk Use BOARD_USES_VENDORIMAGE to detect vendor image presence 2016-07-08 18:17:48 -07:00
MODULE_LICENSE_APACHE2 auto import from //depot/cupcake/@135843 2013-07-30 13:56:49 -07:00
NOTICE Fix omission in NOTICE file. 2013-07-30 13:56:55 -07:00