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]
Message-ID: <c03d8353-ae34-2f84-68d3-0153873ffc3e@i-love.sakura.ne.jp>
Date:   Thu, 5 Dec 2019 20:00:35 +0900
From:   Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To:     Jouni Högander <jouni.hogander@...kie.com>
Cc:     syzbot <syzbot+30209ea299c09d8785c9@...kaller.appspotmail.com>,
        YueHaibing <yuehaibing@...wei.com>, Julian Anastasov <ja@....bg>,
        ddstreet@...e.org, dvyukov@...gle.com,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
        syzkaller-bugs@...glegroups.com, Hulk Robot <hulkci@...wei.com>,
        "David S. Miller" <davem@...emloft.net>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: Re: unregister_netdevice: waiting for DEV to become free (2)

On 2019/12/05 19:00, Jouni Högander wrote:
>> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
>> index ae3bcb1540ec..562d06c274aa 100644
>> --- a/net/core/net-sysfs.c
>> +++ b/net/core/net-sysfs.c
>> @@ -1459,14 +1459,14 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index)
>>  	struct kobject *kobj = &queue->kobj;
>>  	int error = 0;
>>  
>> +	dev_hold(queue->dev);
>> +
>>  	kobj->kset = dev->queues_kset;
>>  	error = kobject_init_and_add(kobj, &netdev_queue_ktype, NULL,
>>  				     "tx-%u", index);
>>  	if (error)
>>  		goto err;
>>  
>> -	dev_hold(queue->dev);
>> -
>>  #ifdef CONFIG_BQL
>>  	error = sysfs_create_group(kobj, &dql_group);
>>  	if (error)
> 
> Now after reproducing the issue I think this is actually proper fix for
> the issue.  It's not related to missing error handling in in
> tun_set_real_num_queues as I commented earlier. Can you prepare patch
> for this?

You can write the patch; I don't know about commit a3e23f719f5c4a38
("net-sysfs: call dev_hold if kobject_init_and_add success").

I was wondering how can the caller tell whether to drop the refcount, for
the caller won't be able to know which one (kobject_init_and_add() or
sysfs_create_group()) returned an error. Therefore, always taking the
refcount seems to be a proper fix...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ