arc4random is called by the linker for dlopen to randomize the library
load order, among other uses. It's becoming more widely used over time.
It calls getentropy at regular intervals to reseed itself, which uses
the getrandom system call. This wasn't noticed because it reseeds only
very rarely with typical usage in Android.
This was quickly noticed on CopperheadOS where the hardened allocator
based on OpenBSD malloc uses at least one (often more) byte of entropy
from arc4random for each call to malloc, free, realloc, etc. It's still
needed *eventually* without the hardened allocator but it would take a
lot of plugin loading / unloading, etc. with dlopen / dlclose to hit it
at the moment.
Change-Id: I0a448e833916373871edfc68274ac31e314d54f7
The new unwinder also uses process_vm_readv, so added to all policies.
Bug: 65166211
Test: Did debuggerd -b of media.extractor and media.codec process.
Change-Id: Ifad0bc505602ec4879b0a8efe27c5a12dfa28fab
In order to support servers that have implemented the
dynamic bandwidth adaptation feature are these
fields added to the receiver report:
-Fraction
-Cumulative number of packet loss
The calculation is based on RFC 3550, section A.3.
Test: play RTSP video and check receiver reports with network tool
Bug: 62610498
Change-Id: I2092fb62698e7209c59fade1b17a6460ac236def
MtpFfsHandle now uses kaio to handle usb data.
This achieves better performance without using
the endpoint alloc ioctl.
This also allows ep0 events to be handled without
race conditions. Events will also include control
requests, which will allow both host and device
initiated cancellation.
Bug: 37916658
Bug: 36802721
Test: Transfer various size files, run MtpFfsHandleTest
Test: Cancel transfer on Windows
Test: Allow device to cancel transfer on Windows
Change-Id: Ib3ce996f00782ce7f68f29b2510dbc17f09fdf14
This takes a reference to the event,
which then can become invalid. Instead
pass by copy like normal.
Bug: 64529223
Test: No crash
Change-Id: I2ac7bd0002e6d0ce1c547c24334dfd2926ed7090
(cherry picked from commit 7360303d3e)
AFT will not read the events endpoint at all
causing every sendEvent() to block. Since
event ordering doesn't really matter, send
events in their own detached thread instead.
Bug: 36802721
Test: Connect AFT, create a folder from device, check not frozen
Change-Id: I4b8aee93c19fa9c73e6b2f34d9794a491b2433e1
(cherry picked from commit d80492b819)
If addValue does not succeed, there will be memory leak on
decodeSession. Fixed it by checking if addValue returns true first.
Plus fixed a small indentation error.
Test: mmm with static analyzer and warning disappears.
Change-Id: Ibf9b85e4c416e8fea8b80a3ba47f87f88573c54c
CFI (control flow integrity) implementation is using a MAP_NORESERVE
allocation of up to 2GB is size. Only a tiny portion of it is backed
by physical memory. Take this into account when setting RLIMIT_AS for
media services.
Test: no immediate effect; CFI shadow increase for 48-bit aarch64 can
be reapplied w/o breaking android boot.
Bug: 64293803
See https://android-review.googlesource.com/#/c/platform/bionic/+/424903/.
Change-Id: I8d4e780a8579f3102f97abe0f5c9bf8f3dee3d2f
The size of ae regions may be zero by rounding error.
But it should be at least 1 if metering area size is not zero.
This problem causes CTS fail for
android.hardware.cts.CameraTest#testMeteringAreas on
the device which has the active array width less than 3556
if the preview size is 1920x1080.
Bug: 63795820
Test: ran Camera CTS
Change-Id: Ie3995e40aedba193393df8fd05d95f740a25ef3d
This namespace is not used by this file and its declaration is removed
in a separate CL from utils/Log.h, which is the only place it is
defined, so we must remove this extraneous line.
Also, since that separate CL is deprecating utils/Log.h in favor of
log/log.h, we make the switch to the new header.
Test: Build
Exempt-From-Owner-Approval: Owners file needs updating
Change-Id: I34aa80765d30c79f8cb67eaf95a9995066bd672e
Per the spec, the 'dash' brand indicates support for the concatenation
of an Initialization Segment and a single Indexed Media Segment. Since
we support this, add 'dash' as a supported brand to improve compatibility.
Bug: 63390273
Test: played 'dash' brand file
Change-Id: Ifb38337200857f190085bda030434d7f56a817f3
This CL eliminates the following compiler warning:
MediaPlayerFactory.cpp:249:27: warning: Potential memory leak
Bug: None
Test: After this change the warning is gone.
Change-Id: I09e7ec5cc3bc84decfea2456550b532aac55d26f
There is only one function declared in that header file, and it is
mono_blend, so a more specific filename may be easier to understand.
Test: compiles OK
Merged-In: Ie2aec6c706b1822581b34d3702818b8200a1db8a
Change-Id: Ie2aec6c706b1822581b34d3702818b8200a1db8a
(cherry picked from commit 6bf707f4c0)