pvrdma: check number of pages when creating rings
commit2c858ce5da8ae6689c75182b73bc455a291cad41
authorPrasad J Pandit <pjp@fedoraproject.org>
Wed, 12 Dec 2018 19:30:36 +0000 (13 01:00 +0530)
committerMarcel Apfelbaum <marcel.apfelbaum@gmail.com>
Sat, 22 Dec 2018 09:09:57 +0000 (22 11:09 +0200)
tree102b7040178f73c37b568f19c2076d4d189ad4e8
parent2aa86456fb938a11f2b7bd57c8643c213218681c
pvrdma: check number of pages when creating rings

When creating CQ/QP rings, an object can have up to
PVRDMA_MAX_FAST_REG_PAGES 8 pages. Check 'npages' parameter
to avoid excessive memory allocation or a null dereference.

Reported-by: Li Qiang <liq3ea@163.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
hw/rdma/vmw/pvrdma_cmd.c