Re: [PATCH] netlink: use "unsigned int" in nla_next()

2016-11-19 Thread David Miller
From: Alexey Dobriyan Date: Sat, 19 Nov 2016 03:54:35 +0300 > ->nla_len is unsigned entity (it's length after all) and u16, > thus it can't overflow when being aligned into int/unsigned int. > > (nlmsg_next has the same code, but I didn't yet convince myself > it is correct

[PATCH] netlink: use "unsigned int" in nla_next()

2016-11-18 Thread Alexey Dobriyan
->nla_len is unsigned entity (it's length after all) and u16, thus it can't overflow when being aligned into int/unsigned int. (nlmsg_next has the same code, but I didn't yet convince myself it is correct to do so). There is pointer arithmetic in this function and offset being unsigned is