Libaaudio Enable Integer Overflow and Bound Sanitizers
Turned on sanitizer flags for integer overflow and bound checking for libaaudio and libaaudio_internal.
Bug: 143307218
Test: Ran the following native tests:
test_aaudio_recovery
test_aaudio_marshalling
test_n_streams
test_bad_disconnect
test_various
test_session_id
test_aaudio_monkey
test_attributes
test_interference
test_atomic_fifo
test_flowgraph
test_return_stop
test_stop_hang
test_full_queue
test_histogram
Ran the following Cts tests:
CtsNativeMediaAAudioTestCases
CtsMediaTestCases
CtsMediaHostTestCases
Change-Id: Ie6af19a5b9618f89f5416bc253ed69351911a359
diff --git a/media/libaaudio/src/Android.bp b/media/libaaudio/src/Android.bp
index 850b1d0..463f606 100644
--- a/media/libaaudio/src/Android.bp
+++ b/media/libaaudio/src/Android.bp
@@ -40,6 +40,20 @@
"libutils",
"libbinder",
],
+
+ sanitize: {
+ integer_overflow: true,
+ misc_undefined: ["bounds"],
+ diag: {
+ integer_overflow: true,
+ misc_undefined: ["bounds"],
+ no_recover: [
+ "bounds",
+ "integer",
+ ],
+ },
+ },
+
}
cc_library {
@@ -57,7 +71,7 @@
export_include_dirs: ["."],
header_libs: [
"libaaudio_headers",
- "libmedia_headers"
+ "libmedia_headers",
],
export_header_lib_headers: ["libaaudio_headers"],
@@ -116,4 +130,17 @@
"flowgraph/SourceI16.cpp",
"flowgraph/SourceI24.cpp",
],
+ sanitize: {
+ integer_overflow: true,
+ misc_undefined: ["bounds"],
+ diag: {
+ integer_overflow: true,
+ misc_undefined: ["bounds"],
+ no_recover: [
+ "bounds",
+ "integer",
+ ],
+ },
+ },
+
}