RDS: Heap OOB write in rds_message_alloc_sgs()
Subsystems (3)
PATCH 1/1 RDS: Heap OOB write in rds_message_alloc_sgs()
From: Mohamed Ghannam <[email protected]>
When args->nr_local is 0, nr_pages gets also 0 due some size calculation via rds_rm_size(), which is later used to allocate pages for DMA, this bug produces a heap Out-Of-Bound write access to a specific memory region.
Signed-off-by Mohamed Ghannam <[email protected]>
--- net/rds/rdma.c | 3 +++ 1 file changed, 3 insertions(+)
net/rds/rdma.c +3 -0
@@ -525,6 +525,9 @@ int rds_rdma_extra_size(struct rds_rdma_args *args) local_vec = (struct rds_iovec __user *)(unsigned long ) args->local_vec_addr; +if (args->nr_local ==0 ) +return -EINVAL ; +/* figure out the number of pages in the vector */ for (i =0 ; i < args->nr_local; i++) { if (copy_from_user(&vec, &local_vec[i],
Signature · 1 line
2.14.1
David Miller
maintainerFrom: [email protected]
Date: Tue, 2 Jan 2018 19:44:34 +0000
Quoted 8 lines
From: Mohamed Ghannam <[email protected]>
When
args->nr_localis 0,nr_pagesgets also 0 due some size calculation viards_rm_size(), which is later used to allocate pages for DMA, this bug produces a heap Out-Of-Bound write access to a specific memory region.Signed-off-by Mohamed Ghannam <[email protected]>
Applied and queued up for -stable, thanks.