Bug: http://b/31532493
Using misaligned pointers forces us to potentially take the address of
members in a packed structure (which is now a warning/error in the
latest Clang). Using memcpy() is the proper way to handle this kind of
problem, as the compiler can insert the proper instructions (and usually
elide the memcpy() entirely).
Test: Built correctly with updated compilers.
Change-Id: Ia1f6eb62cf19404ff76b71d3c6c7ffffa1403120
Should use android/log.h instead of cutils/log.h as a good example
to all others. Adjust header order to comply with Android Coding
standards.
Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
Also cleans up two instances of open() with useless mode params, and
changes a few uses of snprintf to use sizeof(buffer) instead of
hardcoded buffer sizes.
Change-Id: If11591003d910c995e72ad8f75afd072c255a3c5
The compiler will issue the unaligned access instuctions
when reading from a packed struct. Since 'find' takes a
reference, if we pass the field directly it is removed
from its packed context and may be unreadable.
Read the field out directly from the packed struct and pass
in aligned to u_map to fix.
Bug: 22367550
Change-Id: Ia3b639c7518154ff5a2b7c233b752e154eab9aad
(cherry picked from commit 6e83dc4d325d68b568c841d3e88fda2a93e00663)
Initially tested with the wrong (mnc) toolchain
which just hid the error entirely. Now tested with
master toolchain so this should be the last instance.
Bug: 22367550
Change-Id: I0e785918b1a9f4a8af80dc96b794737fcfd12367
The compiler will issue the unaligned access instuctions
when reading from a packed struct. Since 'find' takes a
reference, if we pass the field directly it is removed
from its packed context and may be unreadable.
Read the field out directly from the packed struct and pass
in aligned to u_map to fix.
Bug: 22367550
Change-Id: Ia3b639c7518154ff5a2b7c233b752e154eab9aad
If the handle version is 0, there's no hardware_backed flag
meaning hardware backed handles will be attempted against
the soft impl. Ensure we don't try to read from hardware_backed
unless the version is > 0.
Bug: 21090356
Change-Id: I65f009c55538ea3c20eb486b580eb11ce93934fc
Certain devices, like Shamu, are currently running an interim
software-only gatekeeper. When the HAL for those devices is merged,
we need to handle upgrading to the HAL smoothly.
Bug: 21090356
Change-Id: I5352bc547a43671a08249eae532e8b3ce6b90087
Allows for easy determination of whether there's a
hardware module in place. Permits tighter coupling of
software implementation with upper-level stack.
Bug:21090356
Change-Id: I275b57cd976c233c43c476c5869c5a4b29fbc175
This allows us to recover in situations where we manage
to clear the SID in GateKeeper but fail to remove the
password in LockSettingsService.
Change-Id: Ib64ead137632f9615745a414c90a9b66b847134f
It's a bit weird that KS defines NO_ERROR outside a
namespace like the Android binder lib, but assigns
it the value 1 instead of 0.
Change-Id: I5aedfd495f2f3bdff7eb1b4ba0f75d335dfe12d9