Commit graph

23936 commits

Author SHA1 Message Date
Stephen Hines
fa1a21d085 Merge "Disable warnings triggered in Clang r271374" 2016-07-19 22:02:31 +00:00
Jorge Lucangeli Obes
d6d8faa690 sdcard: Use std::map.
Having CaseInsensitiveCompare use strcasecomp is not ideal, but other
solutions are not prettier.

Also, add a TODO to fix FUSE_TRACE, broken by the switch to C++.

Bug: 27147273

Change-Id: I0017c3a7d0254eb81abd128b97cd06c5ad0d1dff
2016-07-19 17:01:15 -04:00
Pirama Arumuga Nainar
6fbbc4cdfa Disable warnings triggered in Clang r271374
http://b/28149048
http://b/29823425

Disable -Wvarargs that gets triggered in
system/core/debuggerd/test/ptrace_fake.cpp:ptrace_fake.  The second bug
above tracks that this warning gets re-enabled.

Test: Tested build, boot and common usage for Arm, Arm64, x86, x86_64,
Mips images in AOSP and internal branch.

Change-Id: Ife68675a77431bcc4717b4da297c14dc486d1413
2016-07-19 20:29:05 +00:00
Elliott Hughes
8932be864d Merge \"Remove no-op klog_init.\"
am: 5558cd362b

Change-Id: I3f2112bead6740f1df48bc5b028f62c91d40425b
2016-07-19 19:48:36 +00:00
Treehugger Robot
5558cd362b Merge "Remove no-op klog_init." 2016-07-19 19:39:39 +00:00
Elliott Hughes
489e3fbaa0 Remove no-op klog_init.
Change-Id: I467edad1d004ac16647f4aa1f0eead04e808efa0
2016-07-19 11:45:36 -07:00
Jorge Lucangeli Obes
f565b11716 Merge \"run-as: Use Minijail for privilege dropping.\"
am: ac9b4d47ea

Change-Id: I7f11de0b5136c18b8770b5e25ef6c6c3db117bd1
2016-07-19 18:35:00 +00:00
Treehugger Robot
ac9b4d47ea Merge "run-as: Use Minijail for privilege dropping." 2016-07-19 18:29:27 +00:00
Jorge Lucangeli Obes
2bbdbe8541 logd: Use Minijail for privilege dropping.
Makes code smaller, removes duplication. Using Minijail also allows
adding further sandboxing down the road.

Bug: 30156807
Change-Id: I8fa242fba545049ee82f6655fe6ecc14c53fcab7
2016-07-19 11:15:06 -04:00
Jorge Lucangeli Obes
a377ff0d4a run-as: Use Minijail for privilege dropping.
Arguably, we don't need a ScopedMinijail for a program that only execs,
but I'd rather keep the code consistent and have all uses of Minijail
be good examples.

Bug: 30156807

Change-Id: I08a968835e0f3e2afcd5e7736626edbed658cde2
2016-07-19 11:03:52 -04:00
Amit Pundir
aae7b4984c init: usb: delete rndis func to unregister n/w interface
Rndis n/w interface "usb0" registration/deregistration is broken. If a
user try to switch to other functions or disable usb tethering or unplug
the usb cable then it doesn't kill "usb0" interface.

Fix is to delete Rndis function to unregister tethering interface when
switching from tethering to other functions or disable/unplug the
tethering cable. If we don't do that then the rndis netdev interface
will never be freed or unregistered.

This also means the rndis function has to be created everytime user
enable tethering function from Settings instead of creating it at
"on boot" in init.$hardware.usb.rc like we do currently. A relevant fix,
Change-Id: Icb49020d624fb21ef2607d473948cbbf3b9cc469, for reference has
already been submitted for device/linaro/hikey

Change-Id: If1f922e02277cccdc8c0b263be63989ee102cc80
Reported-by: Winter Wang <wente.wang@nxp.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-07-19 13:11:50 +05:30
Christopher Ferris
84421d8475 Add ioprio values directly.
The ioprio.h header is not a uapi header, so remove it's use and
add the two values that this code needs to use.

Bug: 30072483
Change-Id: I5c8b6f40bd60a43f50ac26792f96d2fa3f6db020
2016-07-18 17:01:05 -07:00
Jorge Lucangeli Obes
3ab30ecf4c Merge \"Use arraysize() for supplementary groups.\"
am: ddbcecec3a

Change-Id: Ia8405d8bc181b1cdbf1f0812c0dbe8f7701747ef
2016-07-18 20:06:19 +00:00
Treehugger Robot
ddbcecec3a Merge "Use arraysize() for supplementary groups." 2016-07-18 20:00:28 +00:00
Mark Salyzyn
4d205f8975 logd: auditd: suppress multiple identical avc: messages to kmsg
Sends first and last of a series of 3 or more indentical avc:
messages to kmsg and adds 'duplicate messages suppressed'
for the last one in the set. eg:

[67.141658] type=1400 audit(1468852100.171:70): avc: ... tcontext=u:object_r:proc:s0 tclass=file
[67.141678] type=1400 audit(1468852107.494:71): avc: ... tcontext=u:object_r:cache_file:s0 tclass=dir
[67.535202] type=1400 audit(1468852107.498:74): avc: ... tcontext=u:object_r:cache_file:s0 tclass=dir duplicate messages suppressed
[67.535227] type=1400 audit(1468852107.888:75): avc: ... tcontext=u:object_r:proc_net:s0 tclass=file

One can look at the sequence numbers in the above example to see that
four identical message were produced, two were dropped.

ToDo: Evaluate multiple streams of duplicate messages.

Bug: 30118730
Change-Id: I31dcda7c8c42edfc7a8f1bf4d9e46284c74b3d18
2016-07-18 12:30:04 -07:00
Jorge Lucangeli Obes
bae15b4f46 Use arraysize() for supplementary groups.
Also make adbd use ScopedMinijail.

Bug: 30191189
Change-Id: I5e259aa466817b51037912aba043ba75bd35f9e1
2016-07-18 13:46:42 -04:00
Jorge Lucangeli Obes
fe4f764e75 Merge \"Use Minijail for privilege dropping.\"
am: 97f49e5cb3

Change-Id: I032ea3fcdac1a16bf36d43731b8533214264fee2
2016-07-18 16:06:38 +00:00
Treehugger Robot
97f49e5cb3 Merge "Use Minijail for privilege dropping." 2016-07-18 15:58:46 +00:00
Mark Salyzyn
c067116ad5 Merge \"logd: Worst Tag filter enabled for events buffer\"
am: c4be85fbba

Change-Id: I9d33328dfb179a914f502c353b4388d79e376eda
2016-07-16 00:33:19 +00:00
Treehugger Robot
c4be85fbba Merge "logd: Worst Tag filter enabled for events buffer" 2016-07-16 00:23:40 +00:00
Mark Salyzyn
607f55de91 Merge \"logd: Replace logd with chatty log tag\"
am: 596e65db60

Change-Id: I88057f1ffb21e6b0863dd0803a7a9be0ee72cb1c
2016-07-15 23:23:51 +00:00
Treehugger Robot
596e65db60 Merge "logd: Replace logd with chatty log tag" 2016-07-15 23:20:11 +00:00
Amit Pundir
91272bd435 Merge \"init: select usb gadget controller at run time\"
am: 916f5e873e

Change-Id: Ifc4ec86c56df0de1ca498f3de392405490690809
2016-07-15 22:53:21 +00:00
Treehugger Robot
916f5e873e Merge "init: select usb gadget controller at run time" 2016-07-15 22:50:29 +00:00
Mark Salyzyn
11b2dbca15 Merge changes If992b53b,Ieab60fd1
am: 7c50033e9f

Change-Id: Ie0fb615394eea100dbcc12519c52bbdba8fb8fe0
2016-07-15 22:39:51 +00:00
Treehugger Robot
7c50033e9f Merge changes If992b53b,Ieab60fd1
* changes:
  logd: rename sort() for pids to sortPids()
  logd: drop prdebug inline
2016-07-15 22:32:08 +00:00
Elliott Hughes
28ccb9a80f Merge \"Lose sendevent to toybox.\"
am: 7a8e0c1381

Change-Id: I22fdb59de7a2fadc9c451ad8193f58dc539ad2c2
2016-07-15 22:19:31 +00:00
Treehugger Robot
7a8e0c1381 Merge "Lose sendevent to toybox." 2016-07-15 22:14:38 +00:00
Amit Pundir
d2e74db475 init: select usb gadget controller at run time
Right now we set sys.usb.controller property in init.$platform.usb.rc
to enable ConfigFS gadgets.

Let system detect and set UDC driver name from /sys/class/udc instead.

Change-Id: I99ad49d24dc53b543c5573e209bf00d6c2d91dd4
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-07-15 15:01:43 -07:00
Mark Salyzyn
6a06694a61 logd: Worst Tag filter enabled for events buffer
- Add drop logistics to TagTable
- replace uid references to a key reference since it
  is an UID for most buffers, but a TAG for the
  events and security buffer
- template the find worst entry mechanics into LogFindWorst class

Bug: 30118730
Change-Id: Ibea4be2c50d6ff4b39039e371365fed2453f17a2
2016-07-15 14:58:17 -07:00
Mark Salyzyn
47684ca591 logd: Replace logd with chatty log tag
Bug: 30118730
Change-Id: I7c7802fef157d5ded02573621d21e0ded3df9745
2016-07-15 14:57:58 -07:00
Mark Salyzyn
0f85817985 logd: rename sort() for pids to sortPids()
Bug: 30118730
Change-Id: If992b53b52a7470427fbe82abb93c95c1b2dc57a
2016-07-15 14:37:04 -07:00
Mark Salyzyn
36a8711260 logd: drop prdebug inline
Makes the prdebug helper accessible for debugging

Bug: 30118730
Change-Id: Ieab60fd18221108ae27c54140a25061ab29ca1a3
2016-07-15 14:36:50 -07:00
Elliott Hughes
c733a763c0 Lose sendevent to toybox.
Change-Id: I460b240c9cec0b0e966ab81ea6fdb0deb61c21bc
2016-07-15 14:17:28 -07:00
Robert Sesek
ed1c074303 Merge \"Add static UID for the webview zygote process.\"
am: 07f5d8cc0c

Change-Id: I7d2382f3e61a405a9b838b02983aa8dbf9aedc74
2016-07-15 21:05:25 +00:00
Treehugger Robot
07f5d8cc0c Merge "Add static UID for the webview zygote process." 2016-07-15 20:58:50 +00:00
Mark Salyzyn
35f7799f16 Merge \"logd: trailing spaces in log statistics\"
am: d59d16a49d

Change-Id: I3f9432af451b13e5641d8ab6a8c275516d636439
2016-07-15 19:04:49 +00:00
Mark Salyzyn
0d9ce37382 Merge \"liblog: pmsg_read add validity checking for prio\"
am: 73cc6edf0e

Change-Id: Iba5e7b7c2325e127eb9f040c8ab86ba24efd5b20
2016-07-15 19:04:48 +00:00
Treehugger Robot
d59d16a49d Merge "logd: trailing spaces in log statistics" 2016-07-15 18:55:58 +00:00
Treehugger Robot
73cc6edf0e Merge "liblog: pmsg_read add validity checking for prio" 2016-07-15 18:55:43 +00:00
Mark Salyzyn
0adcc3e3e8 logd: trailing spaces in log statistics
Bug: 30118730
Change-Id: I8cccbc1da2cf8168ec9cf12f07df4cafef076558
2016-07-15 11:00:44 -07:00
Jorge Lucangeli Obes
c96f53e2fe Use Minijail for privilege dropping.
Having so many copies of privilege-dropping code leads to errors.
De-duplicate this code and use Minijail for it.

Bug: 30156807

Change-Id: I36c85962b913a12efe5648a23cbacc5bcbb3853c
2016-07-15 10:16:59 -04:00
Jorge Lucangeli Obes
da4bc7484f Merge \"Convert fuse.c to C++.\"
am: a17427cb1e

Change-Id: Ie112f67f724e511b6c8ffabd0db04f3e017132cc
2016-07-14 19:47:37 +00:00
Jorge Lucangeli Obes
29b874de70 Merge \"Use C++ logging in sdcard.cpp.\"
am: 2703425de8

Change-Id: I90103d0521bd2cd4de3710adf3bc6013721cb6f9
2016-07-14 19:47:36 +00:00
Treehugger Robot
a17427cb1e Merge "Convert fuse.c to C++." 2016-07-14 19:42:32 +00:00
Treehugger Robot
2703425de8 Merge "Use C++ logging in sdcard.cpp." 2016-07-14 19:41:45 +00:00
Mark Salyzyn
56da612ec4 Merge \"liblog: reset pid and uid cache after a vfork()\"
am: d4f6324176

Change-Id: I3b59f56b2b5f399b079ab9439600dc3a72c669a6
2016-07-14 15:55:55 +00:00
Mark Salyzyn
d4f6324176 Merge "liblog: reset pid and uid cache after a vfork()" 2016-07-14 15:47:33 +00:00
Mark Salyzyn
3d8afe9b01 liblog: pmsg_read add validity checking for prio
Improve pmsg data corruption detection.

Bug: 30085794
Change-Id: I215da4fff07797b8c0a3462f850bafb090adfc68
2016-07-14 07:34:53 -07:00
Mark Salyzyn
ec4f5c776d liblog: reset pid and uid cache after a vfork()
Bionic getuid() and getpid() calls cache to reduce the need to
perform a syscall, and also reset their own cache after a vfork().
No more need for liblog to be performing this flawed cache operation.

Bug: 30085794
Change-Id: I70feed8bff0ddd919c2885a348ba67b14ddc0e0d
2016-07-14 07:34:53 -07:00