Re: [PATCH 02/28] IB/hfi1: Fix to fully initialize send context area

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

 



On Mon, Jul 25, 2016 at 01:38:01PM -0700, Dennis Dalessandro wrote:
> From: Tymoteusz Kielan <tymoteusz.kielan@xxxxxxxxx>
> 
> While handling buffer control MAD, partially initialized
> dd->kernel_send_context area may cause potential dereference
> of uninitialized pointers. Fix by using kzalloc_node()
> instead of kmalloc_node().
> 
> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxx>
> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>
> Reviewed-by: Andrzej Kacprowski <andrzej.kacprowski@xxxxxxxxx>
> Signed-off-by: Tymoteusz Kielan <tymoteusz.kielan@xxxxxxxxx>
> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@xxxxxxxxx>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>
> ---
>  drivers/infiniband/hw/hfi1/pio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hfi1/pio.c b/drivers/infiniband/hw/hfi1/pio.c
> index d402245..a99fcca 100644
> --- a/drivers/infiniband/hw/hfi1/pio.c
> +++ b/drivers/infiniband/hw/hfi1/pio.c
> @@ -1956,7 +1956,7 @@ int init_pervl_scs(struct hfi1_devdata *dd)
>  	hfi1_init_ctxt(dd->vld[15].sc);
>  	dd->vld[15].mtu = enum_to_mtu(OPA_MTU_2048);
>  
> -	dd->kernel_send_context = kmalloc_node(dd->num_send_contexts *
> +	dd->kernel_send_context = kzalloc_node(dd->num_send_contexts *
>  					sizeof(struct send_context *),
>  					GFP_KERNEL, dd->node);

Dennis,
Don't you want to check kzalloc_node execution success
prior to use dd->kernel_send_context?

>  	dd->kernel_send_context[0] = dd->vld[15].sc;
> 
> --
> 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

Attachment: signature.asc
Description: Digital signature


[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