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.
