linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: DaeRyong Jeong <threeearcat@gmail.com>
Cc: dledford@redhat.com, leon@kernel.org, parav@mellanox.com,
	danielj@mellanox.com, swise@opengridcomputing.com,
	monis@mellanox.com, inux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, byoungyoung@purdue.edu,
	kt0755@gmail.com, bammanag@purdue.edu
Subject: Re: KASAN: use-after-free Read in cma_cancel_operation
Date: Sun, 13 May 2018 14:34:13 -0600	[thread overview]
Message-ID: <20180513203413.GB16286@ziepe.ca> (raw)
In-Reply-To: <20180511052519.GA14824@dragonet.kaist.ac.kr>

On Fri, May 11, 2018 at 02:25:22PM +0900, DaeRyong Jeong wrote:
> We report the crash: KASAN: use-after-free Read in cma_cancel_operation
> 
> Note that this bug is previously reported by syzkaller.
> https://syzkaller.appspot.com/bug?id=95f89b8fb9fdc42e28ad586e657fea074e4e719b
> Nonetheless, this bug has not fixed yet, and we hope that this report and our
> analysis, which gets help by the RaceFuzzer's feature, will helpful to fix the
> crash.
> 
> This crash has been found in v4.17-rc1 using RaceFuzzer (a modified
> version of Syzkaller), which we describe more at the end of this
> report. Our analysis shows that the race occurs when invoking two
> syscalls concurrently, write$rdma_cm and write$rdma_cm.

Well, calling rdma_destroy_id() twice/concurrently is invalid.. The
confusing part of this is how does it happen from ucma.c ..

Double calls via write look OK to me, the ID is removed from the IDR
at the top so it cannot be invoked twice.. So not sure what
"write$rdma_cm and write$rdma_cm." is supposed to me?

Is your test showing that write() vs close() is the problem? The oops
suggests that.. And the logic around ctx->closing looks tortured
enough that it is probably wrong...

Jason

  reply	other threads:[~2018-05-13 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11  5:25 KASAN: use-after-free Read in cma_cancel_operation DaeRyong Jeong
2018-05-13 20:34 ` Jason Gunthorpe [this message]
2018-05-17 13:16   ` DaeRyong Jeong
  -- strict thread matches above, loose matches on Subject: below --
2018-04-03  3:01 syzbot
2019-02-20 15:29 ` Dmitry Vyukov

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=20180513203413.GB16286@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=bammanag@purdue.edu \
    --cc=byoungyoung@purdue.edu \
    --cc=danielj@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=inux-rdma@vger.kernel.org \
    --cc=kt0755@gmail.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monis@mellanox.com \
    --cc=parav@mellanox.com \
    --cc=swise@opengridcomputing.com \
    --cc=threeearcat@gmail.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).