Commit graph

130 commits

Author SHA1 Message Date
Nick Kralevich
58ba58a97c logd: Don't embed a flexible array member within another struct
C (but not C++) has a concept of a flexible array member, which
is documented at https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html .
Using a flexible array member indicates that the structure is
really a header for a variable length object.

In logd's case, the variable length structure android_event_string_t
was embedded within another structure called
android_log_event_string_t. This makes gcc's __builtin_object_size()
function really confused. When compiling with C++,
__builtin_object_size(android_log_event_string_t.payload.data, 1)
would return 0, whereas if you compiled the code with C, the same
call would (properly) return -1.

Code which does automatic bounds checking, such as the proposed
patch at https://android-review.googlesource.com/145411 , will
cause problems for logd if this syntax is used.

Don't try to embed a variable length structure within another
structure. This doesn't appear to be valid C nor C++, and
while it's worked, it seems problematic.

Instead, inline the structure so it's one big happy structure.

Change-Id: I8ac02b7142a4f6560f5f80df2effcf720f9896fc
2015-04-07 10:12:20 -07:00
Mark Salyzyn
16045614fd android_filesystem_config.h: use __BEGIN_DECLS and __END_DECLS
Change-Id: Idb050b9ef4e7947664295b173e1b09d65accd3e9
2015-04-06 14:15:58 -07:00
Tim Kilbourn
628620c7ba Allow inputflinger to have CAP_BLOCK_SUSPEND.
(Cherry picked from commit 83e6f2606b)

Resolved conflict in include/private/android_filesystem_config.h, content
already in libcutils/fs_config.c.

Change-Id: I817707721786e9b920fef14ebe836fdcd65a8606
2015-04-06 10:57:29 -07:00
Mark Salyzyn
a21c29ee81 android_filesystem_config: move fs_config to libcutils
Bug: 19908228
Change-Id: Id51c0c50eb2677824d052882f4263193a08e1402
2015-04-06 10:04:16 -07:00
Greg Hackmann
38eb58d2a8 pixelflinger: make self-contained
pixelflinger should not be used for new projects and should be moved out
of system/core at some point.  As the first step, move all its headers
under system/core/libpixelflinger/include and update its Android.mk
files so they're not referring to the absolute system/core path anymore.

Change-Id: Idead273ab2c0450409d770f5402c4dba916192a9
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-03-19 12:34:35 -07:00
Elliott Hughes
3c292007c1 Remove obsolete files from fs_config's list.
Change-Id: I83716f48754de889d811d74074f9a32dc666c05e
2015-03-18 10:47:20 -07:00
Paul Eastham
cc255b4873 Revert "pixelflinger: make self-contained"
This reverts commit 56350fe387.

Change-Id: I4cda5773f39abd3b24df65d7bd9daaef92314b52
2015-03-16 19:01:38 +00:00
Greg Hackmann
56350fe387 pixelflinger: make self-contained
pixelflinger should not be used for new projects and should be moved out
of system/core at some point.  As the first step, move all its headers
under system/core/libpixelflinger/include and update its Android.mk
files so they're not referring to the absolute system/core path anymore.

Change-Id: I7acc3ef5b2e21d8ba6fe939ea8d3ec4c41959591
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-03-12 13:02:38 -07:00
Mark Salyzyn
e79201e4cb am 4487c605: Merge changes I0ec0fe3e,I9e5fccba
* commit '4487c605eaeea2b85c8511fe915a286c3aaf4da4':
  liblog: logprint use <endian.h>
  private: Add event payload structures to android_logger.h
2015-03-04 22:44:41 +00:00
Mark Salyzyn
fa1c063feb private: Add event payload structures to android_logger.h
- common android_event_header_t
- android_event_int_t ANDROID_TYPE_INT payload
- android_log_event_int_t single ANDROID_TYPE_INT event
- android_event_long_t ANDROID_TYPE_LONG payload
- android_log_event_long_t single ANDROID_TYPE_LONG event
- android_event_string_t ANDROID_TYPE_STRING payload
- android_log_event_string_t single ANDROID_TYPE_STRING event

Change-Id: I9e5fccba38e3f230c2c4ec7dec51ed110c460f95
2015-03-04 12:48:04 -08:00
Mark Salyzyn
982421df45 am 91581f19: Merge "liblog: add pstore write"
* commit '91581f19906ade01eabc6e10a7dac209e710117a':
  liblog: add pstore write
2015-01-23 23:59:45 +00:00
Mark Salyzyn
f0cc42f525 am 4730328d: Merge "logd: create private/android_logger.h"
* commit '4730328da72ef9b7aeaefc120358155fdfd8dde8':
  logd: create private/android_logger.h
2015-01-23 23:59:43 +00:00
Mark Salyzyn
d91ab5815d liblog: add pstore write
Used to push the Android log messages into pstore
(when available, and no propagation of error).

Change-Id: I9def8cf796d35d347f502d9745d5f42ec1200253
2015-01-23 23:33:31 +00:00
Mark Salyzyn
b5f6e45d6b logd: create private/android_logger.h
- create a structure to depict the private header
  expected at logd end of socket.
- utilize this new structure instead of unscalable
  byte stream technique used to unpack in logd.

Change-Id: I2d0e5c3531c279f2dc1fbd74807210ff8d804de0
2015-01-23 23:32:11 +00:00
Dmitry Shmidt
2901b30a58 am 70f6dea9: Merge "android_filesystem: Remove setuid bits from tcpdump" into lmp-mr1-dev
* commit '70f6dea9d06876bc65181c40ee9e623be196fb4c':
  android_filesystem: Remove setuid bits from tcpdump
2015-01-15 20:51:35 +00:00
Dmitry Shmidt
33e4f4d81a android_filesystem: Remove setuid bits from tcpdump
Bug: 18669116

Change-Id: I25486f2fe0e994f569b788fc9f03ef6d383f54d4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2015-01-15 10:35:54 -08:00
Elliott Hughes
b120134bd1 Remove long-dead readtty.
Change-Id: I15ae14542214a3802d43892da0d03cfb33e63c96
2014-11-24 12:01:21 -08:00
Johan Redestig
60ac6364ec Reserve some AIDs for OEMs
OEMs frequently add some AIDs on their own. Reserve some range
for them to use.

Change-Id: I3c729c889c9bd3e105ae4f6fb0c04a42a10eb25c
2014-11-10 08:14:21 +01:00
Brian Carlstrom
68e0d185f4 am 24d2adba: am 188d4396: Merge "Change /dalvik-cache to be owned by root."
* commit '24d2adba7a2f9caa82a88be70ad2fe7397ab310a':
  Change /dalvik-cache to be owned by root.
2014-08-29 11:39:17 +00:00
Alex Light
c692410e16 Change /dalvik-cache to be owned by root.
Bug: 16875245

(cherry picked from commit 3878ebd724)

Change-Id: I29a70215a2207bc4e0db02ab751d32a68edf4b66
2014-08-28 16:56:36 -07:00
Alex Light
3878ebd724 Change /dalvik-cache to be owned by root.
Bug: 16875245

Change-Id: I29a70215a2207bc4e0db02ab751d32a68edf4b66
2014-08-27 15:42:19 -07:00
Elliott Hughes
a613844e13 am e07a6e63: am 6d9a5ac3: Merge "[MIPSR6] Skip pixelflinger, memset assembler code on mips32r6"
* commit 'e07a6e6337a959c45ab71acf6ff1fad8a8ac5dfd':
  [MIPSR6] Skip pixelflinger, memset assembler code on mips32r6
2014-08-05 21:43:16 +00:00
Duane Sand
734f50c2fe [MIPSR6] Skip pixelflinger, memset assembler code on mips32r6
Temporarily use generic C-coded libpixelflinger & memset on mips32r6.

Change-Id: I629b11ba955eaba323cba1df96c39f75f4d24d62
2014-07-31 16:21:16 -07:00
Nick Kralevich
b14ab71f0e am 0487e50a: am 24fc60c7: am 304d31f0: Merge "Make su 04750"
* commit '0487e50accf44f13acafad5fb5d76b4958d86550':
  Make su 04750
2014-06-11 20:24:20 +00:00
Nick Kralevich
c3df8d7562 Make su 04750
Currently, /system/xbin/su is world executable. Prior to SELinux
enforcement, anyone (including third party apps) could run su.
The su code itself checks to see if the calling UID is root or shell.

Rather than relying on enforcement within the su binary, modify the
binary so it has group=shell, and remove world-execute permission.
This helps avoid some annoying SELinux denial messages as third party
apps call su on userdebug/eng builds.

Change-Id: I61c9231bb7e201d14ee3a5b6fe81b3fa7b12599f
2014-06-08 15:14:42 -07:00
Robin Lee
f086a8134c am 63cdd840: am e948c9fa: am 489797c2: Merge "Add new AID shared by all apps in a profile"
* commit '63cdd840f81839bf6ce6e3723c42f09256cf4b3e':
  Add new AID shared by all apps in a profile
2014-06-04 19:06:23 +00:00
Robin Lee
489797c2cb Merge "Add new AID shared by all apps in a profile" 2014-06-04 18:45:02 +00:00
Torne (Richard Coles)
f9ff246dd7 am 4f3ad823: am a8329a36: am 96109cf3: Merge "Add UID and directory for RELRO sharing support."
* commit '4f3ad823eaf97fcbcbb1afac67371aff76677b1d':
  Add UID and directory for RELRO sharing support.
2014-05-28 18:02:24 +00:00
Torne (Richard Coles)
234f696ea7 Add UID and directory for RELRO sharing support.
Define a UID to be used by the process responsible for creating shared
RELRO files for the WebView native library, and create a directory owned
by that UID to use to store the files.

Bug: 13005501
Change-Id: I5bbb1e1035405e5534b2681f554fe16f74e3da1a
2014-05-27 14:00:29 +01:00
Robin Lee
b3ef03951c Add new AID shared by all apps in a profile
Automatically assigned as a GID to all apps running under the same
Android profile. Used for exposing to or sharing files with apps
running in a specific profile.

Analogous to AID_SHARED_GID only the sharing is between processes with
the same userId rather than with the same appId.

The name to be displayed for uids/gids with this AID is 'u*_everyone'.

Change-Id: I46efb749f74cb86868c5609a0ce1a6aab2f9e9c9
2014-04-29 12:46:04 +01:00
Narayan Kamath
8d56ff5d12 am c5aff686: am cda31324: am 4706320e: Merge "Include 64bit valgrind in the android_filesystem_config."
* commit 'c5aff68693dee788a28a0d0256782cc8521aa2a5':
  Include 64bit valgrind in the android_filesystem_config.
2014-04-14 16:05:11 +00:00
Narayan Kamath
6b7ab90ca9 Include 64bit valgrind in the android_filesystem_config.
Required so that we set the exectuable bit correctly.

Change-Id: If59bd0ff47d2b4b2b8f92a1c007b4ba414ea1876
2014-04-12 09:11:16 +01:00
Mark Salyzyn
0175b0747a logd: initial checkin.
* Create a new userspace log daemon for handling logging messages.

Original-Change-Id: I75267df16359684490121e6c31cca48614d79856
Signed-off-by: Nick Kralevich <nnk@google.com>

* Merge conflicts
* rename new syslog daemon to logd to prevent confusion with bionic syslog
* replace racy getGroups call with KISS call to client->getGid()
* Timestamps are filed at logging source
* insert entries into list in timestamp order
* Added LogTimeEntry tail filtration handling
* Added region locking around LogWriter list
* separate threads for each writer
* /dev/socket/logd* permissions

Signed-off-by: Mark Salyzyn <salyzyn@google.com>

(cherry picked from commit 3e76e0a497)

Author: Nick Kralevich <nnk@google.com>
Change-Id: Ice88b1412d8f9daa7f9119b2b5aaf684a5e28098
2014-02-26 09:52:35 -08:00
Nick Kralevich
3e76e0a497 logd: initial checkin.
* Create a new userspace log daemon for handling logging messages.

Original-Change-Id: I75267df16359684490121e6c31cca48614d79856
Signed-off-by: Nick Kralevich <nnk@google.com>

* Merge conflicts
* rename new syslog daemon to logd to prevent confusion with bionic syslog
* replace racy getGroups call with KISS call to client->getGid()
* Timestamps are filed at logging source
* insert entries into list in timestamp order
* Added LogTimeEntry tail filtration handling
* Added region locking around LogWriter list
* separate threads for each writer
* /dev/socket/logd* permissions

Signed-off-by: Mark Salyzyn <salyzyn@google.com>

Change-Id: Ice88b1412d8f9daa7f9119b2b5aaf684a5e28098
2014-02-14 11:07:54 -08:00
Doug Zongker
9526202d84 set permissions of recovery install script
The script that writes the recovery partition after a successful
update of system needs to be made executable.  This change also moves
it from /system/etc to /system/bin.

Bug: 12893978
Change-Id: I686e2392a2392515a6859a7381b735de1007b7ea
2014-02-04 12:33:08 -08:00
Doug Zongker
7baebf1345 add the pre-recovery service
Add a service called "pre-recovery" which is normally stopped but can
be started by the system server when we want to go into recovery.  It
will do any preparation needed (currently needed to handle update
packages that reside on an encrypted /data partition) and then set
sys.powerctl when it's ready to actually reboot.

Bug: 12188746
Change-Id: I894a4cb200395a0f6d7fe643ed4c2ac0a45d2052
2014-01-16 08:54:59 -08:00
Elliott Hughes
fed76f8515 am 63824e92: am 980093ca: am 348856fa: am 532f4658: Merge "AArch64: Correction of struct surface_t"
* commit '63824e923aca6fe15942beee00b258ea6119e459':
  AArch64: Correction of struct surface_t
2013-12-16 20:03:17 +00:00
Elliott Hughes
c29664284b am 49a88c3c: am 410a1966: am fd382f2e: am fd7eabe4: Merge "Pixelflinger: Add AArch64 support to pixelflinger JIT."
* commit '49a88c3cf38e9c17a756434880fb01971018a9c6':
  Pixelflinger: Add AArch64 support to pixelflinger JIT.
2013-12-16 19:55:21 +00:00
Elliott Hughes
532f465823 Merge "AArch64: Correction of struct surface_t" 2013-12-16 19:50:17 +00:00
Elliott Hughes
260854c0b0 am ed20fef0: am a99f0b6e: am 5b8daae0: am a67b39cb: Merge "Pixelflinger: Fix issue of pointers being stored in ints"
* commit 'ed20fef0630d02395abab6a073a5717ddfbfaa8d':
  Pixelflinger: Fix issue of pointers being stored in ints
2013-12-12 21:33:04 +00:00
Ashok Bhat
658f89dc5c Pixelflinger: Add AArch64 support to pixelflinger JIT.
See the comment-block at the top of Aarch64Assembler.cpp
for overview on how AArch64 support has been implemented

In addition, this commit contains
[x] AArch64 inline asm versions of gglmul series of
    functions and a new unit test bench to test the
    functions

[x] Assembly implementations of scanline_col32cb16blend
    and scanline_t32cb16blend for AArch64, with unit
    test bench

Change-Id: I915cded9e1d39d9a2a70bf8a0394b8a0064d1eb4
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2013-12-12 17:30:13 +00:00
Ashok Bhat
d10afb1748 Pixelflinger: Fix issue of pointers being stored in ints
Pixelflinger's code makes assumptions, at certain places,
that pointers can be stored as ints. This patch makes use
of uintptr_t wherever pointers are stored as int or cast
to int.

Change-Id: Ie76f425cbc82ac038a747f77a95bd31774f4a8e8
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2013-12-12 17:30:13 +00:00
Marcus Oakland
6053564160 AArch64: Correction of struct surface_t
The struct in the union with GGLSurface in struct surface_t assumed
that the reserved field, which corresponds to the GGLsizei version
field in the GGLSurface structure (where GGLsizei is define as being
ssize_t in the system/core/include/pixelflinger/pixelflinger.h header
file) is uint32_t. That is appropriate to the 32-bit system but is
not appropriate to the 64-bit system, where ssize_t is 64-bits rather
than 32-bits.

The 32-bit system has also been tested and has no regression
because of this change.

Change-Id: I5cd84fd4a18fa0e63e27975f7b3d3e95b99cea58
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
2013-12-10 18:13:26 +00:00
Todd Poynor
fea5b4d44b healthd: move charger executable to healthd charger mode
* Add healthd charger mode ops
* Check for executable invocation as "charger", set charger mode if so
* Incorporate charger executable as healthd charger mode

Change-Id: I4a44e7a4c3a65ae9be94491f7f498aa48d4f8a84
2013-09-17 14:41:07 -07:00
Jeff Sharkey
dfe0cbab3f Richer SD card permissions through FUSE.
Changes the FUSE daemon to synthesize an Android-specific set of
filesystem permissions, even when the underlying media storage is
permissionless.  This is designed to support several features:

First, apps can access their own files in /Android/data/com.example/
without requiring any external storage permissions.  This is enabled
by allowing o+x on parent directories, and assigning the UID owner
based on the directory name (package name).  The mapping from package
to appId is parsed from packages.list, which is updated when apps are
added/removed.  Changes are observed through inotify.  It creates
missing package name directories when requested and valid.

Second, support for separate permissions for photos and audio/video
content on the device through new GIDs which are assigned based on
top-level directory names.

Finally, support for multi-user separation on the same physical media
through new /Android/user/ directory, which will be bind-mounted
into place.  It recursively applies the above rules to each secondary
user.

rwxrwx--x root:sdcard_rw     /
rwxrwx--- root:sdcard_pics   /Pictures
rwxrwx--- root:sdcard_av     /Music

rwxrwx--x root:sdcard_rw     /Android
rwxrwx--x root:sdcard_rw     /Android/data
rwxrwx--- u0_a12:sdcard_rw   /Android/data/com.example
rwxrwx--x root:sdcard_rw     /Android/obb/
rwxrwx--- u0_a12:sdcard_rw   /Android/obb/com.example

rwxrwx--- root:sdcard_all    /Android/user
rwxrwx--x root:sdcard_rw     /Android/user/10
rwxrwx--- u10_a12:sdcard_rw  /Android/user/10/Android/data/com.example

These derived permissions are disabled by default.  Switched option
parsing to getopt().

Change-Id: I21bf5d79d13f0f07a6a116122b16395f4f97505b
2013-08-08 17:26:41 -07:00
Jeff Tinker
7629bf19a1 am 9e9ed1b4: am 131ee07b: Merge "Add a new group for MediaDrm engine plugins" into jb-mr2-dev
* commit '9e9ed1b40010745e709157a6977ba6d053d46c49':
  Add a new group for MediaDrm engine plugins
2013-04-24 21:56:49 -07:00
Jeff Tinker
131ee07b77 Merge "Add a new group for MediaDrm engine plugins" into jb-mr2-dev 2013-04-25 04:54:02 +00:00
Matthew Xie
af1cbd4c10 am 0db6600a: am 7ee2e26e: Remove DBUS from make and header files
* commit '0db6600a60e8d604aaef5e43db9ae52ed7380979':
  Remove DBUS from make and header files
2013-04-24 14:24:30 -07:00
Jeff Tinker
08d64308b9 Add a new group for MediaDrm engine plugins
bug: 8702754
Change-Id: I3b7988b64b1dcf4685624e4c1af938e132b82696
2013-04-23 19:54:17 -07:00
Matthew Xie
7ee2e26eb9 Remove DBUS from make and header files
DBUS had been needed by bluetooth bluz stack. It is not needed after
we replaced bluez stack with bluedroid stack.
bug 6872904

Change-Id: I3fa41c1dd4ac80bc679d5950b3b20c7f6d12265f
2013-04-23 14:02:16 -07:00