Commit graph

1401 commits

Author SHA1 Message Date
Santhosh Behara
e14e79f8ef mm-video-v4l2: venc: Avoid buffer access after free am: 2cd0260b52
am: bf218371f6

Change-Id: I9df71da6eca1d201882005b3bdbfd84f0465a1d7
2017-10-10 19:41:34 +00:00
Santhosh Behara
c454469b5f mm-video-v4l2: venc: Protect buffer from being freed while accessing am: 6ec830ac0c
am: c566cb0e26

Change-Id: I0b9c874343a78ab932c7213cf9a28685a164678e
2017-10-10 19:41:33 +00:00
Santhosh Behara
43e5970a5f mm-video-v4l2: venc: Avoid buffer access after free
am: cdb855bdd1

Change-Id: I9200739f22fe887dd705f1f3c302dfe59d291420
2017-10-10 19:41:00 +00:00
Santhosh Behara
25054f9689 mm-video-v4l2: venc: Protect buffer from being freed while accessing
am: 2c15b5832a

Change-Id: I833b9efc82027a5e258a171d94e2abb6367eb3ea
2017-10-10 19:40:57 +00:00
Santhosh Behara
bf218371f6 mm-video-v4l2: venc: Avoid buffer access after free
am: 2cd0260b52

Change-Id: I534a3498295bfeceb2e4a8396bda24f48ece4a86
2017-10-10 19:38:02 +00:00
Santhosh Behara
c566cb0e26 mm-video-v4l2: venc: Protect buffer from being freed while accessing
am: 6ec830ac0c

Change-Id: I2efd77b960bac14cf1b8e043a3935bcad6a253b1
2017-10-10 19:38:00 +00:00
Santhosh Behara
cdb855bdd1 mm-video-v4l2: venc: Avoid buffer access after free
client expects buffer to be free if free_buffer
is called, but if omx is in executing state free
buffer call will error out.
When async thread tries to copy data to client
buffer which is already freed,it leads to crash.
Added a bitmask to avoid copy to buffer after free.

Bug: 36130225

CRs-Fixed: 2106434

Author:    Uma Mehta <umamehta@codeaurora.org>

Change-Id: Id439aac54ee64a65ea68b6431a9f5150255a6980
2017-09-28 08:54:45 -07:00
Santhosh Behara
2c15b5832a mm-video-v4l2: venc: Protect buffer from being freed while accessing
Output buffer (in use-buffer mode) has an internal backup ion buffer.
The contents of this buffer are deep-copied in client's buffer in
the context of VideoEncCallBackThread; while this buffer can be
freed in the client thread's context.
Check the allocation bitmask before attempting to copy and
synchronize these operations by holding a lock

Fixes bug 36130225
 Security Vulnerability - Heap use after free in libOmxVenc

CRs-Fixed: 2053101

Author: Praveen Chavan <pchavan@codeaurora.org>

Change-Id: I6141e81d7dbd50bc3601c8df066fd8cbd06b4e0b
2017-09-28 08:54:24 -07:00
Santhosh Behara
2cd0260b52 mm-video-v4l2: venc: Avoid buffer access after free
client expects buffer to be free if free_buffer
is called, but if omx is in executing state free
buffer call will error out.
When async thread tries to copy data to client
buffer which is already freed,it leads to crash.
Added a bitmask to avoid copy to buffer after free.

Bug: 36130225
CRs-Fixed: 2106434

Author: Uma Mehta <umamehta@codeaurora.org>

Change-Id: Id439aac54ee64a65ea68b6431a9f5150255a6980
2017-09-20 10:59:28 -07:00
Santhosh Behara
6ec830ac0c mm-video-v4l2: venc: Protect buffer from being freed while accessing
Output buffer (in use-buffer mode) has an internal backup ion buffer.
The contents of this buffer are deep-copied in client's buffer in
the context of VideoEncCallBackThread; while this buffer can be
freed in the client thread's context.
Check the allocation bitmask before attempting to copy and
synchronize these operations by holding a lock

Fixes bug 36130225
 Security Vulnerability - Heap use after free in libOmxVenc

CRs-Fixed: 2053101

Author: Praveen Chavan <pchavan@codeaurora.org>

Change-Id: I6141e81d7dbd50bc3601c8df066fd8cbd06b4e0b
2017-08-24 15:59:11 -07:00
TreeHugger Robot
f317b50135 Merge "mm-video-v4l2: vdec: change notify flush done to client" into oc-dr1-dev 2017-08-04 10:49:57 +00:00
Santhosh Behara
55c628ce14 mm-video-v4l2: vdec: change notify flush done to client
Component doesn't support flush on single port, Internally
it calls flush on both ports though client request on single
port. Hence notify flush done to client after flush on all
the ports has been completed.

Author : Manikanta Kanamarlapudi <kmanikan@codeaurora.org>

CRs-Fixed: 2076660
Test: make vts
      vts-tradefed run vts -m VtsHalMediaOmxV1_0Host
Bug: 63603864
Change-Id: I3c66a0b1853d598574fc19707da580bb88666b11
2017-08-04 00:49:42 +00:00
Santhosh Behara
79d5f68936 mm-video-v4l2: venc: Change QBUF and STREAM_ON call sequence
By calling STREAM_ON after QBUF, and meanwhile if there is
any buffer requirements query, there is a chance that queued
buffer will be ignored by driver. Hence changing the QBUF and
STREAM_ON sequence.

CRs-Fixed: 2065953

Author : Manikanta Kanamarlapudi <kmanikan@codeaurora.org>

Bug: 62602083
Test: make vts
      vts-tradefed run vts -m VtsHalMediaOmxV1_0Host
Merged-In: I0ec277a5b245d7b4aa343030ca74a2d86d7d91c1
Change-Id: I0ec277a5b245d7b4aa343030ca74a2d86d7d91c1
2017-08-04 00:48:59 +00:00
Jonathan Solnit
6d288d5fac Merge "mm-video-v4l2: venc: Protect buffer from being freed while accessing" into nyc-mr2-dev am: 4fb2744c19
am: e7e975e9bb

Change-Id: Ibbb3e21571ac97a1e5704ff7d332fcf05c44eaff
2017-07-27 00:50:11 +00:00
Jonathan Solnit
e7e975e9bb Merge "mm-video-v4l2: venc: Protect buffer from being freed while accessing" into nyc-mr2-dev
am: 4fb2744c19

Change-Id: I4301c264e54a4b1f98de4d7898015672b154ff7e
2017-07-27 00:31:54 +00:00
Jonathan Solnit
4fb2744c19 Merge "mm-video-v4l2: venc: Protect buffer from being freed while accessing" into nyc-mr2-dev 2017-07-27 00:22:43 +00:00
Santhosh Behara
03091c8af1 mm-video-v4l2: venc: Protect buffer from being freed while accessing am: 0008e21211 am: c0f642a22f am: 979b0e6864
am: 81323f63e3

Change-Id: I93a2d095b546151434a0c2ae8a5c919e2c6cd727
2017-07-27 00:16:05 +00:00
Santhosh Behara
81323f63e3 mm-video-v4l2: venc: Protect buffer from being freed while accessing am: 0008e21211 am: c0f642a22f
am: 979b0e6864

Change-Id: I2faf25ea66357a2444cf2f26b195e811c1d28c03
2017-07-26 23:48:19 +00:00
Santhosh Behara
979b0e6864 mm-video-v4l2: venc: Protect buffer from being freed while accessing am: 0008e21211
am: c0f642a22f

Change-Id: Ib113ea943aafe93ca57c5ba67ad806359471a6fa
2017-07-26 23:34:18 +00:00
Santhosh Behara
c0f642a22f mm-video-v4l2: venc: Protect buffer from being freed while accessing
am: 0008e21211

Change-Id: If82568abef16016aa258f11820255c74d33cafb2
2017-07-26 23:33:28 +00:00
Mahesh Lanka
1cd54c508a mm-video-v4l2: vdec: change notify flush done to client
Component doesn't support flush on single port, Internally
it calls flush on both ports though client request on single
port. Hence notify flush done to client after flush on all
the ports has been completed.

author : Manikanta Kanamarlapudi <kmanikan@codeaurora.org>

CRs-Fixed: 2076660

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 63603864

Merged-In: I319f42a02361a74d7c0c51215f6bdaa7a1c2a2d6
Change-Id: I319f42a02361a74d7c0c51215f6bdaa7a1c2a2d6
2017-07-25 23:24:27 -07:00
Santhosh Behara
f56db36a42 mm-video-v4l2: venc: Protect buffer from being freed while accessing
Output buffer (in use-buffer mode) has an internal backup ion buffer.
The contents of this buffer are deep-copied in client's buffer in
the context of VideoEncCallBackThread; while this buffer can be
freed in the client thread's context.
Check the allocation bitmask before attempting to copy and
synchronize these operations by holding a lock

Fixes bug 36130225
 Security Vulnerability - Heap use after free in libOmxVenc

CRs-Fixed: 2053101

Bug: 36130225
Change-Id: I75ef3df29fcabff52ea87cf5a4aa98e48bb40298
Author: Praveen Chavan<pchavan@codeaurora.org>
2017-07-25 15:13:51 -07:00
Santhosh Behara
0008e21211 mm-video-v4l2: venc: Protect buffer from being freed while accessing
Output buffer(in use-buffer mode) has an internal backup ion buffer.
The contents of this buffer are deep-copied in client's buffer in
the context of VideoEncCallBackThread; while this buffer can be
freed in the client thread's context.
Check the allocation bitmask before attempting to copy and
synchronize these operations by holding a lock

Fixes bug 36130225
 Security Vulnerability - Heap use after free in libOmxVenc

CRs-Fixed: 2053101

Bug: 36130225
Change-Id: If5e89703b2dec0aee8acb7e897e9df94227af3f3
Author: Praveen Chavan<pchavan@codeaurora.org>
2017-07-25 15:06:04 -07:00
Thierry Strudel
30d04e5dd3 msm8998: Update to 07.00.00.279.293
msm8998:  from hardware/qcom/media
  c3ec4719 mm-video-v4l2: venc: Set 601-Limited colorspace for color-converted buffers
  43b62e11 Merge "mm-video-v4l2: venc: Protect buffer from being freed while accessing"
  93872aa1 Merge "mm-video-v4l2: remove legacy compilation flag TARGET_USES_MEDIA_EXTENSIONS"
  5c572948 mm-video-v4l2: remove legacy compilation flag TARGET_USES_MEDIA_EXTENSIONS
  c0dd3100 video: Move data dump location to vendor partition
  175584c5 mm-video-v4l2: venc: Protect buffer from being freed while accessing

Test: build, boot, sanity checks
Bug: 63804057
Change-Id: Ie4c9e98f522f72ec022abc5f856e616ef65147f6
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-07-18 17:27:13 -07:00
Praveen Chavan
386fc0bdf5 mm-video-v4l2: venc: disable non-aosp features
VQZIP feature needs vendor dependencies. Remove support
for aosp builds.
Build PQ conditionally if dependecies are present.

Bug: 62377037
Change-Id: I2df6f2d9223b00cdabe4d86c8e83839b7676f0ad
2017-07-13 14:39:01 -07:00
Santhosh Behara
ff1ee57986 mm-video-v4l2: remove legacy compilation flag TARGET_USES_MEDIA_EXTENSIONS
This flag was used to conditionally disable features not
backwards compatible with older android versions.
This is not needed anymore. Moreover, this was disabling the
required features in builds where this flag was not defined.

Test: make gts -j123 && gts-tradefed run gts -m \
GtsMediaTestCases -t \
com.google.android.media.gts.WidevineCodecStressTests

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 62276042
CRs-Fixed: 2064239

Author: pchavan@codeaurora.org

Merged-In: Ie4d1754ee01b644aaafc4cd958ea858ebc5507ac
Change-Id: Ie4d1754ee01b644aaafc4cd958ea858ebc5507ac
(cherry picked from commit d65458b9b8)
2017-07-10 23:20:28 +00:00
Praveen Chavan
72a6741bef mm-video-v4l2: venc: Set 601-Limited colorspace for color-converted buffers
Colorspace is derived from gralloc-handles for graphic-buffers and set to codec.
RGBA8888 Buffers are converted to YUV via C2D and have 601-Limited color.
When passed to the device-layer, such buffers do not have gralloc-handle
and hence colorspace does not get set.
Set colorspace as 601-L explicitly in such case to the codec.

b/63147656
Test: verified that it fixes the failures in EncodeVirtualDisplayTest#
testEncodeVirtualDisplay and DecodeEditEncodeTest#testVideoEdit720p

CRs-Fixed: 2070838
Change-Id: Iae2705b8f4256d8e76309d2d1adb7cb6d3eb1692
2017-07-05 11:03:20 -07:00
Thierry Strudel
956c1217c1 Merge "msm8998: Update to 07.00.00.279.240" into oc-dr1-dev 2017-07-01 06:07:30 +00:00
TreeHugger Robot
cdd02ffa67 Merge "mm-video-v4l2: venc: Change QBUF and STREAM_ON call sequence" into oc-dr1-dev 2017-07-01 01:38:42 +00:00
Mahesh Lanka
d128a260d9 mm-video-v4l2: venc: Change QBUF and STREAM_ON call sequence
By calling STREAM_ON after QBUF, and meanwhile if there is
any buffer requirements query, there is a chance that queued
buffer will be ignored by driver. Hence changing the QBUF and
STREAM_ON sequence.

CRs-Fixed: 2065953

author : Manikanta Kanamarlapudi <kmanikan@codeaurora.org>

Bug: 62602083
Bug: 62848424
Bug: 62848422

Merged-In: I9fd910208d197bd0d28160393c3426ed9270494c
Change-Id: I9fd910208d197bd0d28160393c3426ed9270494c
2017-06-29 17:07:12 -07:00
Thierry Strudel
68225548f6 msm8998: Update to 07.00.00.279.240
msm8998:  from hardware/qcom/media
  9290486d video: add vendor prefix to properties
  19da8f80 Merge "mm-video-v4l2: vdec: Fix reporting change in color-space to the client"
  fa17158f Merge "libc2dcolorconvert: Fix address in unmap call"
  ffdc4909 Merge "mm-video-v4l2: venc: WA: ignore colorspace set by client when executing"
  ebedc974 mm-video-v4l2: vdec: Fix reporting change in color-space to the client
  2d4e855a libc2dcolorconvert: Fix address in unmap call
  bb45d359 mm-video-v4l2: venc: WA: ignore colorspace set by client when executing
  aa97b82e mm-video-v4l2: vdec: Allocate input(bitstream) buffers as uncached

Test: build, boot, sanity checks
Bug: 62817801
Change-Id: I98cb6b897cda51363c807ae0365c2139e7d578e9
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-06-24 18:17:11 -07:00
Vijay Venkatraman
53801229e1 Merge "Add libutils to msm8998 modules" into oc-dr1-dev 2017-06-23 00:29:22 +00:00
Praveen Chavan
49cc3f7a44 msm8998: mm-video-v4l2: vdec: Allocate input buffers as uncached
Cache invalidation is an expensive operation on 8998.
Using cached buffers and invalidating incurs more cost than
copying on to uncached memory.
This will help reduce the CPU utilization of the thread calling
invalidation

Bug: 36793371
CRs-Fixed: 2057245
Change-Id: Iec859323f50017e9bfbbae00dc4c89f1ee9524b3
2017-06-19 18:15:48 +00:00
Praveen Chavan
9da80c1035 mm-video-v4l2: vdec: Fix reporting change in color-space to the client
If the colorspace in bitstream gets updated, the client is notified.
However, when the client comes back to read, it must be notified of
the color-space values from bitstream (if specified) and use
default (client's values) if unspecified.

Bug: 36373942
Test: Camera recording and playback the file.

CRs-Fixed: 2058039
Change-Id: Ie7c387371c55c655115c040f94f6e712a6c8b322
2017-06-10 01:02:50 +00:00
Vijay Venkatraman
c7206e64e8 Add libutils to msm8998 modules
These dependencies are explicitly needed when enabling VNDK flag

Bug: 33241851
Test: build target and pass CTS
Test: With BOARD_VNDK_VERSION, mma works
Change-Id: I662e4f698e5206e6a713b878c380cdaf9b50ef07
2017-06-09 23:41:08 +00:00
Hangyu Kuang
5c3bd109b0 Merge "mm-video-v4l2: vdec: Fix reporting change in color-space to the client" into oc-dr1-dev 2017-06-09 20:01:27 +00:00
Praveen Chavan
a72adb718f mm-video-v4l2: vdec: Fix reporting change in color-space to the client
If the colorspace in bitstream gets updated, the client is notified.
However, when the client comes back to read, it must be notified of
the color-space values from bitstream (if specified) and use
default (client's values) if unspecified.

Bug: 62323441
Test: Camera recording and playback the recorded video.

CRs-Fixed: 2058030
Change-Id: Ida78ae290a8e020d40c44e9037635caa79b45f2e
2017-06-08 20:45:22 +00:00
Thierry Strudel
d303c643ac msm8998: Update to 07.00.00.279.194
msm8998:  from hardware/qcom/media
  25218045 Merge "mm-core: msm8998 registry: deprecate unused OMX components" into video-userspace.lnx.6.4.9-rel.1.0
  26208d91 mm-core: msm8998 registry: deprecate unused OMX components
  51e4c23b mm-video-v4l2: venc: Check input buffer size before invoking C2D

Test: build, boot, sanity checks
Bug: 62319031
Change-Id: Ia4c35bf5e586f5460a1c58e30c12cac1453e9879
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-06-07 21:14:32 -07:00
Praveen Chavan
b2a4dd5ac3 mm-core: msm8996 registry: deprecate unused OMX components
am: e34f279fc2

Change-Id: I70813022c6ad31288a6a4d72b9471d366433c222
2017-06-07 12:37:05 +00:00
Praveen Chavan
e34f279fc2 mm-core: msm8996 registry: deprecate unused OMX components
Remove entries for unused/unimplemented OMX components and avoid
unnecessary VTS failures

Test: Small CtsMediaTestCases

CRs-Fixed: 2054495
Bug: 38507644
Change-Id: I8cfdf947f13b9a8a88619e9074938aab0e187685
2017-06-05 22:50:34 -07:00
Mahesh Lanka
00afd70eb5 Merge "mm-video-v4l2: venc: Initialize profile and level set flags" into oc-dev am: 619065b31d
am: 9fc2582496

Change-Id: Ia414accb5ebe0c2d41653a74a4e40ccedf9b30e9
2017-06-01 19:51:33 +00:00
Mahesh Lanka
9fc2582496 Merge "mm-video-v4l2: venc: Initialize profile and level set flags" into oc-dev
am: 619065b31d

Change-Id: I1942ce8e20e8b00ef058e8bc5d8bb25313532c6f
2017-06-01 19:47:47 +00:00
TreeHugger Robot
619065b31d Merge "mm-video-v4l2: venc: Initialize profile and level set flags" into oc-dev 2017-06-01 19:40:31 +00:00
Mahesh Lanka
c406bbb10f mm-video-v4l2: venc: Initialize profile and level set flags
profile and level set flags are not initialized, due to
this wrong profile and levels are set to the encoder.
This change will fix the same.

Bug: 62095651

Change-Id: Ic45018ed6ec9c9d0a848b9d92194b440ef257cb5
2017-06-01 09:52:03 -07:00
Thierry Strudel
e2b75a9c09 msm8998: Update to 07.00.00.279.162
msm8998:  from hardware/qcom/media
  391f67d5 Add header inclusion path
  e84a80fc Merge "mm-video-v4l2: vdec: Add extradata support in decoder"
  818a2207 mm-video-v4l2: vdec: Add extradata support in decoder
  665530c7 mm-video-v4l2: vidc: Reduce verbosity of non-fatal errors

Test: build, boot, sanity checks
Bug: 62038492
Change-Id: Ib9d0104bd75435ae2c8506eb4d6aa1629d362e7a
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-05-23 17:14:08 -07:00
Thierry Strudel
a7f8a093e6 msm8998: Update to 07.00.00.279.143
msm8998:  from hardware/qcom/media
  a24e220f Merge "mm-video-v4l2: venc: Update level when RC-mode is changed"
  ea0fd094 mm-video-v4l2: venc: Update level when RC-mode is changed
  fd691c96 Merge "media: Remove linkage to non-VNDK libs"
  f60f0cb7 Merge "mm-video: Add MPEG-4,H.263,DIVX software codec entry for 8909."
  4c4fb2f5 media: Remove linkage to non-VNDK libs
  9cb2f5b5 Merge "mm-video-v4l2:vdec: Pass bit_depth, color_space and dither_config"
  104d3656 mm-video-v4l2:vdec: Pass bit_depth, color_space and dither_config
  e0a19328 mm-video-v4l2: vdec: disable down-scalar for 8909
  28523d90 mm-video: Add MPEG-4,H.263,DIVX software codec entry for 8909.
  0b54adca media: Compilation fix

Test: build, boot, sanity checks
Bug: 38282057
Change-Id: I2ec7e5b0fe30cdb17e26a9eb97dcacec4cce308a
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-05-18 12:39:34 -07:00
Mathias Agopian
240fc6e79b fix circular dependency libnativewindow <-> libui
Bug: 37647680, 37648355
Test: compile, manual
Change-Id: I7214dcc1e57f2a0466fc28173dd5de5d54c9a721
2017-05-03 19:03:10 -07:00
Vishwath Mohan
7e5fd2eed0 Remove hardcoded LOCAL_MODULE_PATHS from vendor components. (media)
This CL replaces all LOCAL_MODULE_PATH_* definitions for vendor shared
libraries with LOCAL_VENDOR_MODULE := true instead. This appropriately
generates sanitized versions of these libraries to /data/asan/* while
generating the stock versions in /vendor/lib* as desired. Needed for
ASAN builds to work correctly.

Bug: 37740897
Test: m -j40 && SANITIZE_TARGET="address" m -j40 # shared libs in
$ANDROID_PRODUCT_OUT/vendor/lib* do not contain asan symbols, while
the ones in $ANDROID_PRODUCT_OUT/data/asan/vendor/lib* do.

Change-Id: Ic909338aecff94e7970d6d33a9ba8ed1ba6a9aa3
2017-05-02 16:53:46 -07:00
Praveen Chavan
ccf97ff1d1 mm-video-v4l2:remove stale entries in m_opq_pmem_q am: 0e28b961b6
am: ef87c3821b

Change-Id: I4e75ccb32d2494c087d0a556de5025cbea332d1c
2017-04-29 00:55:05 +00:00
Praveen Chavan
fe5265b82b mm-video-v4l2:Update output resolution am: 4cde8d5ef0
am: 83cb2014f0

Change-Id: I3b266462705a9968cfb988680a2531693047790f
2017-04-29 00:55:03 +00:00