Commit graph

536 commits

Author SHA1 Message Date
Ramesh Katuri
a4b8a3ae6c Merge "Fix of OOB write in drc downmix instruction count parsing" into pi-dev am: cbc35bf28a
am: 31442931bf

Change-Id: I017e5332a0bc7a6216e48115781b851e1cdfb8f9
2018-10-02 20:12:22 -07:00
Ramesh Katuri
800e33dda4 Fix for OOB write in split drc characteristic parsing am: 599ca4428a
am: dd526f9763

Change-Id: I77e5ad8281039621d63f135d418d0db804f86d38
2018-10-02 20:05:03 -07:00
TreeHugger Robot
8630b598a9 Merge "Fix for heap buffer over flow in drc bit stream parsing" into pi-dev 2018-10-03 00:47:21 +00:00
TreeHugger Robot
c7c160e98c Merge "Fix for OOB loudness eq instruction parsing" into pi-dev 2018-10-03 00:38:36 +00:00
TreeHugger Robot
84b3433dbd Merge "Fix for OOB write in filter block parsing in drc" into pi-dev 2018-10-03 00:31:00 +00:00
Ramesh Katuri
17825d4a75 Fix for OOB write in parsing drc ext
Validate drc coefficient counts as we parse them from the stream.

Bug: 116224432
Test: vendor
Change-Id: I5a78521b8acfcdc7af96b91e5687d4f02ce49e54
2018-10-02 17:00:13 -07:00
TreeHugger Robot
a97968adcd Merge "Fix for OOB write in parametric drc instruction parsing" into pi-dev 2018-10-02 23:17:33 +00:00
TreeHugger Robot
cbc35bf28a Merge "Fix of OOB write in drc downmix instruction count parsing" into pi-dev 2018-10-02 23:16:51 +00:00
Ramesh Katuri
c90eeb6e61 Fix for heap buffer over flow in drc bit stream parsing
Bound values that we parse from the input stream.

Bug: 115375616
Test: vendor
Change-Id: I357d8e19e377fbe5156e5a639ed9ab99cbfeed52
2018-10-02 15:56:02 -07:00
Ramesh Katuri
69a69acbc9 Fix for OOB write in filter block parsing in drc
Bug: 116467350
Bug: 116469592
Test: vendor
Change-Id: I2f7bff1cec3d0d60e9d43217290392bf4e23d207
2018-10-02 15:51:13 -07:00
Ramesh Katuri
cd74db5553 Fix for OOB loudness eq instruction parsing
Bounds checking on value parsed from input stream.

Bug: 116020594
Test: vendor
Change-Id: I915f36ca27b982c8f1b11a533969e40fbff3b765
2018-10-02 15:29:07 -07:00
Ramesh Katuri
599ca4428a Fix for OOB write in split drc characteristic parsing
added bounds check on values parsed from input stream.

Bug: 116619337
Test: vendor
Change-Id: Ia938ce45cb0503c1ddcbeaa5d036c0f57521a38f
2018-10-02 13:18:16 -07:00
Ramesh Katuri
df1030d8b9 Fix of OOB write in drc downmix instruction count parsing
Check bounds of parsed value.

Bug: 116619387
Test: vendor
Change-Id: Iada4937f7d99744594a1d457ae1bddefe961ba4f
2018-10-02 11:21:44 -07:00
Ramesh Katuri
d735e2e329 Fix for OOB write in parametric drc instruction parsing
Bug: 116715245
Test: vendor
Change-Id: I24c7ce7cd8c928d53a9914d116de4c6b408cfb09
2018-10-02 10:08:37 -07:00
Ramesh Katuri
cb9230e387 Fix for heap buffer overflow in ixheaacd_aac_read_2bytes
Bug:116474108
Test: vendor
Change-Id: I150ac7ffc3d0b447fe09f8b95e51882c7a63f8a1
2018-10-01 16:07:01 -07:00
Ramesh Katuri
f0ec571e6c Fix for OOB write in gain set param's parsing am: 90b76d9431
am: 5d2f71e575

Change-Id: I4020eef00283f57d973ffc512d9541b2dcae46f5
2018-10-01 13:28:54 -07:00
Ramesh Katuri
90b76d9431 Fix for OOB write in gain set param's parsing
Check extracted size against array sizing before proceeding.

Bug: 116715937
Test: poc
Change-Id: Ic26b85683342fa5f508b66f4ad71badb06540f17
2018-09-30 19:54:50 -07:00
Ramesh Katuri
e52cf062e5 Fix for global buffer over flow in error handler.
Error code was OR'ed with its current value during
spectral data reading, causing it to become greater
than allowable range in error message pointer. As fix,
removed the OR operation on error code.
Also added missing returns after TNS data read.

Bug:114744498
Test: poc
Change-Id: I62d97f4c6184ad200e8e5f90f6f9b128c3b6127b
2018-09-26 09:52:04 -07:00
Ramesh Katuri
be24fb5180 Fix for un-initialized adts header in header decode
adts header structure has been initialized to zero

Bug:113035086
Test: manual
Change-Id: Ifa7d6332899e5a44bb1e818ba1dd92f169c5eb70
2018-09-25 14:36:34 -07:00
Ramesh Katuri
33d73e6032 Fix for parsing erroneous Program Config Element
Input stream contains an erroneous PCE. While parsing
PCE error code was not handled properly,because of this
number of channels are updated with wrong value.

Internal buffers are accessed using number of channels
as array index,because of wrong number of channels
NULL pointer is getting deferred

Bug: 112715634
Test: poc
Change-Id: I3e3d30fed737d62f52f2757b547fe26f1c9c06da
2018-09-25 12:48:32 -07:00
TreeHugger Robot
cc01cad899 Merge "Fix for un-initialized adts header structure in api" 2018-09-20 15:34:40 +00:00
TreeHugger Robot
b6b126bbfc Merge "Fix for OOB access due to icc index parsing" 2018-09-20 15:33:54 +00:00
Ramesh Katuri
c870c1c056 Fix for un-initialized adts header structure in api
adts header has been initialized to zero

Bug:113035224
Test: poc
Change-Id: I2885a16c8919fd9ce95982899eab90c1896db653
2018-09-18 17:14:32 -07:00
Ramesh Katuri
ce352fa040 Fix for OOB access due to icc index parsing
Out of bound access in mps parsing. Erroneous stream
is causing OOB access (array index becomes OOB).As a
fix, this index is limited to allowable range.

Bug:112859714
Test: poc
Change-Id: Ib9a955de021988d28ef5a2326fbd893e22e58f75
2018-09-18 15:18:24 -07:00
Ramesh Katuri
4275331d8a Fix for heap buffer over flow in scale factor read
For this stream, input size is very high that causes scale
factor reading to read beyond bit-buffer pointer end limit
due to no OOB access check. As a fix, added this check in
the bit read functionality.

Bug:113508105
Test: poc+asan
Change-Id: I8323815928c3104af0f037ed599455d6e239f926
2018-09-18 14:03:24 -07:00
Ramesh Katuri
b25f096d7b Fix for heap buffer overflow in huff code reorder
For this stream, input size is very high that causes
huffman decoding to access beyond bit-buffer pointer
end limit due to no OOB access check. As a fix,added
this check in the bit read functionality.

Bug:112611181
Bug:113508101
Test: poc before/after
Change-Id: I4b7cc9624a388e8a20c7d4b11998dfed9c90d3f6
2018-09-18 13:05:13 -07:00
Ray Essick
9669ec8349 Merge "Fix for heap buffer overflow in aac showbit_32 function" 2018-09-14 19:02:36 +00:00
Ramesh Katuri
2d55c27aed Fix for heap buffer overflow in aac showbit_32 function
Subtraction overflow was obseerved in the process window
sequence function which was fixed by adding saturation
check after subtraction. Bits available in rvlc decode
function is becoming negative. A check has been added
before reading bits from input buffer.

Bug:113262406
Test: poc with ASAN
Change-Id: I729420c9df163b9c8cf474e884c8b6d137781855
2018-09-12 13:35:01 -07:00
TreeHugger Robot
7bcd685928 Merge "Fix for stack buffer underflow in sbr" 2018-09-12 19:23:35 +00:00
Ramesh Katuri
aed3058dd7 Fix for global buffer overflow in scale factor processing
Number of envelopes is equal to 2^n, where n obtained by
reading 2 bits from bit stream,so maximum value for number
of envelopes is 8. Time slot array table is accessed using
number of envelopes. The Minimum and Maximum values are 0
and 6,based on these values the table is modified.

Bug:112765917
Test: re-run poc
Change-Id: I42a44fc2376536d5119a8290a14726c9c5badd19
(cherry picked from commit 61a09f1063)
2018-09-10 23:19:35 +00:00
Ramesh Katuri
c01adbdf8e Fix for crc related issues
Maximum crc registers allowed is 7. Crc registers are accessed
and updated inside the function ixheaacd_adts_crc_start_reg().
Check has been added before the function call so that if the
register value is less than 7 then only the function gets called.

Bug:112551726
Bug:112551874
Bug:112609715
Bug:112713720
Bug:112715795
Bug:113261928
Test: poc
Change-Id: I3935546b8fb3dc5c82bee16639df771349e6d2b6
(cherry picked from commit 55c1da8c37)
(cherry picked from commit b0768b0564)
2018-09-10 23:19:33 +00:00
Ramesh Katuri
4b4d251b4a Fix for NPD in case of single coupling channel element.
Reason for crash:
    For the below reported issues input stream has only one
coupling channel element. As per the specification coupling
channel element should be associated with at least one main
channel element.

We have different output buffers for main channel
and coupling channel. In this error case the coupling
channel output buffer is not getting updated because
there is no main channel, so main decode is called with
output buffer pointing to NULL.
This is the reason for all the issues listed below.

Bug:112551721
Bug:112704700
Bug:112706520
Bug:112710190
Bug:112712274
Bug:112717301
Test: re-run poc
Change-Id: Ife593ca4ae21f05555b6a89092ff76b974e28a67
(cherry picked from commit b5597cea85)
2018-09-10 23:19:31 +00:00
Ramesh Katuri
171b2f9d33 Fix for heap buffer overflow in xaac decoder init
Number of elements allowed in usac profile are 16. Erroneous input
stream in this use case has 63336 elements.We have an error
check for this max number of elements while parsing the decoder
configuration.This returned error code was not handled properly.

Maximum 16 config elements can be used while codec creation,because
of number of elements values is coming as 63336, during
creation time OOB read is happening.

Bug:112766520
Bug:112857468
Bug:112913145
Bug:112918261
Test: re-ran poc
Change-Id: If9413546371f72a6896f5c7e7d22a314e484cf76
(cherry picked from commit 4878ef09c7)
2018-09-10 23:19:28 +00:00
Ramesh Katuri
3195d044e9 DO NOT MERGE Fix for stack-buffer-overflow in mps module
While parsing the input stream in mps_pre_matrix function,
there was an error.This error was not handled properly,
because of which further values which are read from bit stream
are getting wrong values.

We use these value in iteration in ixheaacd_mps_getstridemap()
which is causing stack-buffer-overflow

Bug:112857941
Test: poc+ASAN
Change-Id: I9549b06e0e4e362f517869aef75d579e3e4140a6
(cherry picked from commit 28a1411d72)
2018-09-10 23:19:26 +00:00
Ramesh Katuri
ed646d54a5 Fix for out of bound write memory access in xheaac
The maximum number of channels supported for usac profile in
libxaac decoder is two only.Input streams of the below reported
issues contain multi channel,because of multi channel the write
offset is incremented by greater 2, which causes out of bound
memory access while writing.

Bug:112858010
Bug:112859113
Test: re-run POC
Change-Id: Ide57cb8ee39d77d0f386298e899683d460a3c18b
(cherry picked from commit 2491a07484)
2018-09-10 23:19:24 +00:00
Ray Essick
d12d78c4af Merge "Fix for segmentation fault in hf generator" 2018-09-07 01:55:36 +00:00
Ramesh Katuri
3962dc8c9c Merge "Fix for global buffer overflow in scale factor processing" into pi-dev am: d68bf5d05d
am: 16bc207b39

Change-Id: I76bad91caa4671779701af9dcf8040503b810f02
2018-09-06 16:49:30 -07:00
TreeHugger Robot
d68bf5d05d Merge "Fix for global buffer overflow in scale factor processing" into pi-dev 2018-09-06 22:38:10 +00:00
Ramesh Katuri
79bcb536d6 Merge "Fix for NPD in case of single coupling channel element." into pi-dev am: 3320901848
am: 9f984c3d53

Change-Id: Ia3ac7fbf6a0775b26d9cf88c0a7c62635701b34b
2018-09-06 12:42:50 -07:00
Ramesh Katuri
b0768b0564 Fix for crc related issues
Maximum crc registers allowed is 7. Crc registers are accessed
and updated inside the function ixheaacd_adts_crc_start_reg().
Check has been added before the function call so that if the
register value is less than 7 then only the function gets called.

Bug:112551726
Bug:112551874
Bug:112609715
Bug:112713720
Bug:112715795
Bug:113261928
Test: poc
Change-Id: I3935546b8fb3dc5c82bee16639df771349e6d2b6
(cherry picked from commit 55c1da8c37)
2018-09-06 18:32:13 +00:00
TreeHugger Robot
3320901848 Merge "Fix for NPD in case of single coupling channel element." into pi-dev 2018-09-06 18:14:27 +00:00
Ramesh Katuri
61a09f1063 Fix for global buffer overflow in scale factor processing
Number of envelopes is equal to 2^n, where n obtained by
reading 2 bits from bit stream,so maximum value for number
of envelopes is 8. Time slot array table is accessed using
number of envelopes. The Minimum and Maximum values are 0
and 6,based on these values the table is modified.

Bug:112765917
Test: re-run poc
Change-Id: I42a44fc2376536d5119a8290a14726c9c5badd19
2018-09-06 11:08:38 -07:00
Ramesh Katuri
b5597cea85 Fix for NPD in case of single coupling channel element.
Reason for crash:
    For the below reported issues input stream has only one
coupling channel element. As per the specification coupling
channel element should be associated with at least one main
channel element.

We have different output buffers for main channel
and coupling channel. In this error case the coupling
channel output buffer is not getting updated because
there is no main channel, so main decode is called with
output buffer pointing to NULL.
This is the reason for all the issues listed below.

Bug:112551721
Bug:112704700
Bug:112706520
Bug:112710190
Bug:112712274
Bug:112717301
Test: re-run poc
Change-Id: Ife593ca4ae21f05555b6a89092ff76b974e28a67
2018-09-06 09:53:01 -07:00
Ramesh Katuri
9b9fac25dc Merge "Fix for heap buffer overflow in xaac decoder init" into pi-dev am: 1ef552efbb
am: 5457a1a10b

Change-Id: Iadf7659ac3b662c34a6d69ad6346be02d2e05047
2018-09-05 21:24:14 -07:00
TreeHugger Robot
1ef552efbb Merge "Fix for heap buffer overflow in xaac decoder init" into pi-dev 2018-09-05 23:52:56 +00:00
Ray Essick
4a435ff6c0 Merge "DO NOT MERGE Fix for stack-buffer-overflow in mps module" into pi-dev 2018-09-05 23:27:00 +00:00
Ramesh Katuri
4878ef09c7 Fix for heap buffer overflow in xaac decoder init
Number of elements allowed in usac profile are 16. Erroneous input
stream in this use case has 63336 elements.We have an error
check for this max number of elements while parsing the decoder
configuration.This returned error code was not handled properly.

Maximum 16 config elements can be used while codec creation,because
of number of elements values is coming as 63336, during
creation time OOB read is happening.

Bug:112766520
Bug:112857468
Bug:112913145
Bug:112918261
Test: re-ran poc
Change-Id: If9413546371f72a6896f5c7e7d22a314e484cf76
2018-09-05 14:50:05 -07:00
Ramesh Katuri
adf66776bd Fix for out of bound write memory access in xheaac am: 2491a07484
am: 3a3f02636d

Change-Id: I7a210a9fa6cd29f4ba2a51313d505f8b764a7ca8
2018-09-05 13:06:22 -07:00
TreeHugger Robot
b33fd4a962 Merge "Fix for crash in aac decode frame" 2018-09-05 01:38:10 +00:00
TreeHugger Robot
d7576e3382 Merge "Fix for crc related issues" 2018-09-05 01:31:25 +00:00