media: tegra: nvavp: Fix UAF issue.
authorJitendra Kumar <jitendrak@nvidia.com>
Thu, 27 Oct 2016 08:35:00 +0000 (13:35 +0530)
committerWinnie Hsu <whsu@nvidia.com>
Tue, 20 Jun 2017 18:14:33 +0000 (11:14 -0700)
commit707cd5f568f3521090d31dec663f54d7fca08347
treed02ce0d3023a1b13e3912d0e2745891950148b9a
parentec9ac25833e9e5972b1dcbfc2f9140259dc71393
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/1489467
(cherry picked from commit 89559abb25f82dc333eafa26391be0a50d6e9e0a)
Reviewed-on: http://git-master/r/1504674
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
drivers/media/platform/tegra/nvavp/nvavp_dev.c