media: tegra: nvavp: Fix UAF issue.
authorJitendra Kumar <jitendrak@nvidia.com>
Thu, 27 Oct 2016 08:35:00 +0000 (13:35 +0530)
committerManish Tuteja <mtuteja@nvidia.com>
Wed, 1 Mar 2017 00:42:34 +0000 (16:42 -0800)
commit8a9eb1cb11ee0108d34982795367be80036294dd
treef733ba97f6ee872f89b3756ebe6ab19066b2f111
parent162d9cb7dd2f716327c935ca709c453c172ce3ca
media: tegra: nvavp: Fix UAF issue.

Use locking to protect generated fd, so that it can't be
freed before channel open completes. Also add null value checks
in release call.

CVE-2016-8449 (A-31798848)
Bug 1830023
Bug 1849492

Change-Id: Ie6e2b29c7132fdfdff6b0bfa75440bd43afffd5f
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1285817
(cherry picked from commit 2ff0fdedfd65f269359d6540df4662e958681aa7)
Reviewed-on: http://git-master/r/1299505
(cherry picked from commit ea1af2ce5a746bda36205357c9e0adaf527026bb)
Reviewed-on: http://git-master/r/1311418
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
drivers/media/platform/tegra/nvavp/nvavp_dev.c