OSDN Git Service

iommu: dma-mapping-fast: Add a check for count in fast_smmu_alloc
authorVijayanand Jitta <vjitta@codeaurora.org>
Sun, 27 Jan 2019 17:06:16 +0000 (22:36 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Fri, 1 Feb 2019 04:03:08 +0000 (20:03 -0800)
commit87427d48bba6e080d538838e2361e725987c6207
tree7d75ba3982a1c8694b27b7de5d45b61f66ca22cb
parent9fbd68e8f4d949a8b9f62f931a8a8cff68df7432
iommu: dma-mapping-fast: Add a check for count in fast_smmu_alloc

In fast_smmu_alloc size_t variable size is type casted to int
variable count, this variable count can get truncated and can
result in memory corruption during unmap, make count as size_t
and also add a check for count as sg_alloc_table_from_pages
accepts unsigned int value for count.

Change-Id: I4780a554c5c062fd9dd229e5cc0ac804b1ba31d8
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
drivers/iommu/dma-mapping-fast.c