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>] [day] [month] [year] [list]
Date:   Fri, 29 May 2020 10:09:54 -0300
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     Hillf Danton <hdanton@...a.com>
Cc:     syzbot <syzbot+478fd0d54412b8759e0d@...kaller.appspotmail.com>,
        dledford@...hat.com, leon@...nel.org, linux-kernel@...r.kernel.org,
        linux-rdma@...r.kernel.org, michal.kalderon@...vell.com,
        syzkaller-bugs@...glegroups.com, yishaih@...lanox.com
Subject: Re: KASAN: use-after-free Read in ib_uverbs_remove_one

On Fri, May 29, 2020 at 04:31:26PM +0800, Hillf Danton wrote:
> Hold another grab to dev to prevent it from going home before work gets
> done with it.
> 
> +++ b/drivers/infiniband/core/uverbs_main.c
> @@ -1152,6 +1152,8 @@ static int ib_uverbs_add_one(struct ib_d
>  		  device->ops.mmap ? &uverbs_mmap_fops : &uverbs_fops);
>  	uverbs_dev->cdev.owner = THIS_MODULE;
>  
> +	/* pair with put_device() in ib_uverbs_remove_one() */
> +	get_device(&uverbs_dev->dev);
>  	ret = cdev_device_add(&uverbs_dev->cdev, &uverbs_dev->dev);
>  	if (ret)
>  		goto err_uapi;

Doesn't look right, the put_device() in uverbs_remove_one() pairs with
the device_initialize() in this function.

The only thing I can think of is we called remove_once twice
somehow or had an extra put on some error path. But I couldn't find
any flow that would do either of those things

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ