lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 28 Dec 2018 10:36:49 -0500
From:   Chuck Lever <chuck.lever@...cle.com>
To:     YueHaibing <yuehaibing@...wei.com>,
        Bart Van Assche <bvanassche@....org>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Bruce Fields <bfields@...ldses.org>,
        Jeff Layton <jlayton@...nel.org>,
        Trond Myklebust <trond.myklebust@...merspace.com>,
        Anna Schumaker <anna.schumaker@...app.com>,
        open list <linux-kernel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
        Jason Gunthorpe <jgg@...pe.ca>
Subject: Re: [PATCH net-next] svcrdma: Fix an uninitialized variable false
 warning


> On Dec 20, 2018, at 4:49 AM, YueHaibing <yuehaibing@...wei.com> wrote:
> 
> smatch warning this:
> net/sunrpc/xprtrdma/svc_rdma_rw.c:351 svc_rdma_post_chunk_ctxt() error: uninitialized symbol 'bad_wr'
> net/sunrpc/xprtrdma/verbs.c:1569 rpcrdma_post_recvs() error: uninitialized symbol 'bad_wr'
> 
> 'bad_wr' is initialized in ib_post_send. But smatch
> doesn't know that and warns this.
> 
> Signed-off-by: YueHaibing <yuehaibing@...wei.com>
> ---
> net/sunrpc/xprtrdma/svc_rdma_rw.c | 2 +-
> net/sunrpc/xprtrdma/verbs.c       | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_rw.c b/net/sunrpc/xprtrdma/svc_rdma_rw.c
> index dc19517..0954b25 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_rw.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_rw.c
> @@ -308,7 +308,7 @@ static int svc_rdma_post_chunk_ctxt(struct svc_rdma_chunk_ctxt *cc)
> 	struct svcxprt_rdma *rdma = cc->cc_rdma;
> 	struct svc_xprt *xprt = &rdma->sc_xprt;
> 	struct ib_send_wr *first_wr;
> -	const struct ib_send_wr *bad_wr;
> +	const struct ib_send_wr *bad_wr = NULL;
> 	struct list_head *tmp;
> 	struct ib_cqe *cqe;
> 	int ret;
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index 3ddba94..37be70f 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -1518,7 +1518,7 @@ void
> rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, bool temp)
> {
> 	struct rpcrdma_buffer *buf = &r_xprt->rx_buf;
> -	struct ib_recv_wr *wr, *bad_wr;
> +	struct ib_recv_wr *wr, *bad_wr = NULL;
> 	int needed, count, rc;
> 
> 	rc = 0;
> -- 
> 2.7.0

Does this need

Fixes: d34ac5cd3a73 ("RDMA, core and ULPs: Declare ib_post_send() and ib_post_recv() arguments const")  ???

Bart, any comments?


--
Chuck Lever



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ