All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Yanjun Zhu <yanjunz@mellanox.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>,
	syzbot <syzbot+e11efb687f5ab7f01f3d@syzkaller.appspotmail.com>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Moni Shoua <monis@mellanox.com>,
	"syzkaller-bugs@googlegroups.com"
	<syzkaller-bugs@googlegroups.com>
Subject: Re: KASAN: use-after-free Read in rxe_query_port
Date: Tue, 10 Mar 2020 10:41:15 +0200	[thread overview]
Message-ID: <20200310084115.GB242734@unreal> (raw)
In-Reply-To: <AM6PR05MB50143279152CCAB54786D930D8FF0@AM6PR05MB5014.eurprd05.prod.outlook.com>

On Tue, Mar 10, 2020 at 08:21:29AM +0000, Yanjun Zhu wrote:
> Hi, Leon
>
> Thanks. From the patch https://lore.kernel.org/netdev/20200306134518.84416-1-kgraul@linux.ibm.com,
>
> @@ -240,6 +240,9 @@ static void smc_ib_port_event_work(struct work_struct *work)
>  		work, struct smc_ib_device, port_event_work);
>  	u8 port_idx;
>
> +	if (list_empty(&smcibdev->list))
> +		return;
> +
>  	for_each_set_bit(port_idx, &smcibdev->port_event_mask, SMC_MAX_PORTS) {
>  		smc_ib_remember_port_attr(smcibdev, port_idx + 1);
>  		clear_bit(port_idx, &smcibdev->port_event_mask);
>
> This block is try to check smcibdev->list to avoid ib_query_port after the NIC is down.
> But smcibdev->list is used by spinlock when add and del.
> "
> ...
> 549         spin_lock(&smc_ib_devices.lock);
> 550         list_add_tail(&smcibdev->list, &smc_ib_devices.list);
> 551         spin_unlock(&smc_ib_devices.lock);
> ...
>
> 579         spin_lock(&smc_ib_devices.lock);
> 580         list_del_init(&smcibdev->list); /* remove from smc_ib_devices */
> 581         spin_unlock(&smc_ib_devices.lock);
> ...
> "
> So in the above block, is it necessary to protect  smcibdev->list when it is accessed?
> Please comment on it.

It is worth to read whole thread and not first email only.
https://lore.kernel.org/netdev/20200308150107.GC11496@unreal/

Thanks

>
> Thanks a lot.
> Zhu Yanjun
>
> -----Original Message-----
> From: Leon Romanovsky <leon@kernel.org>
> Sent: Tuesday, March 10, 2020 3:40 PM
> To: Jason Gunthorpe <jgg@mellanox.com>
> Cc: syzbot <syzbot+e11efb687f5ab7f01f3d@syzkaller.appspotmail.com>; dledford@redhat.com; linux-kernel@vger.kernel.org; linux-rdma@vger.kernel.org; Moni Shoua <monis@mellanox.com>; syzkaller-bugs@googlegroups.com; Yanjun Zhu <yanjunz@mellanox.com>
> Subject: Re: KASAN: use-after-free Read in rxe_query_port
>
> On Mon, Mar 09, 2020 at 02:34:51PM -0300, Jason Gunthorpe wrote:
> > On Sun, Mar 01, 2020 at 03:20:12AM -0800, syzbot wrote:
> > > Hello,
> > >
> > > syzbot found the following crash on:
> > >
> > > HEAD commit:    f8788d86 Linux 5.6-rc3
> > > git tree:       upstream
> > > console output: https://syzkaller.appspot.com/x/log.txt?x=132d3645e00000
> > > kernel config:  https://syzkaller.appspot.com/x/.config?x=9833e26bab355358
> > > dashboard link: https://syzkaller.appspot.com/bug?extid=e11efb687f5ab7f01f3d
> > > compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
> > >
> > > Unfortunately, I don't have any reproducer for this crash yet.
> > >
> > > IMPORTANT: if you fix the bug, please add the following tag to the commit:
> > > Reported-by: syzbot+e11efb687f5ab7f01f3d@syzkaller.appspotmail.com
> >
> > Yanjun, do you have some idea what this could be?
>
> See this fix in the net mailing list.
> https://lore.kernel.org/netdev/20200306134518.84416-1-kgraul@linux.ibm.com
>
> Thanks
>
> >
> > Thanks,
> > Jason

  reply	other threads:[~2020-03-10  8:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 11:20 KASAN: use-after-free Read in rxe_query_port syzbot
2020-03-09 17:34 ` Jason Gunthorpe
2020-03-10  2:43   ` Yanjun Zhu
2020-03-10  7:39   ` Leon Romanovsky
2020-03-10  8:21     ` Yanjun Zhu
2020-03-10  8:41       ` Leon Romanovsky [this message]
2020-03-10 14:52     ` 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=20200310084115.GB242734@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=monis@mellanox.com \
    --cc=syzbot+e11efb687f5ab7f01f3d@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=yanjunz@mellanox.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 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.