media: tegra: nvavp: Fix UAF issue.
authorJitendra Kumar <jitendrak@nvidia.com>
Thu, 27 Oct 2016 08:35:00 +0000 (13:35 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 7 Feb 2017 16:39:12 +0000 (08:39 -0800)
commitea1af2ce5a746bda36205357c9e0adaf527026bb
tree621f9f7bfc48f1fafb92919118b61a98ccb041ff
parente124868998c604716d0ece1a0cb7e187db4adb18
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
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jitendra Kumar <jitendrak@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>
drivers/media/platform/tegra/nvavp/nvavp_dev.c