[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210114122759.36f64003@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 14 Jan 2021 12:27:59 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Cong Wang <cong.wang@...edance.com>,
syzbot <syzbot+2624e3778b18fc497c92@...kaller.appspotmail.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Xin Long <lucien.xin@...il.com>, Jiri Pirko <jiri@...nulli.us>
Subject: Re: [Patch net v2] cls_flower: call nla_ok() before nla_next()
On Thu, 14 Jan 2021 12:24:19 -0800 Cong Wang wrote:
> > Fair, depth will but 0 so first check already fails, but nla_next()
> > would crash since it tries to access the length of the attribute
> > unconditionally.
>
> nla_next() is only called when nla_ok() returns true, which is not
> the case for msk_depth==0, therefore NULL won't crash here.
>
> The only problem is we become too strict to reject optionally missing
> masks, we should not even call nla_ok() here, otherwise it would
> break user-space. So,
>
> + if (!nla_opt_msk)
> + continue;
>
> Thanks.
You're right.
Powered by blists - more mailing lists