]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
nvmap: Fix handle generation from IVC ID
authorRaghavendra VK <rvk@nvidia.com>
Thu, 11 Jun 2015 11:57:34 +0000 (17:27 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Thu, 20 Aug 2015 10:13:12 +0000 (03:13 -0700)
commit51b3836237fdec3ab0555d7da93b50e7f65b2ecd
tree3fab432fa9a90134f0f9727ef20a11f44235273d
parent24c241ebda03dee406449942d32424724cebdbf2
nvmap: Fix handle generation from IVC ID

- Search global handle list and if a handle for IVM ID exists, reference
  that in client and return that to the user. Else, create a handle and
  reference.

- Initial solution was to just check the client refs and if
  any reference had IVM ID, use that reference else create the handle
  but typical use case has 2 graphics components (window manager and
  application). It is possible that application creates a handle and
  reference and window manager later takes a reference to the handle.
  The application deletes it's reference. After a few frames, producer
  sends the same IVC ID and when application tries to create a handle it
  fails because that region is already held by a handle. Hence, a global
  search is needed. The drawback of the solution is that we cannot
  detect denial of service i.e; If a rogue application guessed the IVC
  ID and created an handle, handle creation from actual application
  would also suceed since we search global handle list. If we still need
  the protection then the application that first created the handle from
  IVC ID should not free the handle but this might not be
  straightforward as we had mentioned that once handle is created from
  IVC ID, regular semantics would work for duping, freeing handles.

bug 1638591

Change-Id: I094f14abbbfa2b50393ca3d456577954ef948350
Signed-off-by: Raghavendra VK <rvk@nvidia.com>
Reviewed-on: http://git-master/r/743197
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/video/tegra/nvmap/nvmap_handle.c
drivers/video/tegra/nvmap/nvmap_heap.c
drivers/video/tegra/nvmap/nvmap_ioctl.c
drivers/video/tegra/nvmap/nvmap_priv.h