RE: [PATCH] RDMA/qedr: Zero stack memory before copying to user space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Jason Gunthorpe [mailto:jgg@xxxxxxxxxxxx]
> Sent: Thursday, April 05, 2018 5:58 AM
> 
> The fact this struct was not init'd like all the others was missed when the
> padding reserved field was added.
> 
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Fixes: 71e80a4781af ("RDMA/qedr: Fix uABI structure layouts for 32/64
> compat")
> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> ---
>  drivers/infiniband/hw/qedr/verbs.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/qedr/verbs.c
> b/drivers/infiniband/hw/qedr/verbs.c
> index 01d1a74655b10a..975f053f026f7c 100644
> --- a/drivers/infiniband/hw/qedr/verbs.c
> +++ b/drivers/infiniband/hw/qedr/verbs.c
> @@ -494,9 +494,9 @@ struct ib_pd *qedr_alloc_pd(struct ib_device *ibdev,
>  	pd->pd_id = pd_id;
> 
>  	if (udata && context) {
> -		struct qedr_alloc_pd_uresp uresp;
> -
> -		uresp.pd_id = pd_id;
> +		struct qedr_alloc_pd_uresp uresp = {
> +			.pd_id = pd_id,
> +		};
> 
>  		rc = qedr_ib_copy_to_udata(udata, &uresp, sizeof(uresp));
>  		if (rc) {
> --
> 2.16.2

Thanks,
Acked-by: Michal Kalderon <Michal.Kalderon@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux