mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
This patch fixes nvgpu_css_allocate_perfmon_ids which leads to a buffer overflow if the allocation of perfmon ids does not succeed. If the allocation of perfmon ids cannot be satisfied, bitmap_find... would return CSS_MAX_PERFMON_IDS and nvgpu_bitmap_set would still be called with start after the bitmap array. This results into a buffer overflow. Bug 3814963 Change-Id: I4caff36cf0c920b4445e1841d16ba2b4c3d19aaa Signed-off-by: Martin Radev <mradev@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2786747 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Prateek Sethi <prsethi@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>