lkml.org 
[lkml]   [2020]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: KASAN: use-after-free Read in rxe_query_port
Date
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.

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

\
 
 \ /
  Last update: 2020-03-10 09:22    [W:0.068 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site