Re: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-19 Thread Jakub Kicinski
On Mon, 19 Oct 2020 01:59:19 + zhudi (J) wrote: > > zhudi, why not use size_t? Seems like the most natural fit for counting > > size. > > Thanks for your replying. > min_dump_alloc original type used is u16 and it's eventually assigned to > struct netlink_callback{}. min_dump_alloc which d

Re: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-18 Thread zhudi (J)
> On Sat, 17 Oct 2020 14:34:11 +0200 Michal Kubecek wrote: > > On Fri, Oct 16, 2020 at 10:02:38AM +0800, zhudi wrote: > > > "ip addr show" command execute error when we have a physical > network > > > card with number of VFs larger than 247. > > > > > > The return value of if_nlmsg_size() in rtnl_c

答复: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-18 Thread zhudi (J)
> > "ip addr show" command execute error when we have a physical network > > card with number of VFs larger than 247. > > Oh man, this bug has been hurting us forever and I've tried to fix it several > times without much luck, so thanks for working on it! > > CC: David Ahern > > As he's mention

Re: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-18 Thread zhudi (J)
> On Fri, Oct 16, 2020 at 10:02:38AM +0800, zhudi wrote: > > "ip addr show" command execute error when we have a physical network > > card with number of VFs larger than 247. > > > > The return value of if_nlmsg_size() in rtnl_calcit() will exceed range > > of u16 data type when any network cards

Re: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-18 Thread Jakub Kicinski
On Sat, 17 Oct 2020 14:34:11 +0200 Michal Kubecek wrote: > On Fri, Oct 16, 2020 at 10:02:38AM +0800, zhudi wrote: > > "ip addr show" command execute error when we have a physical > > network card with number of VFs larger than 247. > > > > The return value of if_nlmsg_size() in rtnl_calcit() will

Re: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-17 Thread Michal Kubecek
On Fri, Oct 16, 2020 at 10:02:38AM +0800, zhudi wrote: > "ip addr show" command execute error when we have a physical > network card with number of VFs larger than 247. > > The return value of if_nlmsg_size() in rtnl_calcit() will exceed > range of u16 data type when any network cards has a larger

Re: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-16 Thread Jesse Brandeburg
Vladimir Oltean wrote: > On Fri, Oct 16, 2020 at 02:36:25PM -0700, Jesse Brandeburg wrote: > > > Signed-off-by: zhudi > > > > Kernel documentation says for you to use your real name, please do so, > > unless you're a rock star and have officially changed your name to > > zhudi. I apologize for

Re: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-16 Thread Vladimir Oltean
On Fri, Oct 16, 2020 at 02:36:25PM -0700, Jesse Brandeburg wrote: > > Signed-off-by: zhudi > > Kernel documentation says for you to use your real name, please do so, > unless you're a rock star and have officially changed your name to > zhudi. Well, his real name is probably 朱棣, and the pinyin t

Re: [PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-16 Thread Jesse Brandeburg
zhudi wrote: > "ip addr show" command execute error when we have a physical > network card with number of VFs larger than 247. Oh man, this bug has been hurting us forever and I've tried to fix it several times without much luck, so thanks for working on it! CC: David Ahern As he's mentioned t

[PATCH] rtnetlink: fix data overflow in rtnl_calcit()

2020-10-15 Thread zhudi
"ip addr show" command execute error when we have a physical network card with number of VFs larger than 247. The return value of if_nlmsg_size() in rtnl_calcit() will exceed range of u16 data type when any network cards has a larger number of VFs. rtnl_vfinfo_size() will significant increase need