Commit graph

60 commits

Author SHA1 Message Date
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
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
TreeHugger Robot
a9ebc71030 Merge "Fix stack-buffer-overflow in mps module" 2018-09-05 01:22:50 +00:00
TreeHugger Robot
9b7495bf5f Merge "Fix for segmentation fault in xaac decoder execute" 2018-09-04 23:37:34 +00:00
TreeHugger Robot
245cec9182 Merge "Fix for stack-buffer-underflow in sbr module" 2018-09-04 23:36:57 +00:00
Ramesh Katuri
e76a347107 Fix for stack-buffer-underflow in sbr module
Input stream contains program config element with
object type as AAC_SSR. Current xaac decoder doesn't
support this profile. There is an error check for
unsupported profiles,which is not handled properly,
because of which bit stream is parsed further and
wrong values are getting populated using unsupported
bit stream. These wrong value is causing stack buffer
underflow in sbr decoder.

Bug:112712154
Test: re-ran poc
Change-Id: Ia704a4abfb210cd7f6ccf9b0a0be630d86607966
2018-09-04 13:25:34 -07:00
Ramesh Katuri
7c86bb9485 Fix for segmentation fault in header initialization
This error stream contains two elements (CPE and CCE). Because
the stream is an erroneous for CCE at the time of initialization
number of channel is 1 and at the time of execution it is 2.

So code is modified to populate memory based on MAXIMUM CHANNELS
allowed for SBR

Bug:112711350
Test: poc
Change-Id: Ia4b75694ae29d025289d0f85123ce2b24f9c1022
2018-09-04 11:55:48 -07:00
Ramesh Katuri
0ba12cd042 Fix for segmentation fault in xaac decoder execute
Code was modified to handle both fatal and nonfatal errors.
Initially non fatal errors from general audio header decode
were ignored because of which there is segmentation fault
occurring while accessing channel info during execute call

Bug:112552509
Test: poc
Change-Id: I39bc9513ed9e408bc43d9e3746d221852f2aa4f9
2018-09-04 11:49:00 -07:00
Ramesh Katuri
55c1da8c37 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
2018-09-04 11:28:12 -07:00
Ramesh Katuri
ace5ddf259 Fix for crash in aac decode frame
This is an erroneous stream in which element is SCE and
channel config in general audio header is 2.

Added check the handle such erroneous cases

Bug:112705708
Test: re-ran poc
Change-Id: Ia1f057621ae954f6ae53027301cf6f1f6780011b
2018-09-04 11:00:08 -07:00
Ramesh Katuri
4e5b9cb8f6 Fix for segmentation fault in hf generator
Number of envelopes is becoming zero because of erroneous input
stream.Inside SBR start band and stop band are calculated based
on number of envelope's.

In this case start bands is becoming negative. In sbr processing
buffer is accessed from start to stop band. This is causing OOB
read access

Bug:113037143
Test: poc
Change-Id: Iade10e8cb86676784703e7226b7e132761eb12b1
2018-09-04 10:51:31 -07:00
Ramesh Katuri
69f8d42a89 Fix for stack buffer underflow in sbr
Sbr frame size is not getting updated in all the sbr decoder
calling paths, because of which in one of the paths the number
of samples are passed as 0 to sbr decode call.

Inside the sbr decode call one of the buffer is accessed with
(shifted value of this number of samples - offset),
which is becoming negative in this cause. This negative offset
is causing OOB read access.

Bug:113263695
Test: poc from bug
Change-Id: I8fb5391a6ba9dd4919f8b761de295d02dda685b4
2018-09-04 10:39:04 -07:00
Ray Essick
34b8bb675e Fix 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

[this reconciles the full fix being added to P and that master already
had part of the fix as part of a separate bug]

Bug:112857941
Test: poc+ASAN
Change-Id: Ia94ff33f2caf5c8b44b9a85a8f0e6c0ddecc24b9
2018-08-31 10:12:43 -07:00
Ramesh Katuri
28a1411d72 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
2018-08-31 00:07:03 +00:00
Ramesh Katuri
2491a07484 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
2018-08-30 17:02:10 -07:00
Ramesh Katuri
cad0d07efc Fix for segementation fault in mps_apply function
Bug: 111050781

This fix has a depedency on fix provided for Bug: 110469747

Change-Id: I928c7de376eb806e38501c4c662567e29540f118
Test: poc from bug
2018-08-23 16:00:28 -07:00
TreeHugger Robot
76b7c186f2 Merge "Fix for stack corruption in esbr" into pi-dev 2018-08-09 19:20:45 +00:00
Ramesh Katuri
e43b180758 Fix for ubsan add-overflow
Bug: 110468609
Test: poc before/after
Change-Id: Ic8698c6b4eb20a1204488fc1bdd14def7fa1d171
(cherry picked from commit 9ccb84f227)
2018-07-27 22:23:11 +00:00
TreeHugger Robot
d191a180be Merge "Fix for segmentation fault in ixheaacd_sbr_dec_from_mps" 2018-07-13 20:31:22 +00:00
Ray Essick
a5c232f0d2 Merge changes I345fc5a4,I5495b01d,I4ca17f0c,I24b01b4a,I40f74385, ...
* changes:
  Fix for Segmentation fault in esbr co variance calcualtion
  Fix for Segmentation fault in ixheaacd_sbr_dec_from_mps
  Fix for segmentation fault in ixheaacd_dec_envelope
  Fix for sanitizer multiplication overflow error
  Fix for Segmentation fault in ixheaacd_mps_apply_pre_matrix
  Fix for ubsan add-overflow
  Fix for sub-overflow in aarch64 binary
  Fix memory leak in XAAC
2018-07-13 18:27:40 +00:00
Ray Essick
d73533ed86 Merge "Changes based on review comments" 2018-07-13 18:24:54 +00:00
Ramesh Katuri
5464927f0c Fix for stack corruption in esbr
Bug: 110769924
Test: poc from bug before/after
Change-Id: I99c6e89902064849ea1310c271064bdeccf7f20e
(cherry picked from commit 7e90d745c2)
2018-07-12 23:36:28 +00:00
Ramesh Katuri
7e90d745c2 Fix for stack corruption in esbr
Bug: 110769924
Test: poc from bug before/after
Change-Id: I99c6e89902064849ea1310c271064bdeccf7f20e
2018-07-10 16:55:00 -07:00
Ramesh Katuri
ffaed483f8 Fix for segmentation fault in ixheaacd_sbr_dec_from_mps
Bug: 110469747
Test: re-run poc
Change-Id: I576c06a1f3fa16d2818a2f2a2190ae382f38c5e3
2018-07-03 15:00:30 -07:00
Ramesh Katuri
ed94c80fe8 Fix for Segmentation fault in esbr co variance calcualtion
Bug: 110770874
Test: re-run poc
Change-Id: I345fc5a410a95e2b313c6c5b773c3a68733d6bd7
2018-07-03 14:26:48 -07:00
Ramesh Katuri
70396d6ced Fix for Segmentation fault in ixheaacd_sbr_dec_from_mps
Bug: 110629822
Test: re-run poc
Change-Id: I5495b01d5d0c779185ff04eb8f1c048f353396b2
2018-07-03 14:18:07 -07:00
Ramesh Katuri
ed84995ea7 Fix for segmentation fault in ixheaacd_dec_envelope
Bug: 110617740
Test: rerun poc
Change-Id: I4ca17f0c3e350c8020d2eecfb1519980c7cdff6f
2018-07-03 14:07:15 -07:00
Ramesh Katuri
8cacf1f5bc Fix for sanitizer multiplication overflow error
Bug: 110596152
Test: re-run POC
Change-Id: I24b01b4ab13987abd028f013262f732cd06e81f8
2018-07-03 13:57:13 -07:00