lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Mar 2020 08:21:29 +0000
From:   Yanjun Zhu <yanjunz@...lanox.com>
To:     Leon Romanovsky <leon@...nel.org>,
        Jason Gunthorpe <jgg@...lanox.com>
CC:     syzbot <syzbot+e11efb687f5ab7f01f3d@...kaller.appspotmail.com>,
        "dledford@...hat.com" <dledford@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        Moni Shoua <monis@...lanox.com>,
        "syzkaller-bugs@...glegroups.com" <syzkaller-bugs@...glegroups.com>
Subject: RE: KASAN: use-after-free Read in rxe_query_port

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@...nel.org> 
Sent: Tuesday, March 10, 2020 3:40 PM
To: Jason Gunthorpe <jgg@...lanox.com>
Cc: syzbot <syzbot+e11efb687f5ab7f01f3d@...kaller.appspotmail.com>; dledford@...hat.com; linux-kernel@...r.kernel.org; linux-rdma@...r.kernel.org; Moni Shoua <monis@...lanox.com>; syzkaller-bugs@...glegroups.com; Yanjun Zhu <yanjunz@...lanox.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@...kaller.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ