All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
To: "jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org"
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	"yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org"
	<yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
	"dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH rdma-core] verbs: Do not copy uninitialized data in ibv_cmd_modify_qp
Date: Mon, 2 Jan 2017 08:02:02 +0000	[thread overview]
Message-ID: <1483344105.3592.1.camel@sandisk.com> (raw)
In-Reply-To: <20161222221334.GA15907-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1543 bytes --]

On Thu, 2016-12-22 at 15:13 -0700, Jason Gunthorpe wrote:
> Valgrind reports:
> 
> ==1196== Syscall param write(buf) points to uninitialised byte(s)
> ==1196==    at 0x506250D: ??? (syscall-template.S:84)
> ==1196==    by 0x527756F: ibv_cmd_modify_qp (cmd.c:1291)
> ==1196==    by 0x8008D74: mlx4_modify_qp (verbs.c:820)
> ==1196==    by 0x527E4F4: ibv_modify_qp@@IBVERBS_1.1 (verbs.c:561)
> ==1196==    by 0x4E3FAB3: ucma_modify_qp_err.isra.6 (cma.c:1115)
> ==1196==    by 0x4E41D56: rdma_get_cm_event.part.15 (cma.c:2180)
> ==1196==    by 0x402CF0: cm_thread (rping.c:576)
> ==1196==    by 0x5059709: start_thread (pthread_create.c:333)
> ==1196==    by 0x558A82C: clone (clone.S:109)
> ==1196==  Address 0x9847980 is on thread 2's stack
> ==1196==  in frame #2, created by mlx4_modify_qp (verbs.c:775)
> 
> This is because of code like this:
> 
>         struct ibv_qp_attr qp_attr;
>         qp_attr.qp_state = IBV_QPS_ERR;
>         return rdma_seterrno(ibv_modify_qp(id->qp, &qp_attr, IBV_QP_STATE));
> 
> Always pass 0 into the kernel for for attributes that are not requested
> to be modified.

Hello Jason,

Have you considered to modify Valgrind? It is possible to modify Valgrind
such that it doesn't report false positives like the above report without
changing the rdma-core code. See also PRE(sys_ioctl) in source file
coregrind/m_syswrap/syswrap-linux.c.

Bart.
N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·¥Š{±­ÙšŠ{ayº\x1dʇڙë,j\a­¢f£¢·hš‹»öì\x17/oSc¾™Ú³9˜uÀ¦æå‰È&jw¨®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿïêäz¹Þ–Šàþf£¢·hšˆ§~ˆmš

  parent reply	other threads:[~2017-01-02  8:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 22:13 [PATCH rdma-core] verbs: Do not copy uninitialized data in ibv_cmd_modify_qp Jason Gunthorpe
     [not found] ` <20161222221334.GA15907-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-12-23 12:11   ` Doug Ledford
2016-12-25  7:42   ` Leon Romanovsky
2017-01-02  8:02   ` Bart Van Assche [this message]
     [not found]     ` <1483344105.3592.1.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2017-01-02 21:14       ` Jason Gunthorpe
     [not found]         ` <20170102211430.GC5544-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-03  8:36           ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1483344105.3592.1.camel@sandisk.com \
    --to=bart.vanassche-xdaiopvojttbdgjk7y7tuq@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.