platform/netlink: fix overrun in attribute iteration in nla_ok()

See-also: 123dc07bcc
See-also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1045b03e07d85f3545118510a587035536030c1c
(cherry picked from commit c295d45a3b)
(cherry picked from commit ec1c512e40)
This commit is contained in:
Thomas Haller 2018-10-10 11:59:24 +02:00
parent 89b7f638ed
commit dcec33798e

View file

@ -252,7 +252,7 @@ struct nlattr *nla_find (const struct nlattr *head, int len, int attrtype);
static inline int
nla_ok (const struct nlattr *nla, int remaining)
{
return remaining >= sizeof(*nla) &&
return remaining >= (int) sizeof(*nla) &&
nla->nla_len >= sizeof(*nla) &&
nla->nla_len <= remaining;
}