Commit Graph

28876 Commits

Author SHA1 Message Date
Adrian Salido 24ef8601c2 init/service.cpp: fix access check for console
Commit 9596d2b95d changes how
availability of console is checked by only checking access bits for
the console device. However, in cases where there is no console it
defaults to /dev/console. This device is always enumerated by tty
driver (i.e. file and access bits may be correct), but it doesn't
always map to an underlying console driver. Because the lookup for the
underlying console driver happens during the open system call, checking
only the access bits is not sufficient and need to make sure open
system call is successful, we can safely close the FD afterwards to
avoid FD leaks.

Test: boot device and check console svc doesn't continuously restart
Bug: 33691649
Change-Id: Ia51a8a2f56c345b70db55e95f61a057a98b52895
2017-01-03 13:11:29 -08:00
Treehugger Robot 891df1c410 Merge "logd: Add support for ro.logd.auditd.[main|events]" 2017-01-03 21:03:55 +00:00
Nick Kralevich 2e58867771 LogAudit.cpp: replace newlines with spaces in audit messages
Some kernels have a bug which causes a newline to show up in audit
messages. The embedded newlines cause one message to look like two due
to prefix controls.

Replace any newlines with spaces. Duplicate spaces are further
consolidated in code immediately after this newly added code.

Test: create an audit message with a newline, and watch it be cleaned up.
Bug: 27878170
Change-Id: Id90c29ab9e10d3be96f51403b0293622d782422a
2017-01-03 12:39:28 -08:00
Josh Gao 6c533a7fb9 adb: fix IOKit handle leaks on OS X.
Bug: https://code.google.com/p/android/issues/detail?id=219085
Test: Removed sleep in RunLoopThread, compared before/after this patch

Bug: http://b/33283523
(cherry picked from commit b6a2f59515)
Change-Id: Ia65bbedfb7d47bdb02bdfb69778784e5e855900b
2017-01-03 11:54:03 -08:00
David Pursell 6cc11187fc Merge "fastboot: update getvar documentation." am: fd979edb57 am: d4158aab30 am: 83c3badb27
am: de27e86a73

Change-Id: Ie0b48e409bb3ac095ee97e78df0988c4bdd80d9b
2017-01-03 18:20:14 +00:00
David Pursell de27e86a73 Merge "fastboot: update getvar documentation." am: fd979edb57 am: d4158aab30
am: 83c3badb27

Change-Id: I02015e1c14c706dbec828fc674b514578abbfa5a
2017-01-03 18:15:58 +00:00
David Pursell 83c3badb27 Merge "fastboot: update getvar documentation." am: fd979edb57
am: d4158aab30

Change-Id: Ia3b23bd908824991652b9444e7830560a5010e24
2017-01-03 18:03:44 +00:00
David Pursell d4158aab30 Merge "fastboot: update getvar documentation."
am: fd979edb57

Change-Id: Ib972ea7b1ec4c61df056e7c394fe0a995f91d09e
2017-01-03 17:55:43 +00:00
David Pursell fd979edb57 Merge "fastboot: update getvar documentation." 2017-01-03 17:45:05 +00:00
Mark Salyzyn ce80da3018 logd: Add support for ro.logd.auditd.[main|events]
log selinux audit messages boolean (true or false, default true)
selection for logging destinations:

ro.logd.auditd - turn on logd.auditd to pick up violations.
ro.logd.auditd.dmesg - to the kernel log.
ro.logd.auditd.main - to the "main" log buffer.
ro.logd.auditd.events - to the "events" log buffer.

We used to also read logd.auditd.dmesg and persist.logd.auditd.dmesg
which do not get refreshed when /data mounts internally.  This is a
confusing state as these properties will be read after a logd crash
and restart, adjusting the behavior of the logger.  Same can be said
for logd.auditd as well.  Drop reading these other parameters.

Test: manual set r/o parameters, stop/start logd to confirm behavior
Bug: 33969000
Bug: 27878170
Change-Id: I1a6bb4a903074c9aa7b227cf583a0094d49cbefd
2017-01-03 09:44:42 -08:00
Elliott Hughes cee26e196b Merge "libziparchive: use _FILE_OFFSET_BITS=64" am: 10a7b9bb8b am: d9bd95e1c1 am: 45c7500b9a
am: 3d42d99996

Change-Id: I47c15f203c8dbc5e356e54984b139be9f1d68192
2016-12-30 20:50:41 +00:00
Elliott Hughes 3d42d99996 Merge "libziparchive: use _FILE_OFFSET_BITS=64" am: 10a7b9bb8b am: d9bd95e1c1
am: 45c7500b9a

Change-Id: I2ca5eb8c65ed61a25e8e7d57da880ad2700b9ce6
2016-12-30 20:42:41 +00:00
Elliott Hughes 45c7500b9a Merge "libziparchive: use _FILE_OFFSET_BITS=64" am: 10a7b9bb8b
am: d9bd95e1c1

Change-Id: If3d14483f410b885958ec2bf42e3e111c9245841
2016-12-30 20:34:41 +00:00
Elliott Hughes d9bd95e1c1 Merge "libziparchive: use _FILE_OFFSET_BITS=64"
am: 10a7b9bb8b

Change-Id: I024b1e1134da7362eeb137581bf69d2b38a147ca
2016-12-30 20:26:09 +00:00
Elliott Hughes 10a7b9bb8b Merge "libziparchive: use _FILE_OFFSET_BITS=64" 2016-12-30 20:21:17 +00:00
Elliott Hughes c57e5d191a Merge "Make libziparchive C++-only." am: b175ee271b am: b7c94f3e50 am: 8f378bc31e
am: 478ffd46ce

Change-Id: I76b54a4cfc7194d884c5919084db342c224416d6
2016-12-30 20:10:07 +00:00
Elliott Hughes 478ffd46ce Merge "Make libziparchive C++-only." am: b175ee271b am: b7c94f3e50
am: 8f378bc31e

Change-Id: I748dfc6bfdf7430a3eda94624258d48b253310b9
2016-12-30 20:02:08 +00:00
Elliott Hughes 8f378bc31e Merge "Make libziparchive C++-only." am: b175ee271b
am: b7c94f3e50

Change-Id: I4776d56008693b1bc05695c7826e791a9d81b197
2016-12-30 19:54:07 +00:00
Elliott Hughes b7c94f3e50 Merge "Make libziparchive C++-only."
am: b175ee271b

Change-Id: Ifaa182ff77248653974e2e8a19e7f36147be47f1
2016-12-30 19:46:07 +00:00
Elliott Hughes b175ee271b Merge "Make libziparchive C++-only." 2016-12-30 19:40:56 +00:00
Mark Salyzyn b84864d3fb Merge "logd: gtest: logd.timeout socket does not clean up properly" am: 7d24dea9cb am: 64d7c7fcb4 am: c6b59d9d8a
am: 44f60cbe9b

Change-Id: I8bfe57d8e45efc72d056c628ebd829f43fc87d06
2016-12-29 23:06:50 +00:00
Mark Salyzyn 44f60cbe9b Merge "logd: gtest: logd.timeout socket does not clean up properly" am: 7d24dea9cb am: 64d7c7fcb4
am: c6b59d9d8a

Change-Id: I9b85ce8d123fa4e3eeb81599a167b0f1855b5e64
2016-12-29 22:59:20 +00:00
Mark Salyzyn c6b59d9d8a Merge "logd: gtest: logd.timeout socket does not clean up properly" am: 7d24dea9cb
am: 64d7c7fcb4

Change-Id: I7ee918327855356185268ba0dbbbc7aa73eaa507
2016-12-29 22:52:14 +00:00
Mark Salyzyn 64d7c7fcb4 Merge "logd: gtest: logd.timeout socket does not clean up properly"
am: 7d24dea9cb

Change-Id: I3ca333142b258e9309f55e1160161b2420d3601a
2016-12-29 22:43:20 +00:00
Treehugger Robot 7d24dea9cb Merge "logd: gtest: logd.timeout socket does not clean up properly" 2016-12-29 22:36:57 +00:00
Mark Salyzyn 1736c4866c logd: gtest: logd.timeout socket does not clean up properly
Until the socket ages out, it sticks around and gets reused in
subsequent tests affecting the outcome of those tests.  We opt
to run logd.timeout in a forked and isolated process to keep
these conditions from interfering.

Adjusted benchmark execute to only run the tests we are
interested in to improve the time it takes to run.

Commented some areas of code to make them easier to maintain.

Test: gTest logd-unit-tests success
Bug: 33962045
Change-Id: Ic1b98bc4a2d7e8927f1a87628e3bcc368c9cf8ce
2016-12-29 12:59:22 -08:00
Tomasz Wasilczyk fd08e55799 Fix typo in radio_metadata_t definition.
Test: none, this code is unused yet.

Change-Id: I515aac5ce56e706225518cf7f6cbd1a28750001b
2016-12-29 11:55:52 -08:00
Elliott Hughes a970c8f1fc Make libziparchive C++-only.
If we're going to build libziparchive with _FILE_OFFSET_BITS=64, which
seems like a reasonable idea, we don't want off_t/off64_t mixups in the
ABI, and C++ name mangling helps protect against that where C wouldn't.

Bug: N/A
Test: builds
Change-Id: I5f068b41fb4cd9e1e055e5250054318b35bcbc08
2016-12-29 10:38:37 -08:00
Jorge Lucangeli Obes 807166209e Merge "init: Make 'write_file' return bool to match 'read_file'." am: 3553ae73fb am: 2115424df1 am: 4534a8a568
am: f8de7dbb55

Change-Id: Iebbbaa3b46a8173d0f49bb6e45dc001932b61a0d
2016-12-29 17:54:33 +00:00
Jorge Lucangeli Obes f8de7dbb55 Merge "init: Make 'write_file' return bool to match 'read_file'." am: 3553ae73fb am: 2115424df1
am: 4534a8a568

Change-Id: Idd1fe4933dc634521fda3d369ac934adc954b0ac
2016-12-29 17:46:32 +00:00
Jorge Lucangeli Obes 4534a8a568 Merge "init: Make 'write_file' return bool to match 'read_file'." am: 3553ae73fb
am: 2115424df1

Change-Id: I4711a702bfcfeba99933774fde62d7c124fabf12
2016-12-29 17:38:33 +00:00
Jorge Lucangeli Obes 2115424df1 Merge "init: Make 'write_file' return bool to match 'read_file'."
am: 3553ae73fb

Change-Id: Ieb1c31a36d7b89ab044016c333e4513b206c2479
2016-12-29 17:31:02 +00:00
Treehugger Robot 3553ae73fb Merge "init: Make 'write_file' return bool to match 'read_file'." 2016-12-29 17:24:18 +00:00
Jorge Lucangeli Obes 77f0e9fda8 init: Make 'write_file' return bool to match 'read_file'.
The mismatch of return values makes reasoning about the correctness of
CLs like https://android-review.googlesource.com/317923 quite hard.

Bug: 33941660
Test: Init builds, HiKey boots.
Change-Id: Ia4b8a9af420682997b154a594892740181980921
2016-12-28 14:16:54 -05:00
Narayan Kamath e5aee79e9c Lazily preload secondary zygote resources.
Companion to change Id387b7132d0 in frameworks/base.

Test: manual
Change-Id: I3f50327aafddce8530a990505cd436225c5fe7a7
2016-12-28 15:17:52 +00:00
Mark Salyzyn 663b5daf4b Merge changes I6145bae8,Ia9452b3e am: f37948d659 am: bf5f495d3e am: 25f6d2b5a6
am: adf610cd05

Change-Id: I048c29b332386619d01d065320aa4ca7138800f2
2016-12-27 21:16:11 +00:00
Mark Salyzyn 9abc0b8ec5 logcat: unit test produces log stutter am: a46326a51c am: 9dd61ae4d7 am: 55a79c5b81
am: de3cc9af6f

Change-Id: Ifbb19bdc251af06a9000538246b25597de65d2d7
2016-12-27 21:16:01 +00:00
Mark Salyzyn 1d54a0d57e liblog: test failures due to permission issues am: af3503cff4 am: 2720e854df am: a229eab3ca
am: 989ff34d84

Change-Id: I67ee38f72a197167e7d384aeaaf3eef3e8324b38
2016-12-27 21:15:53 +00:00
Mark Salyzyn adf610cd05 Merge changes I6145bae8,Ia9452b3e am: f37948d659 am: bf5f495d3e
am: 25f6d2b5a6

Change-Id: I8efe9478278b5c31ac4a7dca9c19ff9293069fcc
2016-12-27 21:09:07 +00:00
Mark Salyzyn de3cc9af6f logcat: unit test produces log stutter am: a46326a51c am: 9dd61ae4d7
am: 55a79c5b81

Change-Id: I8f86fc5fc076264da30cb1f2b8ced54ef7ef3a85
2016-12-27 21:09:00 +00:00
Mark Salyzyn 989ff34d84 liblog: test failures due to permission issues am: af3503cff4 am: 2720e854df
am: a229eab3ca

Change-Id: I347b0a32904fc28064d765e29aaa78d8430423ae
2016-12-27 21:08:53 +00:00
Mark Salyzyn 25f6d2b5a6 Merge changes I6145bae8,Ia9452b3e am: f37948d659
am: bf5f495d3e

Change-Id: Iecf5496a69864580f314817f207b8782bb91c8a1
2016-12-27 21:01:36 +00:00
Mark Salyzyn 55a79c5b81 logcat: unit test produces log stutter am: a46326a51c
am: 9dd61ae4d7

Change-Id: If78f0d82a28de9b3bf66d5cf3a6df3e497bc7b16
2016-12-27 21:01:29 +00:00
Mark Salyzyn a229eab3ca liblog: test failures due to permission issues am: af3503cff4
am: 2720e854df

Change-Id: Ied5bd03cc299e7340165bb67d6773cdffa912287
2016-12-27 21:01:22 +00:00
Mark Salyzyn bf5f495d3e Merge changes I6145bae8,Ia9452b3e
am: f37948d659

Change-Id: I784a5c9ebada3f58ff73875ca5a971756dcbdf52
2016-12-27 20:54:30 +00:00
Mark Salyzyn 9dd61ae4d7 logcat: unit test produces log stutter
am: a46326a51c

Change-Id: I9cb8d659b92e580ddca45b9dac1c0f15092fde30
2016-12-27 20:54:28 +00:00
Mark Salyzyn 2720e854df liblog: test failures due to permission issues
am: af3503cff4

Change-Id: I2b9be834307b2bd342e397f4a7b69b53a4c7dc44
2016-12-27 20:54:22 +00:00
Treehugger Robot f37948d659 Merge changes I6145bae8,Ia9452b3e
* changes:
  logcat: unit test produces log stutter
  liblog: test failures due to permission issues
2016-12-27 20:45:31 +00:00
Mark Salyzyn a46326a51c logcat: unit test produces log stutter
logd now counts multiple identical messages, causing messages to be
held back.  Stop doing that in the tests.  When that filter appeared,
the logcat-unit-tests went from 23 seconds to a couple of minutes of
runtime breakign the automated testing.

Test: gTest logcat-unit-tests total time less than 1 minute.
Bug: 33845198
Bug: 33535908
Change-Id: I6145bae89b6d5e5024ef4f8fe66440c9ae53f7c6
2016-12-27 19:13:00 +00:00
Mark Salyzyn af3503cff4 liblog: test failures due to permission issues
Test: gTest liblog-unit-tests passes
Change-Id: Ia9452b3ee9e6068723e8bef48c4d88d3769951a8
2016-12-27 10:01:42 -08:00