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] [day] [month] [year] [list]
Date:   Wed, 15 Jun 2022 19:57:42 +0800
From:   Zhen Chen <chenzhen126@...wei.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
CC:     syzbot <syzbot+2e3efb5eb71cb5075ba7@...kaller.appspotmail.com>,
        <davem@...emloft.net>, <jhs@...atatu.com>, <jiri@...nulli.us>,
        <kuba@...nel.org>, <linux-kernel@...r.kernel.org>,
        <netdev@...r.kernel.org>, <syzkaller-bugs@...glegroups.com>,
        <xiyou.wangcong@...il.com>, <rose.chen@...wei.com>
Subject: Re: [syzbot] WARNING: ODEBUG bug in route4_destroy



On 22/6/14 22:46, Dan Carpenter wrote:
> On Tue, Jun 14, 2022 at 10:35:44PM +0800, 'Zhen Chen' via syzkaller-bugs wrote:
>>
>> This looks like  route4_destroy is deleting the 'fold' which has been
>> freed by tcf_queue_work in route4_change. It means 'fold' is still in
>> the table.
>> I have tested this patch on syzbot and it works well, but I am not
>> sure whether it will introduce other issues...
>>
>> diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
>> index a35ab8c27866..758c21f9d628 100644
>> --- a/net/sched/cls_route.c
>> +++ b/net/sched/cls_route.c
>> @@ -526,7 +526,7 @@ static int route4_change(struct net *net, struct sk_buff *in_skb,
>>  	rcu_assign_pointer(f->next, f1);
>>  	rcu_assign_pointer(*fp, f);
>>  
>> -	if (fold && fold->handle && f->handle != fold->handle) {
>> +	if (fold && f->handle != fold->handle) {
>                                  ^^^^^^^^^^^^
> There is still a dereference here so your patch doesn't make sense. :/
> 
> regards,
> dan carpenter

Thanks for your reply but I think the dereference may not be the point.
If fold->handle equals 0, it will not be removed from the hash table, but afterwards the old filter will be freed because it only checks the pointer 'fold' is null or not.

if (fold) {
	tcf_unbind_filter(tp, &fold->res);
	tcf_exts_get_net(&fold->exts);
	tcf_queue_work(&fold->rwork, route4_delete_filter_work);
}

So my patch simply eliminates the handle judgement and it seems to work fine on syzbot.
If I misunderstood anything, pleaese let me know :)   Thanks!

Powered by blists - more mailing lists