Files
linux-nv-oot/drivers/crypto
Manish Bhardwaj f6227e9c57 crypto: check buffer size before allocing DMA memory
Passing zero size to dma_alloc API is causing below crash.
Added check on requested size before sending request to
dma layer.
[ 4178.581558]  sg_alloc_append_table_from_pages+0x28c/0x480
[ 4178.581790]  sg_alloc_table_from_pages_segment+0x40/0xb0
[ 4178.582009]  __iommu_dma_alloc_noncontiguous.isra.0+0x244/0x3a0
[ 4178.582258]  iommu_dma_alloc+0x280/0x3b0
[ 4178.582424]  dma_alloc_attrs+0xf8/0x110
[ 4178.582588]  tegra_hv_vse_get_db+0x76c/0x70e0 [tegra_hv_vse_safety]
[ 4178.582850]  hash_sendmsg+0xa8/0x290
[ 4178.583001]  sock_sendmsg+0x68/0x90
[ 4178.583146]  __sys_sendto+0xf0/0x170
[ 4178.583298]  __arm64_sys_sendto+0x38/0x60
[ 4178.583466]  invoke_syscall+0x5c/0x150
[ 4178.583628]  el0_svc_common.constprop.0+0x100/0x120
[ 4178.583829]  do_el0_svc+0x3c/0xb0
[ 4178.583966]  el0_svc+0x20/0x70
[ 4178.584098]  el0t_64_sync_handler+0xc0/0xd0
[ 4178.584270]  el0t_64_sync+0x1a4/0x1a8

Bug 4259208

Change-Id: I134bc84e7b5cbda7db4ed7dbcad4e1c6955429d8
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983402
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-22 20:08:52 -07:00
..