linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Parav Pandit <parav@mellanox.com>
To: Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Eric Biggers <ebiggers@kernel.org>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"dasaratharaman.chandramouli@intel.com" 
	<dasaratharaman.chandramouli@intel.com>,
	Leon Romanovsky <leonro@mellanox.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mark Bloch <markb@mellanox.com>, Moni Shoua <monis@mellanox.com>,
	"syzkaller-bugs@googlegroups.com"
	<syzkaller-bugs@googlegroups.com>,
	syzbot <syzbot+29ee8f76017ce6cf03da@syzkaller.appspotmail.com>
Subject: RE: [RDMA bug] KASAN: use-after-free Read in __list_del_entry_valid (4)
Date: Thu, 23 Aug 2018 17:14:39 +0000	[thread overview]
Message-ID: <VI1PR0501MB2271943461A960624D6E9197D1370@VI1PR0501MB2271.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1256f66271b31955f6e77c59335f4f75801eacf2.camel@redhat.com>

Hi Doug,

> -----Original Message-----
> From: Doug Ledford <dledford@redhat.com>
> Sent: Thursday, August 23, 2018 11:56 AM
> To: Parav Pandit <parav@mellanox.com>; Jason Gunthorpe <jgg@ziepe.ca>;
> Eric Biggers <ebiggers@kernel.org>
> Cc: linux-rdma@vger.kernel.org; dasaratharaman.chandramouli@intel.com;
> Leon Romanovsky <leonro@mellanox.com>; linux-kernel@vger.kernel.org;
> Mark Bloch <markb@mellanox.com>; Moni Shoua <monis@mellanox.com>;
> syzkaller-bugs@googlegroups.com; syzbot
> <syzbot+29ee8f76017ce6cf03da@syzkaller.appspotmail.com>
> Subject: Re: [RDMA bug] KASAN: use-after-free Read in __list_del_entry_valid
> (4)
> 
> On Thu, 2018-08-23 at 16:39 +0000, Parav Pandit wrote:
> > > -----Original Message-----
> > > From: Jason Gunthorpe <jgg@ziepe.ca>
> > > Sent: Thursday, August 23, 2018 9:55 AM
> > > To: Eric Biggers <ebiggers@kernel.org>
> > > Cc: Doug Ledford <dledford@redhat.com>; linux-rdma@vger.kernel.org;
> > > dasaratharaman.chandramouli@intel.com; Leon Romanovsky
> > > <leonro@mellanox.com>; linux-kernel@vger.kernel.org; Mark Bloch
> > > <markb@mellanox.com>; Moni Shoua <monis@mellanox.com>; Parav
> Pandit
> > > <parav@mellanox.com>; syzkaller-bugs@googlegroups.com; syzbot
> > > <syzbot+29ee8f76017ce6cf03da@syzkaller.appspotmail.com>
> > > Subject: Re: [RDMA bug] KASAN: use-after-free Read in
> > > __list_del_entry_valid
> > > (4)
> > >
> > > On Wed, Aug 22, 2018 at 11:16:31PM -0700, Eric Biggers wrote:
> > > > Hello RDMA / InfiniBand maintainers,
> > > >
> > > > This is an RDMA bug and it still occurs on Linus' tree as of today
> > > > (commit 815f0ddb346c1960).
> > > >
> > > > I've also simplified the reproducer for it; see below after the original
> report.
> > > > Apparently it involves a race between RDMA_USER_CM_CMD_RESOLVE_IP
> > >
> > > and
> > > > RDMA_USER_CM_CMD_LISTEN.
> > >
> > > That is an amazing reproducer!
> > >
> > > I have a feeling this is the same cause as all the other syzkaller bugs in this
> code:
> > > lack of any sane locking at all :\
> > >
> > > We've talked about chucking a big lock around this whole thing, but
> > > nobody has done it yet.. It isn't so simple.
> > >
> >
> > I had some code in which reduces three locks (handler_lock, qp_mutex,
> id_lock) to single mutex to protect the cm_id and protects every exported
> symbol of rdmacm which works on cm_id.
> > But not ready enough to post it as patch yet. Lot of tests required before I get
> there and some refactor too before that.
> 
> Does it finally address the fact that the rdmacm code was written so that it was
> always synchronous but RoCE src gid (I think that's what it was, I'm typing this
> from long ago memory) lookup broke that assumption?
> 
I am not sure. 
To me it is unlikely, because rdma_resolve_route() for InfiniBand is not synchronous either which needs to query the SA.
But qp_mutex existed long before that which doesn't provide any performance improvements. ( by splitting as 3rd lock instead of id_lock and handler_lock) and so on.


> --
> Doug Ledford <dledford@redhat.com>
>     GPG KeyID: B826A3330E572FDD
>     Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

  reply	other threads:[~2018-08-23 17:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26  0:01 KASAN: use-after-free Read in __list_del_entry_valid (4) syzbot
2018-03-26  3:43 ` syzbot
2018-08-23  6:16   ` [RDMA bug] " Eric Biggers
2018-08-23 14:54     ` Jason Gunthorpe
2018-08-23 16:39       ` Parav Pandit
2018-08-23 16:55         ` Doug Ledford
2018-08-23 17:14           ` Parav Pandit [this message]
2018-08-23 17:17         ` Jason Gunthorpe

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=VI1PR0501MB2271943461A960624D6E9197D1370@VI1PR0501MB2271.eurprd05.prod.outlook.com \
    --to=parav@mellanox.com \
    --cc=dasaratharaman.chandramouli@intel.com \
    --cc=dledford@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=leonro@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=markb@mellanox.com \
    --cc=monis@mellanox.com \
    --cc=syzbot+29ee8f76017ce6cf03da@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).