Re: NULL ptr dereference in rpcrdma_regbuf_is_mapped

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

 




> On Jan 30, 2018, at 11:43 AM, Kalderon, Michal <Michal.Kalderon@xxxxxxxxxx> wrote:
> 
> Hi Chuck, 
> 
> Different issue, so started different thread. 
> If I unload our driver while there is an open NFS connection I get a null pointer dereference in rpcrdma_regbuf_is_mapped
> the pointer to buf received in this function is NULL.

Hi Michal, let's see the backtrace.


> If I check buf for NULL and return false I am able to unload the driver, though I'm not sure this is sufficient.
> 
> diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
> index 1342f743..73066a6 100644
> --- a/net/sunrpc/xprtrdma/xprt_rdma.h
> +++ b/net/sunrpc/xprtrdma/xprt_rdma.h
> @@ -588,7 +588,7 @@ struct rpcrdma_regbuf *rpcrdma_alloc_regbuf(size_t, enum dma_data_direction,
> static inline bool
> rpcrdma_regbuf_is_mapped(struct rpcrdma_regbuf *rb)
> {
> -       return rb->rg_device != NULL;
> +       return rb && (rb->rg_device != NULL);
> :
> 
> 
> Will be great if you could take a look 
> Thanks,
> Michal
> --
> 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

--
Chuck Lever



--
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