Commit graph

174 commits

Author SHA1 Message Date
Treehugger Robot
b0a15d8319 Merge "Revert "android_ids: move to bionic"" 2016-12-13 00:31:26 +00:00
Elliott Hughes
7b7a8074e1 Revert "android_ids: move to bionic"
This reverts commit bc56847e84.

Change-Id: I2d00db0aaa7dfe292e36c6bdbaaa76230849e732
2016-12-12 22:11:29 +00:00
William Roberts
bc56847e84 android_ids: move to bionic
Prevent others from using android_ids and force them
to use grp.h and pwd.h family of functions.

Test: Build and boot, verify services are running properly.
Bug: 27999086

Change-Id: Idcd75cf7e91a49ef07a0ed3bdb514ad61aa82e69
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-12-08 16:57:17 -08:00
William Roberts
acdf527c52 fs_config: add comment to header
Add a comment to android_filesystem_config.h
about AID and OEM Range "scraping" done by
build/tools/fs_config.

Test: Build and boot.

Change-Id: I2d4845d91546ae967a1ee5166b73d119938faccc
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-12-08 16:57:17 -08:00
Jeff Sharkey
4de27c6a6d Define GIDs for internal media file types.
Currently, all internal media storage files (under /data/media) are
given the same "media_rw" GID.  To support an upcoming optimization
to disk usage calculation, this CL defines three new GIDs that can be
used to quickly identify common types: audio, video, and images.

Test: builds
Bug: 27948817
Change-Id: I8548459c3d3ccbf7d822431c6e2ebd1c2e309d70
2016-12-02 14:17:48 -07:00
Mark Salyzyn
2ca4f49476 liblog: add private android_log_write_list_buffer()
Allows us to compose an event message for our own in-memory purposes.
Will be used to compose an event message in logd and directly write
it to just the pmsg buffer.  Provide an internal enhanced C++ wrapper
for event handling.

Test: gTest liblog-unit-tests --gtest_filter=liblog.android_log_write_list_buffer
Bug: 31456426
Change-Id: I98246898ba580f9e506baba8af2fd1b26a2a8aae
2016-11-21 09:46:39 -08:00
Keun-young Park
42e802c2fb Add UID for vehicle network
- Access to vehicle network is done in vehicle network service process.

Test: build
bug: 32508433
Change-Id: I340d1f4964d70b53f10d84fb15a62107e1dedc0e
2016-10-28 12:08:07 -07:00
Mark Salyzyn
aeaaf81c2c liblog: logd: logcat: Split out log/logger.h into public and private.
log/logger.h pieces moved into log/log.h.  Correct for some
minor Android Coding standards.

Test: gTests liblog-unit-tests, logd-unit-tests and logcat-unit-tests
Bug: 19235719
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: I0a19fd8788eec20a582e72e4c62c04534bdb1b9a
2016-10-24 11:12:49 -07:00
Mark Salyzyn
e455373b57 liblog: Add private interfaces for buffer size properties
Add private function __android_logger_get_buffer_size() to read
properties and compose the default buffer size.  This interface
complements the existing android_looger_get_size() which returns
the logd setting which can differ at runtime.  For use in logd
and dumpstate.  Side effect is we also add the private functions
__android_logger_property_get_bool() and
__android_logger_valid_buffer_size() for reuse in logd.

Test: gTest liblog-unit-test, logd-unit-tests and logcat-unit-tests in
      combination with commit 'logd: Use private interfaces for
      buffer size properties'
Bug: 31750617
Change-Id: Id95cb68f775ef6b427c122e10f6f8291d336d184
2016-10-18 09:48:55 -07:00
Mark Salyzyn
9ea359fce0 liblog: LIBLOG_ABI_PRIVATE __android_log_is_debuggable()
Allow our own libraries to use this privately instead of
running the less efficient get_properties and doing the math.

Test: compile and boot smoke test
Bug: 27566046
Bug: 31456426
Change-Id: I2f677276d27fbcb6af01b600ac1d9891c8938d43
2016-10-14 08:00:41 -07:00
Mark Salyzyn
6debf985aa liblog: adb: move security interfaces to private
Test: Compile & adb functioning
Bug: 19235719
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: I7ad8963bcca3d8b5c37b547c11d163b652d35556
2016-10-10 15:15:45 +00:00
Mark Salyzyn
37c9451349 system/core: drop or replace log/logger.h
debuggerd does not require log/logger.h, can use android/log.h
In some cases, mark why log/logger.h was required.

Test: Compile and boot smoke test
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: Ia34987e25a01d81971ec8d785415f732b8376c4f
2016-10-04 09:09:10 -07:00
Mark Salyzyn
6584d0a35a liblog: Replace log/log.h with android/log.h
Move all liblog related content into android/log.h, and make
log/log.h points to android/log.h.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I858e0ebe047b86f2a8530a99bc9c380d3d58edbb
2016-09-30 12:47:05 -07:00
Mark Salyzyn
004cd3c55d liblog: logd: logcat: deprecate log/log_read.h
Always used in combination with log/logger.h except in log_time.cpp,
and not used externally.  As a result liblog has to support stl, a
small price to pay since goal is to convert liblog to C++ internally.

Test: compile
Bug: 31456426
Bug: 26552300
Bug: 31289077
Change-Id: I72828ec807d0a2c8e40bbdebd7a69f147a7ca5a9
2016-09-30 12:47:05 -07:00
Ajay Panicker
604208e957 Remove net_bt_stack group and replace it with bluetooth
Bug: 31549206
Change-Id: I667963e5f9fd1a5dc9ad74378b318e3b782e6883
2016-09-20 12:01:33 -07:00
Robert Sesek
e782a44575 Add static UID for the webview zygote process.
This UID will never own any files.

Bug: 21643067
Change-Id: Ifc887b1033ed4564336c8552012fb6bd0de73c15
2016-07-11 12:39:55 -04:00
Erik Kline
d63cf7d85a Add UIDs for system DNS and tethering DNS
Bug: 29420831
Bug: 29881876
Change-Id: I7a48f980f0e52a3d322c4c02988d48fc6df643ca
2016-07-06 11:13:59 +09:00
Mohamad Ayyash
8374276bfa Move canned_fs_config into libcutils
It's no longer specific to make_ext4fs, will be used for mksquashfs as
well.

BUG: 27467028
Change-Id: I41b8c2b168ada45c8378dee522391edfb8f6b9a6
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
BUG: 28704419
2016-05-12 18:44:13 -07:00
Mattias Nissler
4c9b1494e2 Merge "Add nvram user." 2016-03-23 08:17:56 +00:00
Mark Salyzyn
864e8e80e4 liblog: add __android_log_pmsg_file_read
- This is considered an Android Private function, not exported
  for general use.
- goal is to retreive a file's content from a series of log
  messages from pmsg, to be retrieved after a reboot for
  transfer to a persistent location.
- files are presented in reverse sorted order, first based on
  _any_ numerical content, then by alphanumeric order.
- Add a gTest for this function, relies on gTest for
  liblog.__android_log_pmsg_file_write from prior to reboot.

Bug: 27176738
Change-Id: If37ef423009bd28b598b233af3bccef3429bdc22
2016-03-22 13:03:53 -07:00
Mark Salyzyn
d4b061bde2 liblog: add __android_log_pmsg_file_write
- This is considered an Android Private function, not exported
  for general use.
- goal is to record a file's content into a series of log
  messages into pmsg, to be retrieved after a reboot for
  transfer to a persistent location.
- filename reference is converted to a tag-unique
  "<dirbase>:<filebase>".
- buffer and length representing the filename contents are
  recorded, along with a sequence number placed into the nsec
  time field to ANDROID_LOG_PMSG_FILE_MAX_SEQUENCE.
- Add a gTest for this function.

Bug: 27176738
Change-Id: If93df3ae8bfc1bb75516d4a1fd8dae0301af644b
2016-03-22 13:03:36 -07:00
Mattias Nissler
0897ab0849 Add nvram user.
This is intended to be used by user space daemons that are part of
access-controlled NVRAM HAL implementations for Brillo. Because there
might be sensitive data flowing through the daemon, we'd like to run
it as a separate user.

BUG: 27764637
Change-Id: If6ad7923af3c650963ee9e926f732001b6a8cb5d
2016-03-22 10:11:26 +01:00
Jorge Lucangeli Obes
5596cf04ff Add notice for adding users in AOSP.
Sometimes new users/groups get added in internal branches, and the list
gets out of sync. Add a comment to prompt developers to add users in
AOSP.

Bug: None
Change-Id: I5b2df391902b842f1af8a377c8eac4cdb36a0518
2016-02-26 15:03:44 -08:00
Jorge Lucangeli Obes
1c13c3d388 Add more first-party Brillo system users.
Brillo is converging on a set of mandatory system services to be
included in all Brillo builds. We'd like these services to run as
separate users just like other native Android/Brillo system services.

Add users for these services:
-Firewalld: Brillo has more granular firewall requirements (think e.g.
  Brillo-powered router.) Firewalld exposes a (currently) D-Bus/
  (soon to be) Binder API to broker access to IPTables rules.
-Trunksd: Some Brillo product configs will require TPMs. Trunksd
  manages TPMs in Chrome OS and Brillo.

Bug: 27299198

Change-Id: Ibe3303acdd9398ea52da0a37dbef73e5c5a948f7
2016-02-24 13:38:01 -08:00
Chien-Yu Chen
0836c9e386 Sync internal<->AOSP user list.
Bug: 27299198

Cherry-picked from:

Restart cameraserver

Bug: 24511454
Change-Id: Ia27f4ef0eb71f891c789f637a21b04afe0b1c4e9
2016-02-23 15:56:55 -08:00
Marco Nelissen
003c07238a uid for codec process
Change-Id: Iadf8012e6c177bcf487048e1b5a9b4fc51a0aeba
2016-01-25 07:49:39 -08:00
Josh Gao
e7a9e52740 debuggerd: fork and drop privileges when dumping.
Bug: http://b/25195825
Change-Id: I913d8425232e79df3f7a051a8cc63de9c60f4780
2016-01-05 15:59:01 -08:00
Jorge Lucangeli Obes
4ae18025f7 android_filesystem_config.h: Add Brillo users.
-metrics_collector and metricsd gather and upload device metrics.
-webservd is part of the Weave (Brillo remote setup and management) stack.

Bug: 26337609
Change-Id: Icf6ce75e64293adbe773f2ee65e80629f2eeb737
2016-01-05 14:43:40 -08:00
Pavlin Radoslavov
17d80c84e1 Use GID "wakelock" to control access to kernel wakelock
* Added new kernel GID named "wakelock" (AID_WAKELOCK = 3010)
* Changed the group access for /sys/power/wake_lock and
  /sys/power/wake_unlock from "system" to "wakelock"
* Added "wakelock" to the list of groups for the healthd process/service

Bug: 25864142
Change-Id: Ieabee9964cccec3107971a361a43aa9805164aa9
2015-12-28 14:57:28 -08:00
Jorge Lucangeli Obes
37211e1f3d Add audioserver UID.
(Originally in
https://googleplex-android-review.git.corp.google.com/#/c/804752).

Change-Id: I31951cad1bbcec58b21559be0d86581ba9187a92
2015-12-18 13:06:34 -08:00
Marco Nelissen
51544cc778 New uid for extractor process
Change-Id: I462d4736e772da0a08b4793fc1b971ff261667ea
2015-12-18 11:11:17 -08:00
Nick Kralevich
c39ba5ae32 Enable hidepid=2 on /proc
Add the following mount options to the /proc filesystem:

  hidepid=2,gid=3009

This change blocks /proc access unless you're in group 3009
(aka AID_READPROC).

Please see
  https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt
for documentation on the hidepid option.

hidepid=2 is preferred over hidepid=1 since it leaks less information
and doesn't generate SELinux ptrace denials when trying to access
/proc without being in the proper group.

Add AID_READPROC to processes which need to access /proc entries for
other UIDs.

Bug: 23310674
Change-Id: I22bb55ff7b80ff722945e224845215196f09dafa
2015-11-09 09:08:46 -08:00
Gilad Arnold
65475f8cc8 am b955f476: Merge "Add a "tlsdate" AID for unprivileged tlsdate execution."
* commit 'b955f476d3b11da9378d5eedfc569711f625e1ba':
  Add a "tlsdate" AID for unprivileged tlsdate execution.
2015-10-02 18:41:05 +00:00
Gilad Arnold
b5fa88955c Add a "tlsdate" AID for unprivileged tlsdate execution.
Bug: 23651876
Change-Id: I7ab1bccdcd2434c4af663a1afb9fe9ad124c4428
2015-10-02 08:42:43 -07:00
Jorge Lucangeli Obes
fd7a9f79f2 am 66d32c74: Merge "Use CAP_MASK_LONG for file capabilities."
* commit '66d32c7488e12545218e83195738c95c183760ef':
  Use CAP_MASK_LONG for file capabilities.
2015-09-03 15:55:32 +00:00
Jorge Lucangeli Obes
e920c46e7d Use CAP_MASK_LONG for file capabilities.
Extract the |1ULL << $CAP_NAME| construct to a macro, to avoid
repeating it.

Change-Id: I9312c27130d7e6c5b6ab3b4cc5c70a6b98378b98
2015-09-02 17:18:44 -07:00
Jorge Lucangeli Obes
df01d12e14 am 45ca3d54: am a336cbcd: Merge "Reserve new UID range for OEM."
* commit '45ca3d54e0f6be4237efcef5ff121a263d81971d':
  Reserve new UID range for OEM.
2015-08-01 00:57:07 +00:00
Jorge Lucangeli Obes
b93b9d4867 Reserve new UID range for OEM.
Brillo will need to run new native system services, so reserve
a reasonable UID range to accomodate them. Having 1000 UIDs will
allow us to sub-partition this range if needed.

The range can be used by any OEM, not just Brillo, so name it
accordingly.

Bug: 22555869
Change-Id: I752428ee5025bf064a35ecbe6da50c041d87b724
2015-07-31 14:13:49 -07:00
Elliott Hughes
145afc2cc4 am fb1ecbc5: am e6e71608: Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
* commit 'fb1ecbc55e7edeafb138eb2a60ca89ba9a7b1f0f':
  Use __ANDROID__ instead of HAVE_ANDROID_OS.
2015-07-30 16:50:15 +00:00
Elliott Hughes
9b828adfad Use __ANDROID__ instead of HAVE_ANDROID_OS.
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-07-30 09:33:43 -07:00
Daniel Erat
cca5c3f172 am 3a8a3241: am 4812f8dd: Merge "Add a "dbus" AID for running dbus-daemon."
* commit '3a8a32413615643320bb140a24ab1d77d9aea804':
  Add a "dbus" AID for running dbus-daemon.
2015-07-20 15:26:50 +00:00
Daniel Erat
f7b8cae2ef Add a "dbus" AID for running dbus-daemon.
Bug: 22328216
Change-Id: I8478f57d892c6edeb6b101cfa8b38dc5c6262cb2
2015-07-17 16:04:54 -06:00
Thierry Strudel
df33ffadd2 fs_config: replace getenv('OUT') by new fs_config parameter
Using a getenv('OUT') in such a deep down function is a wrong design
choice. Replacing with explicit parameter that may be NULL in case
device specific files can be accessed from /.
Since TARGET_COPY_OUT_SYSTEM may be defined to something different than
system we also ensure that we use a path relative to TARGET_OUT to
compute path to fs_config_* files.

Bug: 21989305
Bug: 22048934
Change-Id: Id91bc183b29beac7379d1117ad83bd3346e6897b
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2015-07-09 21:47:07 -07:00
Mark Salyzyn
5d9e5efbcd libcutils: add fs_config_generate
Bug: 19908228
Change-Id: Icb0e189a86758bb779b9bdf7c0d92216d297869f
2015-04-15 16:43:07 -07:00
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