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>
Thu, 25 May 2017 20:04:40 +0000 (13:04 -0700)
commit89559abb25f82dc333eafa26391be0a50d6e9e0a
tree0e879bc9c5e15c8549baf3b2c3201df2d8de2734
parent91734bda12391d231a28aaa924877d1f66b6de77
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
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
drivers/media/platform/tegra/nvavp/nvavp_dev.c